Nubbs Posted February 22, 2009 Author Share Posted February 22, 2009 1.ok im using EE 2.7 so basically what i want to know isA. is this possible?B. i need to know how "difficult" it would beC.the right places in the script i would need to edit to make it work2\. i want to make my game to where if a player class is on a certain map they would get a + bonus to their stats (only while on the select map)3\. this is the only way i could think i could do this (beware im noob and this is my first attempt at writing my own scriptso this might look retarded in every aspect of it)4.IF some of these commands done even exist lol let me know im not going to cry if you post " wow youre an idiot… my grandma can script better.. you shouldve done this like so... everyone else knows how to do it..why dont you?.. you suck " i have no hard feelings against anyone here since ya know its just the freakin internet...Sub ScriptedTile(Index, Script)Select Case ScriptCase 0Call GetPlayerClass(index,(class number i would want to have the bonus) if GetPlayerClass = (class number that would recieve bonus)Call GetPlayerMap(index,(Mapnumber)) if GetPlayerMap = (map number i would want the bonus to be for)Call PlayerMsg(Index, "Ahhh.. feels like.home.", WHITE)Call GetPlayerSTRCall SetPlayerSTR(index,(say + 5 )Call GetPlayerDEFCall SetPlayerDEF(index,(again + 5) End IfCall GetPlayerClass(index) = falseCall GetPlayerMap(index) = false Exit Subthanks for reading through all this mess Link to comment Share on other sites More sharing options...
Guest Posted February 22, 2009 Share Posted February 22, 2009 ok i think this would be very easy BUT i would use a timer to check if the user is still on the tile and u could use a buff script for a base GOOD LUCK Link to comment Share on other sites More sharing options...
Dark_Marine_123 Posted February 22, 2009 Share Posted February 22, 2009 Use Sub OnMapLoad(Index, OldMap, NewMap) instead :D Link to comment Share on other sites More sharing options...
Warconn Posted February 22, 2009 Share Posted February 22, 2009 here, this should be what you want, not tested, but an outline that should work``` Case 0dim classdim strdim def if GetPlayerClass = (class number that would recieve bonus) if GetPlayerMap = (map number i would want the bonus to be for) Call PlayerMsg(Index, "Ahhh.. feels like.home.", WHITE) str = GetPlayerSTR Call SetPlayerSTR(index,(str + 5 ) def= GetPlayerDEF Call SetPlayerDEF(index,(def + 5) End IfEnd if Exit Sub```again, that is just an outline, i just cleaned up your code a bit…im not sure what you mean byCall GetPlayerClass(index) = falseCall GetPlayerMap(index) = falsewhat are you trying to do there? Link to comment Share on other sites More sharing options...
Nubbs Posted February 23, 2009 Author Share Posted February 23, 2009 didn't understand it at first but i get it now) Riney thank you every little bit helps@[VB:> Warconn link=topic=39203.msg380947#msg380947 date=1235331465]> > im not sure what you mean by> > Call GetPlayerClass(index) = false> Call GetPlayerMap(index) = false> > what are you trying to do there?ok what that was supposed to be is .. basically i thought i needed these or something like this to end the sub if the player was not on a map( or the right class) that they would recieve the bonus ..if your still confused about what i mean ill find a better way to explain it (sorry very very busy day at work today)thanks for cleaning up the mess i was so loopy yesterday (i didnt think to make it in the editor and then copy/paste… im going to test that out to see if it works and then let you know and go from there... again thank you for helping me with this... i only got a "6" on the nerd script test (43% scored higher than me and 41% scored lower) though i think with it being a multiple choice test i might've got lucky on 2 questions... lol Link to comment Share on other sites More sharing options...
xeross Posted February 23, 2009 Share Posted February 23, 2009 @Riney:> Use Sub OnMapLoad(Index, OldMap, NewMap) instead :DLike he said use OnMapLoad check if NewMap = map that you want and increase stats there.Then make a check if OldMap is map that you want and decrease the stat, or something similiar Link to comment Share on other sites More sharing options...
Warconn Posted February 23, 2009 Share Posted February 23, 2009 @Nubbs:> didn't understand it at first but i get it now) Riney thank you every little bit helps> > ok what that was supposed to be is .. basically i thought i needed these or something like this to end the sub if the player was not on a map( or the right class) that they would recieve the bonus ..> > if your still confused about what i mean ill find a better way to explain it (sorry very very busy day at work today)> > thanks for cleaning up the mess i was so loopy yesterday (i didnt think to make it in the editor and then copy/paste… im going to test that out to see if it works and then let you know and go from there... again thank you for helping me with this... i only got a "6" on the nerd script test (43% scored higher than me and 41% scored lower) though i think with it being a multiple choice test i might've got lucky on 2 questions... lolyea, no problemyou would want to use an "else" there for people who do not have the class requirments, like```elsecall playermsg(index, "You enter a house, but do not feel at home.", RED) ```i think thats what you want lol? Link to comment Share on other sites More sharing options...
Nubbs Posted February 23, 2009 Author Share Posted February 23, 2009 no,Warconn sorry lol i think you get what i mean but i dont want to Call PlayerMsg i just want it not to work if the player class isnt the one receiving the bonus…thanks again@Xeross:> Then make a check if OldMap is map that you want and decrease the stat, or something similiaro0oh thanks for that idea :).. so would i need to make a check if i just want the stats to stay the same (when not on a map that the class would receive a bonus on)? obviously im not sure if i do or dont but my intuition tells me that i dont… thanks for the help hopefully when i get this working i can post it in the database..(with credits including all here who have helped me) :cheesy: Link to comment Share on other sites More sharing options...
Nubbs Posted February 23, 2009 Author Share Posted February 23, 2009 Sub OnMapLoad(Index, OldMap, NewMap) so if i use thisA. do i need a case #?B. if the answer "A" is yes then my question is answered before i ask itC. if the answer to "A" is no then… Would i need to add GetVar, PutVar commands and make an .ini file to make this work differently for say 4 classes( just an example making the animals=classes and the "terrain type"=map number) frog's get bonus in a swamp map, polar bears get a bonus on a snow map... Link to comment Share on other sites More sharing options...
xeross Posted February 23, 2009 Share Posted February 23, 2009 you could use Case code or If code whatever you like.From the back of my head.```if NewMap = MAPNUM then Call SetPlayerSTR(GetPlayerSTR(index) + 5)end ifif OldMap = MAPNUM then Call SetPlayerSTR(GetPlayerSTR(index) - 5)end if```This is all from the back of my head dunno if it works, last time i used ss is half a year ago or more. Link to comment Share on other sites More sharing options...
Nubbs Posted February 23, 2009 Author Share Posted February 23, 2009 cool,thanks ok im going to attempt this script again and then post my results… Link to comment Share on other sites More sharing options...
Nubbs Posted February 23, 2009 Author Share Posted February 23, 2009 ``` Sub OnMapLoad(Index, OldMap, NewMap)Case 0dim classdim strdim def if GetPlayerClass = (class number that would recieve bonus) if GetPlayerMap = (map number i would want the bonus to be for) Call PlayerMsg(Index, "Ahhh.. feels like.home.", WHITE) str = GetPlayerSTR Call SetPlayerSTR(index,(str + 5) def= GetPlayerDEF Call SetPlayerDEF(index,(def + 5) ElseIf GetPlayerClass = (class number that would recieve bonus) GetPlayerMap = (map number i would want the bonus to be for) Call PlayerMsg(Index, "Ahhh.. feels like.home.", WHITE) str = GetPlayerSTR Call SetPlayerSTR(index,(str + 5) def= GetPlayerDEF Call SetPlayerDEF(index,(def + 5) ElseIf GetPlayerClass = (class number that would recieve bonus) GetPlayerMap = (map number i would want the bonus to be for) Call PlayerMsg(Index, "Ahhh.. feels like.home.", WHITE) str = GetPlayerSTR Call SetPlayerSTR(index,(str + 5) def= GetPlayerDEF Call SetPlayerDEF(index,(def + 5) ElseIf GetPlayerClass = (class number that would recieve bonus) GetPlayerMap = (map number i would want the bonus to be for) Call PlayerMsg(Index, "Ahhh.. feels like.home.", WHITE) str = GetPlayerSTR Call SetPlayerSTR(index,(str + 5) def= GetPlayerDEF Call SetPlayerDEF(index,(def + 5) elseEnd IfEnd if Exit Sub ```i havent tested it but i figured id post it and see if someone finds something wrong with it before i do test it.. im pretty confident this will work .. :D i wanted to make this work for 4 different classes …1 map per class...*EDIT /fail >.< Link to comment Share on other sites More sharing options...
cheatking Posted February 23, 2009 Share Posted February 23, 2009 I'll fix up errors for you.Done!```Sub OnMapLoad(Index, OldMap, NewMap)Dim classDim StrDim DefIf GetPlayerClass = 0 Then ' Class If GetPlayerMap = 0 Then ' Map Call PlayerMsg(Index, "Ahhh.. feels like home.", WHITE) Str = GetPlayerSTR(index) Call SetPlayerSTR(index, (Str + 5) Def = GetPlayerDEF(index) Call SetPlayerDEF(index, (Def + 5) End IfElse If GetPlayerClass = 0 Then ' Class If GetPlayerMap = 0 Then ' Map Call PlayerMsg(Index, "Ahhh.. feels like home.", WHITE) Str = GetPlayerSTR(index) Call SetPlayerSTR(index, (Str + 5) Def = GetPlayerDEF(index) Call SetPlayerDEF(index, (Def + 5) End IfElse If GetPlayerClass = 0 Then ' Class If GetPlayerMap = 0 Then ' Map Call PlayerMsg(Index, "Ahhh.. feels like home.", WHITE) Str = GetPlayerSTR(index) Call SetPlayerSTR(index, (Str + 5) Def = GetPlayerDEF(index) Call SetPlayerDEF(index, (Def + 5) End IfElse If GetPlayerClass = 0 Then ' Class If GetPlayerMap = 0 Then ' Map Call PlayerMsg(Index, "Ahhh.. feels like home.", WHITE) Str = GetPlayerSTR(index) Call SetPlayerSTR(index, (Str + 5) Def = GetPlayerDEF(index) Call SetPlayerDEF(index, (Def + 5) End IfElse If GetPlayerClass = 0 Then ' Class If GetPlayerMap = 0 Then ' Map Call PlayerMsg(Index, "Ahhh.. feels like home.", WHITE) Str = GetPlayerSTR(index) Call SetPlayerSTR(index, (Str + 5) Def = GetPlayerDEF(index) Call SetPlayerDEF(index, (Def + 5) End IfEnd IfEnd Sub``` Link to comment Share on other sites More sharing options...
Dark_Marine_123 Posted February 23, 2009 Share Posted February 23, 2009 @Nubbs:> ```> Sub OnMapLoad(Index, OldMap, NewMap)> > Case 0> > dim class> dim str> dim def> > if GetPlayerClass = (class number that would recieve bonus)> > if GetPlayerMap = (map number i would want the bonus to be for)> > Call PlayerMsg(Index, "Ahhh.. feels like.home.", WHITE)> str = GetPlayerSTR> Call SetPlayerSTR(index,(str + 5)> def= GetPlayerDEF> Call SetPlayerDEF(index,(def + 5)> ElseIf> > GetPlayerClass = (class number that would recieve bonus)> > GetPlayerMap = (map number i would want the bonus to be for)> > Call PlayerMsg(Index, "Ahhh.. feels like.home.", WHITE)> str = GetPlayerSTR> Call SetPlayerSTR(index,(str + 5)> def= GetPlayerDEF> Call SetPlayerDEF(index,(def + 5)> ElseIf> > GetPlayerClass = (class number that would recieve bonus)> > GetPlayerMap = (map number i would want the bonus to be for)> > Call PlayerMsg(Index, "Ahhh.. feels like.home.", WHITE)> str = GetPlayerSTR> Call SetPlayerSTR(index,(str + 5)> def= GetPlayerDEF> Call SetPlayerDEF(index,(def + 5)> ElseIf> > GetPlayerClass = (class number that would recieve bonus)> > GetPlayerMap = (map number i would want the bonus to be for)> > Call PlayerMsg(Index, "Ahhh.. feels like.home.", WHITE)> str = GetPlayerSTR> Call SetPlayerSTR(index,(str + 5)> def= GetPlayerDEF> Call SetPlayerDEF(index,(def + 5)> else> > End If> End if> Exit Sub > ```> i havent tested it but i figured id post it and see if someone finds something wrong with it before i do test it.. im pretty confident this will work .. :D i wanted to make this work for 4 different classes …1 map per class...> > *EDIT /fail >.<If you're going to use a case you have to make sure Select Case Something is there Link to comment Share on other sites More sharing options...
Nubbs Posted February 23, 2009 Author Share Posted February 23, 2009 I tested that Sean and it still doesn't work…Class0.ini = 0(first class)Class1.ini = 1(second class)is this correct? just making sure Link to comment Share on other sites More sharing options...
Nubbs Posted February 23, 2009 Author Share Posted February 23, 2009 yea i took out the case# i figured if anything the playerMsg would be working but its not Link to comment Share on other sites More sharing options...
cheatking Posted February 23, 2009 Share Posted February 23, 2009 ```' Executes each time a player changes map.Sub OnMapLoad(Index, OldMap, NewMap)Dim StrDim Def' Give StatsIf GetPlayerClass(index) = 0 Then ' Class If GetPlayerMap(index) = 1 Then ' Map Call PlayerMsg(Index, "Ahhh.. feels like home.", WHITE) Str = GetPlayerSTR(index) Call SetPlayerSTR(index, (Str + 5)) Def = GetPlayerDEF(index) Call SetPlayerDEF(index, (Def + 5)) Call SendPlayerData(index) End IfEnd If' Take stats when not on mapIf GetPlayerClass(index) = 0 Then ' Class If Not GetPlayerMap(index) = 1 Then ' Map Call PlayerMsg(Index, "Ahhh.. feels like home.", WHITE) Str = GetPlayerSTR(index) Call SetPlayerSTR(index, (Str - 5)) Def = GetPlayerDEF(index) Call SetPlayerDEF(index, (Def - 5)) Call SendPlayerData(index) End IfEnd IfEnd Sub```Fixed more errors. I works now. Link to comment Share on other sites More sharing options...
Kite Posted February 23, 2009 Share Posted February 23, 2009 I tied it you can keep walking and each field you get weaker and stats do not go back when you leave the field Link to comment Share on other sites More sharing options...
cheatking Posted February 23, 2009 Share Posted February 23, 2009 Say again? I don't understand. Link to comment Share on other sites More sharing options...
Kite Posted February 23, 2009 Share Posted February 23, 2009 Okay,when I go on the lvl it says ahh…I feel weaker,so I lose stats.When I leave the field,and come back it takes stats again.When I go to a town my stats stay like -10 and they will not come back.Even after I leave the field. Link to comment Share on other sites More sharing options...
cheatking Posted February 23, 2009 Share Posted February 23, 2009 To take stats on certin maps:```' Executes each time a player changes map.Sub OnMapLoad(Index, OldMap, NewMap)Dim StrDim Def' Give StatsIf GetPlayerClass(index) = 0 Then ' Class If GetPlayerMap(index) = 1 Then ' Map Call PlayerMsg(Index, "I feel weaker here...", WHITE) Str = GetPlayerSTR(index) Call SetPlayerSTR(index, (Str - 5)) Def = GetPlayerDEF(index) Call SetPlayerDEF(index, (Def - 5)) Call SendPlayerData(index) End IfEnd If' Take stats when not on mapIf GetPlayerClass(index) = 0 Then ' Class If Not GetPlayerMap(index) = 1 Then ' Map Call PlayerMsg(Index, "I feel stronger here...", WHITE) Str = GetPlayerSTR(index) Call SetPlayerSTR(index, (Str + 5)) Def = GetPlayerDEF(index) Call SetPlayerDEF(index, (Def + 5)) Call SendPlayerData(index) End IfEnd IfEnd Sub```To give stats on certin maps:```' Executes each time a player changes map.Sub OnMapLoad(Index, OldMap, NewMap)Dim StrDim Def' Give StatsIf GetPlayerClass(index) = 0 Then ' Class If GetPlayerMap(index) = 1 Then ' Map Call PlayerMsg(Index, "I feel stronger here...", WHITE) Str = GetPlayerSTR(index) Call SetPlayerSTR(index, (Str + 5)) Def = GetPlayerDEF(index) Call SetPlayerDEF(index, (Def + 5)) Call SendPlayerData(index) End IfEnd If' Take stats when not on mapIf GetPlayerClass(index) = 0 Then ' Class If Not GetPlayerMap(index) = 1 Then ' Map Call PlayerMsg(Index, "I feel weakerhere...", WHITE) Str = GetPlayerSTR(index) Call SetPlayerSTR(index, (Str - 5)) Def = GetPlayerDEF(index) Call SetPlayerDEF(index, (Def - 5)) Call SendPlayerData(index) End IfEnd IfEnd Sub``` Link to comment Share on other sites More sharing options...
Kite Posted February 23, 2009 Share Posted February 23, 2009 I added that it still does it,I just took it out and am just gonna forget it.I need something like elements since elements is broken on 2.7 Link to comment Share on other sites More sharing options...
cheatking Posted February 23, 2009 Share Posted February 23, 2009 Oh i see the error.Fixed:```' Executes each time a player changes map.Sub OnMapLoad(Index, OldMap, NewMap)Dim StrDim Def' Give StatsIf GetPlayerMap(index) = 1 And GetVar("StatsUp.ini", GetPlayerName(index),"StatsUp") = 0 Then ' Map If GetPlayerClass(index) = 0 Then ' Class Call PlayerMsg(Index, "I feel stronger here...", WHITE) Str = GetPlayerSTR(index) Call SetPlayerSTR(index, (Str + 5)) Def = GetPlayerDEF(index) Call SetPlayerDEF(index, (Def + 5)) Call SendPlayerData(index) Call PutVar("StatsUp.ini", GetPlayerName(index),"StatsUp", 1) End IfEnd If' Take stats when not on mapIf Not GetPlayerMap(index) = 1 Then ' Map If GetPlayerClass(index) = 0 Then ' Class Call PlayerMsg(Index, "I feel weaker here...", WHITE) Str = GetPlayerSTR(index) Call SetPlayerSTR(index, (Str - 5)) Def = GetPlayerDEF(index) Call SetPlayerDEF(index, (Def - 5)) Call SendPlayerData(index) Call PutVar("StatsUp.ini", GetPlayerName(index),"StatsUp", 0) End IfEnd IfEnd Sub``` Link to comment Share on other sites More sharing options...
Nubbs Posted February 23, 2009 Author Share Posted February 23, 2009 so i need to make an .ini file named "StatsUp" that looks like this> [StatsUp]> > Statsup=(what do i put here?)> > and what exactly is that number used for/representing? (i dont understand it completely)GetVar("StatsUp.ini", GetPlayerName(index),"StatsUp")shouldn't it beGetVar("StatsUp.ini", & GetPlayerName(index),"StatsUp")? Link to comment Share on other sites More sharing options...
xeross Posted February 24, 2009 Share Posted February 24, 2009 Guys the OldMap and NewMap vars aren't there for nothing use them in your if's look at my code. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now