Hi again:
Here's what I'm trying to do:
When ego walks into the street, I want the program to take control and walk him to a specific x,y. Then I want to hide ego and show an animation in his place, in which he is shown getting run over. Then I want to run the death script.
Here's the relevant code I have so far:
(if(== oops 0)
(if(send gEgo:inRect(0 177 319 189))
= oops 1
Print("You wander aimlessly into the street.")
ProgramControl()
(send gEgo:setCycle(Walk)
setMotion(MoveTo 160 179 RoomScript())
)
)
)
)
(method (changeState newState)
(var dyingScript)
= newState 0
= state newState
(switch(state)
(case 0
(send gEgo:hide())
)
(case 1
(runOver:show()setCycle(End))
= dyingScript ScriptID(DYING_SCRIPT)
(send dyingScript:
caller(5)
register("You're dead!")
)
(send gGame:setScript(dyingScript)
)
)
)
)
Now, when I don't have case 1 in there, he walks to the specified location and disappears, like he's supposed to. But when I add in case 1 to run the animation, he walks to the location but doesn't disappear. The animation plays over him.
Any ideas as to how I could do this better? Thanks!