- Joined
- Oct 20, 2010
- Messages
- 236
I have a trigger that is pretty old, from when I was working on a map from over a year ago. I'm unsure how I cobbled this code together (probably by using another persons work as reference) and now, abruptly, it no longer works. I recall it working before, so I suppose I must've messed something up. The issue I am facing is when running this multiple times, it ends up just breaking.
-
Timed Run
-

Events
-

Conditions
-

Actions
-


Set VariableSet Timed_MaxIndex = (Timed_MaxIndex + 1)
-


Set VariableSet Timed_S_UnitSource[Timed_MaxIndex] = Timed_UnitSource
-


Set VariableSet Timed_S_UnitTarget[Timed_MaxIndex] = Timed_UnitTarget
-


Set VariableSet Timed_S_Duration[Timed_MaxIndex] = Timed_Duration
-


Set VariableSet Timed_S_RunTrigger_END[Timed_MaxIndex] = Timed_RunTrigger
-


Set VariableSet Timed_S_SavedReal[Timed_MaxIndex] = Timed_SavedReal
-


Set VariableSet Timed_Counter[Timed_MaxIndex] = 0
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




Timed_MaxIndex Equal to 1
-
-



Then - Actions
-




Trigger - Turn on Timed Loop <gen>
-
-



Else - Actions
-
-
-
-
Timed Loop
-

Events
-


Time - Every 0.03 seconds of game time
-
-

Conditions
-

Actions
-


For each (Integer Timed_CurrentIndex) from 1 to Timed_MaxIndex, do (Actions)
-



Loop - Actions
-




-------- Adds 1 to counter of (loop current index) --------
-




Set VariableSet Timed_Counter[Timed_CurrentIndex] = (Timed_Counter[Timed_CurrentIndex] + 1)
-




-------- Next, if the counter is equal to the maximum duration then it executes the code for the end of the counter. --------
-




Set VariableSet Timed_S_Onesecond[Timed_CurrentIndex] = (Timed_S_Onesecond[Timed_CurrentIndex] + 1)
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






Timed_S_Onesecond[Timed_CurrentIndex] Equal to 33
-
-





Then - Actions
-






Set VariableSet Timed_UnitSource = Timed_S_UnitSource[Timed_CurrentIndex]
-






Set VariableSet Timed_UnitTarget = Timed_S_UnitTarget[Timed_CurrentIndex]
-






Set VariableSet Timed_SavedReal = Timed_S_SavedReal[Timed_CurrentIndex]
-






Trigger - Run Timed_S_RunTrigger_1Second[Timed_CurrentIndex] (checking conditions)
-






-------- - --------
-






Set VariableSet Timed_S_Onesecond[Timed_CurrentIndex] = 0
-
-





Else - Actions
-
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






Timed_Counter[Timed_CurrentIndex] Equal to (Integer((Timed_S_Duration[Timed_CurrentIndex] x 33.33)))
-
-





Then - Actions
-






Set VariableSet Timed_UnitSource = Timed_S_UnitSource[Timed_CurrentIndex]
-






Set VariableSet Timed_UnitTarget = Timed_S_UnitTarget[Timed_CurrentIndex]
-






Set VariableSet Timed_SavedReal = Timed_S_SavedReal[Timed_CurrentIndex]
-






Trigger - Run Timed_S_RunTrigger_END[Timed_CurrentIndex] (checking conditions)
-






-------- - --------
-






-------- - --------
-






-------- - --------
-






-------- - --------
-






Set VariableSet Timed_S_RunTrigger_1Second[Timed_CurrentIndex] = Blank Trigger <gen>
-






Set VariableSet Timed_S_RunTrigger_END[Timed_CurrentIndex] = Blank Trigger <gen>
-






Set VariableSet Timed_S_Onesecond[Timed_CurrentIndex] = 0
-






Set VariableSet Timed_S_UnitSource[Timed_CurrentIndex] = Timed_S_UnitSource[Timed_MaxIndex]
-






Set VariableSet Timed_S_UnitTarget[Timed_CurrentIndex] = Timed_S_UnitTarget[Timed_MaxIndex]
-






Set VariableSet Timed_Counter[Timed_CurrentIndex] = Timed_Counter[Timed_MaxIndex]
-






Set VariableSet Timed_S_Duration[Timed_CurrentIndex] = Timed_S_Duration[Timed_MaxIndex]
-






Set VariableSet Timed_S_SavedReal[Timed_CurrentIndex] = Timed_S_SavedReal[Timed_MaxIndex]
-






Set VariableSet Timed_MaxIndex = (Timed_MaxIndex - 1)
-






Set VariableSet Timed_CurrentIndex = (Timed_CurrentIndex - 1)
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








Timed_MaxIndex Equal to 0
-
-







Then - Actions
-








Trigger - Turn off (This trigger)
-
-







Else - Actions
-
-
-





Else - Actions
-
-
-
-
-





