Zech
Member
I'm trying to make a second wait animation state. As you can see, after it plays the first wait animation (which only lasts 1 second), it plays the second one. For some reason when I move while the second state is active, it doesn't change to walking/running. However, it does change when I jump or when I fall off an edge.
State LUA Script:
--he "dies" after being afk for too long
--creates the slots for the laying animation and the laying sprites
freeslot (
"S_PLAY_LAYING", "SPR2_LAYI"
)
states[S_PLAY_LAYING] = {
sprite = SPR_PLAY,
frame = SPR2_LAYI,
--loops forever
tics = -1,
--since it loops forever it doesn't need a next state (this line might be removable idk)
nextstate = S_NULL
}
--modified wait animation
states[S_PLAY_WAIT] = {
sprite = SPR_PLAY,
--FF_ANIMATE simply means it animates
frame = SPR2_WAIT|FF_ANIMATE,
--30 seconds
tics = 15,
var1 = 0,
--tics between frames
var2 = 16,
--switches to the laying state after 30 seconds (1050 tics)
nextstate = S_PLAY_LAYING
}