Advertisement
kingtobbe

Untitled

May 11th, 2018
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. Scriptname MAX_MinigameMoverScript extends ObjectReference
  2.  
  3. Keyword Property DN045_ButtonA auto
  4. Keyword Property DN045_ButtonB auto
  5. Keyword Property DN045_ButtonC auto
  6. Keyword Property DN045_ButtonX auto
  7. Keyword Property DN045_ButtonY auto
  8. Keyword Property DN045_ButtonZ auto
  9.  
  10. Keyword Property DN045_SoundMarkerA auto
  11. Keyword Property DN045_SoundMarkerB auto
  12. Keyword Property DN045_SoundMarkerC auto
  13. ObjectReference Property soundMarker auto
  14.  
  15. Float Property Speed = 5.0 auto
  16. Float Property StartPosition = 0.0 auto
  17. {Please enter 0, 0.5, or 1}
  18.  
  19. ObjectReference CallButtonA
  20. ObjectReference CallButtonB
  21. ObjectReference CallButtonC
  22. ObjectReference CallButtonX
  23. ObjectReference CallButtonY
  24. ObjectReference CallButtonZ
  25.  
  26. int PositionA
  27. int PositionB
  28. int PositionC
  29.  
  30. int instanceID
  31.  
  32. Sound Property OBJTrainMoveLPM Auto const
  33. bool direction = false
  34. GlobalVariable Property pointsStatus auto
  35.  
  36. Event OnCellAttach()
  37.  
  38. RegisterforAnimationEvent(Self, "done")
  39.  
  40. StartTrain(StartPosition)
  41.  
  42. if (StartPosition == 0.0)
  43. PositionA = 1
  44. PositionB = 0
  45. PositionC = 0
  46. elseif (StartPosition == 0.5)
  47. PositionA = 0
  48. PositionB = 1
  49. PositionC = 0
  50. elseif (StartPosition == 1.0)
  51. PositionA = 0
  52. PositionB = 0
  53. PositionC = 1
  54. endif
  55. EndEvent
  56.  
  57. Event OnActivate(ObjectReference akSender)
  58. debug.Trace("Activated by " + AkSender)
  59. if(pointsStatus.GetValue() > 0)
  60. if (!direction)
  61. Self.SetAnimationVariableFloat("fvalue", 0)
  62. if (PositionA == 0)
  63. instanceID = OBJTrainMoveLPM.play(soundMarker) ; play myLoopingSFX sound from my self
  64. PositionA = 1
  65. PositionB = 0
  66. PositionC = 0
  67. endif
  68. if (self.playanimationandwait("Play01", "done") == TRUE)
  69. direction = true
  70. Activate(self)
  71. Sound.StopInstance(instanceID)
  72. endif
  73. elseif (direction)
  74. Self.SetAnimationVariableFloat("fvalue", 1)
  75. if (PositionC == 0)
  76. instanceID = OBJTrainMoveLPM.play(soundMarker) ; play myLoopingSFX sound from my self
  77. PositionA = 0
  78. PositionB = 0
  79. PositionC = 1
  80. endif
  81. if (self.playanimationandwait("Play01", "done") == TRUE)
  82. direction = false
  83. Activate(self)
  84. Sound.StopInstance(instanceID)
  85. endif
  86. endif
  87. endif
  88. EndEvent
  89.  
  90. Event OnAnimationEvent(ObjectReference akSource, string asEventName)
  91. if (akSource == self) && (asEventName == "done")
  92. debug.Trace(aksource + " is " + asEventName)
  93. endif
  94. EndEvent
  95.  
  96.  
  97.  
  98. Function StartTrain(float akValue)
  99. self.SetAnimationVariableFloat("fvalue", akValue)
  100. self.playanimationandwait("Play01", "done")
  101. EndFunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement