firegold Posted September 4, 2008 Author Share Posted September 4, 2008 I was trying to edit someones transforming script so i can have more than one transformation but the problem is that when i use this i cannot change back to the human form here is the whole script i think the problem may be somewhere in the green texti give credit to Cruzn for making alot of this scriptby the way i am using EE 2.7Sub Werewolf(index)Dim SDim DDim EDim PDim GS=Int(GetPlayerSTR(Index) + 10)D=Int(GetPlayerDEF(Index) + 5)E=Int(GetPlayerSP(Index) + 2)P=Int(GetPlayerPK(Index) + 300)G=1If GetPlayerClass(Index) = 1 ThenCall PutVar("Werewolf.ini", GetPlayerName(index), "MP", Int(GetPlayerMAGI(Index)))Call PutVar("SPRT.ini", GetPlayerName(Index),"SP", Int(GetPlayerSprite(Index)))Call SetPlayerSprite(index, 129)Call PlayerMsg(index, "You start to feel cold as your flesh disapears.", 0)Call SetPlayerMAGI(Index, G)Call SendPlayerData(index)Call SetPlayerClass(Index, 3)Call SetPlayerSTR(Index, S)Call SetPlayerDEF(Index, D)Call SetPlayerSP(Index, E)Call SetPlayerPK(Index, P)Call SendPlayerData(Index)ElseCall PlayerMsg(Index, "You are not a Shapechanger.", 0)End IfEnd SubSub Human(index)Dim RDim FDim ADim KDim MDim TDim ER=Int(GetPlayerSTR(Index) - 10)F=Int(GetPlayerDEF(Index) - 5)A=Int(GetPlayerSP(Index) - 10)K=Int(GetPlayerPK(Index) - 300)E=Int(GetPlayerDEF(Index) - 15)J=Int(GetPlayerSTR(Index) - 2)D=Int(GetVar("Werewolf.ini", GetPlayerName(index), "MP"))T=Int(GetVar("SPRT.ini", GetPlayerName(Index),"SP"))G=Int(GetVar("AQUAS.ini", GetPlayerName(index), "MP"))If GetPlayerClass(Index) = 3 ThenCall SetPlayerSprite(index, T)Call PlayerMsg(index, "You start to feel warmer as your body regains color.", 0)Call SendPlayerData(index)Call SetPlayerClass(Index, 1)Call SetPlayerSTR(Index, R)Call SetPlayerDEF(Index, F)Call SetPlayerSP(Index, A)Call SetPlayerPK(Index, K)Call SetPlayerMAGI(Index, M)Call SendPlayerData(Index)ElseIf GetPlayerclass(Index) = 4 ThenCall SetPlayerSprite(index, T)Call PlayerMsg(index, "You start to feel warmer as your body regains color.", 0)Call SendPlayerData(index)Call SetPlayerClass(Index, 1)Call SetPlayerSTR(Index, J)Call SetPlayerDEF(Index, E)Call SetPlayerPK(Index, K)Call SetPlayerMAGI(Index, M)Call SendPlayerData(Index)ElseCall PlayerMsg(Index, "You were always human.", 0)End IfEnd SubSub Aquas(index)Dim SDim DDim EDim PDim GS=Int(GetPlayerSTR(Index) + 2)D=Int(GetPlayerDEF(Index) + 15)P=Int(GetPlayerPK(Index) + 300)G=1If GetPlayerClass(Index) = 1 ThenCall PutVar("AQUAS.ini", GetPlayerName(index), "MP", Int(GetPlayerMAGI(Index)))Call PutVar("SPRT.ini", GetPlayerName(Index),"SP", Int(GetPlayerSprite(Index)))Call SetPlayerSprite(index, 129)Call PlayerMsg(index, "You start to feel Dry as you grow fins.", 0)Call SetPlayerMAGI(Index, G)Call SendPlayerData(index)Call SetPlayerClass(Index, 4)Call SetPlayerSTR(Index, S)Call SetPlayerDEF(Index, D)Call SetPlayerPK(Index, P)Call SendPlayerData(Index)ElseCall PlayerMsg(Index, "You are not a Shapechanger.", 0)End IfEnd SubCase "/man"Call Human(index)Exit SubCase "/wolf"Call Werewolf(index)Exit SubCase "/aquas"Call Aquas(index)Exit Sub Link to comment Share on other sites More sharing options...
DrNova Posted September 4, 2008 Share Posted September 4, 2008 but the other ones work? Link to comment Share on other sites More sharing options...
Zananok Posted September 4, 2008 Share Posted September 4, 2008 LOL… I'm so uber that I found the bug without even reading the code :P (jk)Your bug: 2.7 doesn't support 'setplayersprite()'It's posted in many different topics (incl. the main topic of 2.7).Sorry, if you want 'setplayersprite()' you will have to use older versions of EE or TE or wait for a new 2.7 when i fix it or 2.8... :SHope this helps, Report,From: Zananok Link to comment Share on other sites More sharing options...
firegold Posted September 4, 2008 Author Share Posted September 4, 2008 i think ive used the setplayer sprite a few times and it worked on the server before is started messing with it its just when i transform i cant change back into a human Link to comment Share on other sites More sharing options...
DrNova Posted September 4, 2008 Share Posted September 4, 2008 Um, I use set player sprite all the time, it works.You just have to change maps before you can see it.That or use somekinda updateplayer data command or something.My script warps them as they change sprite(launching their ship to space) so it is perfect for me.But the command works, just need a map reload to refresh the player data, or a command to do it Link to comment Share on other sites More sharing options...
Bobosk Posted September 4, 2008 Share Posted September 4, 2008 SendPlayerData(Index) :)Now the biggest thing i see there, is he isn't diming some things…Also, he's trying to use M as a variable, without actually having one... now i can only guess as to what he needed M for.. so it's up to him to fill it out(also there's alot more wrong with this but ican't really fix it right now so go ahead next person in line)```Sub Human(index)Dim ADim DDim EDim FDim GDim JDim KDim MDim RDim TA=Int(GetPlayerSP(Index) - 10)D=Int(GetVar("Werewolf.ini", GetPlayerName(index), "MP"))E=Int(GetPlayerDEF(Index) - 15)F=Int(GetPlayerDEF(Index) - 5)G=Int(GetVar("AQUAS.ini", GetPlayerName(index), "MP"))J=Int(GetPlayerSTR(Index) - 2)K=Int(GetPlayerPK(Index) - 300)M=Int()R=Int(GetPlayerSTR(Index) - 10)T=Int(GetVar("SPRT.ini", GetPlayerName(Index),"SP"))If GetPlayerClass(Index) = 3 ThenCall SetPlayerSprite(index, T)Call PlayerMsg(index, "You start to feel warmer as your body regains color.", 0)Call SendPlayerData(index)Call SetPlayerClass(Index, 1)Call SetPlayerSTR(Index, R)Call SetPlayerDEF(Index, F)Call SetPlayerSP(Index, A)Call SetPlayerPK(Index, K)Call SetPlayerMAGI(Index, M)Call SendPlayerData(Index)ElseIf GetPlayerclass(Index) = 4 ThenCall SetPlayerSprite(index, T)Call PlayerMsg(index, "You start to feel warmer as your body regains color.", 0)Call SendPlayerData(index)Call SetPlayerClass(Index, 1)Call SetPlayerSTR(Index, J)Call SetPlayerDEF(Index, E)Call SetPlayerPK(Index, K)Call SetPlayerMAGI(Index, M)Call SendPlayerData(Index)ElseCall PlayerMsg(Index, "You were always human.", 0)End IfEnd Sub``` Link to comment Share on other sites More sharing options...
firegold Posted September 5, 2008 Author Share Posted September 5, 2008 thanks im just starting to script and im very disorganized so its not very easy for me yet lol Link to comment Share on other sites More sharing options...
DrNova Posted September 5, 2008 Share Posted September 5, 2008 takes a lil time, but you'll pick it up with ease eventually Link to comment Share on other sites More sharing options...
Zananok Posted September 6, 2008 Share Posted September 6, 2008 @DrNova:> takes a lil time, but you'll pick it up with ease eventuallyAgreedIs it working now?Off-Topic: You are using 2.7 and 'setplayersprite()' worked?@DrNova:> Um, I use set player sprite all the time, it works.> You just have to change maps before you can see it.> That or use somekinda updateplayer data command or something.> > My script warps them as they change sprite(launching their ship to space) so it is perfect for me.> But the command works, just need a map reload to refresh the player data, or a command to do itI just added:```Call setplayersprite(index, 10)```On my 'hotsscript' and it didn't work…Note: Sorry for posting off-topic, just that i really need to know.Questions,From: Zananok Link to comment Share on other sites More sharing options...
lucifer1101 Posted September 6, 2008 Share Posted September 6, 2008 did you try a scripted tile for the sprite change zananok Link to comment Share on other sites More sharing options...
Zananok Posted September 6, 2008 Share Posted September 6, 2008 Well, no, but if it was working, was supposed to work with everything.Thanks anyway, I will try even thou I think it won't work. I will edit my post still today about this if no1 else post feedback.But I still would like to know which version you guys are using that got 'setplayersprite()' working…Thanks,From: Zananok Link to comment Share on other sites More sharing options...
lucifer1101 Posted September 6, 2008 Share Posted September 6, 2008 i just tried it again but when i script it it doesnt work.but theres a way around it.it may not be very good but there is a tile attribute for changing a players sprite and that works totally.so maybe if someone compared the source on those 2 different things we could figure out the problem… Link to comment Share on other sites More sharing options...
Zananok Posted September 6, 2008 Share Posted September 6, 2008 @lucifer1101:> i just tried it again but when i script it it doesnt work.> > but theres a way around it.> it may not be very good but there is a tile attribute for changing a players sprite and that works totally.> so maybe if someone compared the source on those 2 different things we could figure out the problem…That's correct, but that's not what I'm looking for ;)Thanks for the replySo, 'setplayersprite()' isn't working on 2.7, am I correct? (just to check)Questions,From: Zananok Link to comment Share on other sites More sharing options...
lucifer1101 Posted September 6, 2008 Share Posted September 6, 2008 it doesnt work for me! Link to comment Share on other sites More sharing options...
Zananok Posted September 6, 2008 Share Posted September 6, 2008 That's all I needed to know, thanks ;)Thanks,From: Zananok Link to comment Share on other sites More sharing options...
Bobosk Posted September 6, 2008 Share Posted September 6, 2008 SetPlayerSprite does work, I just tested it in an un-edited source…anyways, more debugging..```Sub Werewolf(index)Dim STRDim DEFDim SPDDim CLSSTR=Int(GetPlayerSTR(Index) + 10)DEF=Int(GetPlayerDEF(Index) + 5)SPD=Int(GetPlayerSPEED(Index) + 2)CLS = GetPlayerClass(Index)Select Case CLS Case 1 Call PutVar("Accounts\" & GetPlayerLogin(index) & "\Transform.ini", "OldStat", "Sprite", GetPlayerSprite(Index)) Call PutVar("Accounts\" & GetPlayerLogin(index) & "\Transform.ini", "OldStat", "Strength", GetPlayerSTR(Index)) Call PutVar("Accounts\" & GetPlayerLogin(index) & "\Transform.ini", "OldStat", "Defence", GetPlayerDEF(Index)) Call PutVar("Accounts\" & GetPlayerLogin(index) & "\Transform.ini", "OldStat", "Magic", GetPlayerMAG(Index)) Call PutVar("Accounts\" & GetPlayerLogin(index) & "\Transform.ini", "OldStat", "Speed", GetPlayerSPEED(Index)) Call SetPlayerSprite(index, 129) Call PlayerMsg(index, "You start to feel cold as your flesh disapears.", 0) Call SetPlayerMAGI(Index, 1) Call SetPlayerClass(Index, 3) Call SetPlayerSTR(Index, STR) Call SetPlayerDEF(Index, DEF) Call SetPlayerSPEED(Index, SPD) Call SendPlayerData(Index) Case 3 Call PlayerMsg(Index, "You are already a Werewolf", 0) Case 4 Call PlayerMsg(Index, "You are already a Aqua.", 0) Case Else Call PlayerMsg(Index, "You are not a Shapechanger.", 0)End SelectEnd Sub ``````Sub Human(index)Dim SPRDim STRDim DEFDim MAGDim SPDDim CLSSPR = Int(GetVar("Accounts\" & GetPlayerLogin(index) & "\Transform.ini", "OldStat", "Sprite"))STR = Int(GetVar("Accounts\" & GetPlayerLogin(index) & "\Transform.ini", "OldStat", "Strength"))DEF = Int(GetVar("Accounts\" & GetPlayerLogin(index) & "\Transform.ini", "OldStat", "Defence"))MAG = Int(GetVar("Accounts\" & GetPlayerLogin(index) & "\Transform.ini", "OldStat", "Magic"))SPD = Int(GetVar("Accounts\" & GetPlayerLogin(index) & "\Transform.ini", "OldStat", "Speed"))CLS = GetPlayerClass(Index)Select Case CLS Case 3 Call SetPlayerSprite(index, SPR) Call PlayerMsg(index, "You start to feel warmer as your body regains color.", 0) Call SetPlayerClass(Index, 1) Call SetPlayerSTR(Index, STR) Call SetPlayerDEF(Index, DEF) Call SetPlayerMAGI(Index, MAG) Call SetPlayerSPEED(Index, SPD) Case 4 Call SetPlayerSprite(Index, SPR) Call PlayerMsg(Index, "You start to feel warmer as your body regains color.", 0) Call SetPlayerClass(Index, 1) Call SetPlayerSTR(Index, STR) Call SetPlayerDEF(Index, DEF) Call SetPlayerMAGI(Index, MAG) Call SetPlayerSPEED(Index, SPD) Case Else Call PlayerMsg(Index, "You were always human.", 0)End SelectCall SendPlayerData(Index)End Sub``````Sub Aquas(index)Dim STRDim DEFDim CLSSTR = Int(GetPlayerSTR(Index) + 2)DEF = Int(GetPlayerDEF(Index) + 15)CLS = GetPlayerClass(Index)Select Case CLS Case 1 Call PutVar("Accounts\" & GetPlayerLogin(index) & "\Transform.ini", "OldStat", "Sprite", GetPlayerSprite(Index)) Call PutVar("Accounts\" & GetPlayerLogin(index) & "\Transform.ini", "OldStat", "Strength", GetPlayerSTR(Index)) Call PutVar("Accounts\" & GetPlayerLogin(index) & "\Transform.ini", "OldStat", "Defence", GetPlayerDEF(Index)) Call PutVar("Accounts\" & GetPlayerLogin(index) & "\Transform.ini", "OldStat", "Magic", GetPlayerMAG(Index)) Call PutVar("Accounts\" & GetPlayerLogin(index) & "\Transform.ini", "OldStat", "Speed", GetPlayerSPEED(Index)) Call SetPlayerSprite(index, 129) Call PlayerMsg(index, "You start to feel Dry as you grow fins.", 0) Call SetPlayerMAGI(Index, 1) Call SetPlayerClass(Index, 4) Call SetPlayerSTR(Index, STR) Call SetPlayerDEF(Index, DEF) Call SendPlayerData(Index) Case 3 Call PlayerMsg(Index, "You are already a Werewolf", 0) Case 4 Call PlayerMsg(Index, "You are already a Aqua.", 0) Case Else Call PlayerMsg(Index, "You are not a Shapechanger.", 0)End SelectEnd Sub ``````Case "/man" Call Human(index) Exit Sub``````Case "/wolf" Call Werewolf(index) Exit Sub``````Case "/aquas" Call Aquas(index) Exit Sub```That should work fine.. Link to comment Share on other sites More sharing options...
firegold Posted September 6, 2008 Author Share Posted September 6, 2008 thanks dude this helps a ton Link to comment Share on other sites More sharing options...
lucifer1101 Posted September 7, 2008 Share Posted September 7, 2008 hhhmmmm why does it work for some and not others.it would be very advantagous for me to have that command working.But for now ill have to use the tile attribute…. Link to comment Share on other sites More sharing options...
DrNova Posted September 7, 2008 Share Posted September 7, 2008 Try changing maps after you do whatever script does setplayerspriteWhen I first tested it, I thought it didnt work either, but upon testing further, when you change maps, warp maps, ect, it updates the sprite.It just doesnt do it right away on the same map your in(I think I tested with send data even)Try a map change or warpto command after the script Link to comment Share on other sites More sharing options...
Bobosk Posted September 7, 2008 Share Posted September 7, 2008 It works just fine without changing maps, here, use this to test it..```Sub HotScript(Index, KeyID) Select Case KeyID Case 1 ' Executes when any player presses the PageUp key. If GetPlayerSprite(Index) = 1 Then Call SetPlayerSprite(Index, 2) Else Call SetPlayerSprite(Index, 1) End If Call SendPlayerData(Index)End Select``` Link to comment Share on other sites More sharing options...
Zananok Posted September 7, 2008 Share Posted September 7, 2008 So actually IS working… just that the command forgets to send data... Thanks, this was very helpful (Credits: Bobosk, DrNova and lucifer1101)Sorry for kinda of using this topic for other reasons...Thanks,From: Zananok 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