XPXirethard01TrapButton01SCRIPT
Editor ID:XPXirethard01TrapButton01SCRIPT
Form ID:000819AA
Type:Object
Script:scn XPXirethard01TrapButton01SCRIPT
; activates parent and resets to starting position
short busy
short stage
float timer
ref mySelf
ref myParent
begin onActivate
set mySelf to getSelf
set myParent to getParentRef
if busy == 0 && stage == 0
set stage to 1
set busy to 1
playgroup forward 1
set timer to 4
endif
end
begin gameMode
if stage == 1 && timer <= 3
set mySelf to getSelf
set myParent to getParentRef
myParent.activate mySelf 1
; Now activate each trig, making them turn off or turn on
XirethardTrigZone01REF.activate mySelf 1
XirethardTrigZone02REF.activate mySelf 1
XirethardTrigZone03REF.activate mySelf 1
XirethardTrigZone04REF.activate mySelf 1
XirethardTrigZone05REF.activate mySelf 1
XirethardTrigZone06REF.activate mySelf 1
XirethardTrigZone07REF.activate mySelf 1
set stage to 2
endif
if (isAnimPlaying == 0) && stage == 2 && timer <= 2
playgroup backward 0
set stage to 3
endif
if (isAnimPlaying == 0) && stage == 3 && timer <= 0
set busy to 0
set stage to 0
endif
if timer > 0
set timer to timer - getSecondsPassed
endif
end
begin onReset
reset3DState
set stage to 0
set busy to 0
end