Doan, I didn't use setScript at init, but instead set it when the user clicks on the soda machine. At which time it does state 0 and state 1, just it stops there with cycles or seconds set.
(case 995 (send pEvent:type(evMOUSEBUTTON) claimed(TRUE))// get
//(if(... close enough
(if(not(puSoda))
(sodaMachine:setScript(fillingCup))
)
(else
Print(25 6)
)
//)
//(else
// Print("You are not close enough to operate the machine")
//)
)
Gumby, I do have the ProgramControl and PlayerControl modified, and it has been in the pnc template for a while now.
(procedure public (ProgramControl)
(User:canControl(FALSE)canInput(FALSE))
(send gEgo:setMotion(NULL))
= gProgramControl TRUE
= canTab FALSE
)
(procedure public (PlayerControl)
(User:canControl(TRUE)canInput(FALSE))
(send gEgo:setMotion(NULL))
= gProgramControl FALSE
= canTab TRUE
)
I guess, what really bugs me about this is that, using an actors moveto to trigger the next step works. Why is it that it can find case 2 and beyond that way but not with the seconds or cycles. Even worse, this problem seems to be specific to this room. In another room, I've got a changestate set up using seconds that works just fine.
(instance passerBy of Act(properties x -10 y 133 view 504 loop 0))
(instance passingBy of Script
(properties)
(method (changeState newState)
= state newState
(switch (state)
(case 0 = whichWalker Random(504 505)
(passerBy:view(whichWalker))
= seconds Random(4 12)
)
(case 1 (passerBy:setCycle(Walk) setMotion(MoveTo 330 133 passingBy)))
(case 2 = whichWalker Random(504 505)
(passerBy:view(whichWalker))
= seconds Random(8 16)
)
(case 3 (passerBy:setCycle(Walk) setMotion(MoveTo -10 133 passingBy)))
(case 4 (self:changeState(0)))
) // switch end
) // method end
) // instance end