Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Need help with someone to tell me what i messed up on in this script


firegold
 Share

Recommended Posts

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 text

i give credit to Cruzn for making alot of this script

by the way i am using EE 2.7

Sub Werewolf(index)
Dim S
Dim D
Dim E
Dim P
Dim G
S=Int(GetPlayerSTR(Index) + 10)
D=Int(GetPlayerDEF(Index) + 5)
E=Int(GetPlayerSP(Index) + 2)
P=Int(GetPlayerPK(Index) + 300)
G=1
If GetPlayerClass(Index) = 1 Then
Call 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)
Else
Call PlayerMsg(Index, "You are not a Shapechanger.", 0)
End If
End Sub

Sub Human(index)
Dim R
Dim F
Dim A
Dim K
Dim M
Dim T
Dim E
R=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 Then
Call 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)
Else
If GetPlayerclass(Index) = 4 Then
Call 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)
Else
Call PlayerMsg(Index, "You were always human.", 0)
End If
End Sub

Sub Aquas(index)
Dim S
Dim D
Dim E
Dim P
Dim G
S=Int(GetPlayerSTR(Index) + 2)
D=Int(GetPlayerDEF(Index) + 15)
P=Int(GetPlayerPK(Index) + 300)
G=1
If GetPlayerClass(Index) = 1 Then
Call 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)
Else
Call PlayerMsg(Index, "You are not a Shapechanger.", 0)
End If
End Sub

Case "/man"
Call Human(index)
Exit Sub

Case "/wolf"
Call Werewolf(index)
Exit Sub

Case "/aquas"
Call Aquas(index)
Exit Sub
Link to comment
Share on other sites

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... :S

Hope this helps, Report,
From: Zananok
Link to comment
Share on other sites

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

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 A
Dim D
Dim E
Dim F
Dim G
Dim J
Dim K
Dim M
Dim R
Dim T
A=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 Then
Call 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)
Else
If GetPlayerclass(Index) = 4 Then
Call 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)
Else
Call PlayerMsg(Index, "You were always human.", 0)
End If
End Sub
```
Link to comment
Share on other sites

@DrNova:

> takes a lil time, but you'll pick it up with ease eventually

Agreed
Is 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 it

I 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

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

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

@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 reply
So, 'setplayersprite()' isn't working on 2.7, am I correct? (just to check)

Questions,
From: Zananok
Link to comment
Share on other sites

SetPlayerSprite does work, I just tested it in an un-edited source…
anyways, more debugging..
```
Sub Werewolf(index)
Dim STR
Dim DEF
Dim SPD
Dim CLS

STR=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 Select
End Sub

``````
Sub Human(index)
Dim SPR
Dim STR
Dim DEF
Dim MAG
Dim SPD
Dim CLS

SPR = 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 Select
Call SendPlayerData(Index)
End Sub

``````
Sub Aquas(index)
Dim STR
Dim DEF
Dim CLS

STR = 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 Select
End 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

Try changing maps after you do whatever script does setplayersprite
When 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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...