Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scriptname MAX_MinigameMoverScript extends ObjectReference
- Keyword Property DN045_ButtonA auto
- Keyword Property DN045_ButtonB auto
- Keyword Property DN045_ButtonC auto
- Keyword Property DN045_ButtonX auto
- Keyword Property DN045_ButtonY auto
- Keyword Property DN045_ButtonZ auto
- Keyword Property DN045_SoundMarkerA auto
- Keyword Property DN045_SoundMarkerB auto
- Keyword Property DN045_SoundMarkerC auto
- ObjectReference Property soundMarker auto
- Float Property Speed = 5.0 auto
- Float Property StartPosition = 0.0 auto
- {Please enter 0, 0.5, or 1}
- ObjectReference CallButtonA
- ObjectReference CallButtonB
- ObjectReference CallButtonC
- ObjectReference CallButtonX
- ObjectReference CallButtonY
- ObjectReference CallButtonZ
- int PositionA
- int PositionB
- int PositionC
- int instanceID
- Sound Property OBJTrainMoveLPM Auto const
- bool direction = false
- GlobalVariable Property pointsStatus auto
- Event OnCellAttach()
- RegisterforAnimationEvent(Self, "done")
- StartTrain(StartPosition)
- if (StartPosition == 0.0)
- PositionA = 1
- PositionB = 0
- PositionC = 0
- elseif (StartPosition == 0.5)
- PositionA = 0
- PositionB = 1
- PositionC = 0
- elseif (StartPosition == 1.0)
- PositionA = 0
- PositionB = 0
- PositionC = 1
- endif
- EndEvent
- Event OnActivate(ObjectReference akSender)
- debug.Trace("Activated by " + AkSender)
- if(pointsStatus.GetValue() > 0)
- if (!direction)
- Self.SetAnimationVariableFloat("fvalue", 0)
- if (PositionA == 0)
- instanceID = OBJTrainMoveLPM.play(soundMarker) ; play myLoopingSFX sound from my self
- PositionA = 1
- PositionB = 0
- PositionC = 0
- endif
- if (self.playanimationandwait("Play01", "done") == TRUE)
- direction = true
- Activate(self)
- Sound.StopInstance(instanceID)
- endif
- elseif (direction)
- Self.SetAnimationVariableFloat("fvalue", 1)
- if (PositionC == 0)
- instanceID = OBJTrainMoveLPM.play(soundMarker) ; play myLoopingSFX sound from my self
- PositionA = 0
- PositionB = 0
- PositionC = 1
- endif
- if (self.playanimationandwait("Play01", "done") == TRUE)
- direction = false
- Activate(self)
- Sound.StopInstance(instanceID)
- endif
- endif
- endif
- EndEvent
- Event OnAnimationEvent(ObjectReference akSource, string asEventName)
- if (akSource == self) && (asEventName == "done")
- debug.Trace(aksource + " is " + asEventName)
- endif
- EndEvent
- Function StartTrain(float akValue)
- self.SetAnimationVariableFloat("fvalue", akValue)
- self.playanimationandwait("Play01", "done")
- EndFunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement