4
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

51 lines
1.1 KiB

scriptName NorLever01SCRIPT extends ObjectReference Conditional
import debug
import utility
bool property isInPullPosition = True Auto
EVENT OnLoad()
SetDefaultState()
endEVENT
Event OnReset()
SetDefaultState()
EndEvent
;This has to be handled as a function, since OnLoad and OnReset can fire in either order, and we can't handle competing animation calls.
Function SetDefaultState()
if (isInPullPosition)
playAnimation("FullPull")
gotoState("pulledPosition")
Else
playAnimation("FullPush")
gotoState("pushedPosition")
EndIf
EndFunction
Auto STATE pulledPosition
EVENT onActivate (objectReference triggerRef)
gotoState ("busy")
isInPullPosition = False
playAnimationandWait("FullPush","FullPushedUp")
gotoState("pushedPosition")
endEVENT
endState
STATE pushedPosition
EVENT onActivate (objectReference triggerRef)
gotoState ("busy")
isInPullPosition = True
playAnimationandWait("FullPull","FullPulledDown")
gotoState("pulledPosition")
endEVENT
endState
STATE busy
; This is the state when I'm busy animating
EVENT onActivate (objectReference triggerRef)
;do nothing
endEVENT
endSTATE