hi,
I have this trigger that is part of an ability that is supposed to send random units in the unit group to random places on the map. it works, but it's not working multiple times like it's supposed to, only once. I can't figure out why.
I'm talking about the loop starting - "for each integer A from 1 to TempInteger."
I have this trigger that is part of an ability that is supposed to send random units in the unit group to random places on the map. it works, but it's not working multiple times like it's supposed to, only once. I can't figure out why.
I'm talking about the loop starting - "for each integer A from 1 to TempInteger."
-
bon voyage option 2 Copy
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Bon Voyage
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Level of Bon Voyage for (Triggering unit)) Equal to 1
-
Then - Actions
- Set TempInteger = 3
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Level of Bon Voyage for (Triggering unit)) Equal to 2
-
Then - Actions
- Set TempInteger = 6
-
Else - Actions
- Set TempInteger = 10
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Set TempPoint1 = (Position of (Triggering unit))
- Set Temp_Group = (Units within 600.00 of TempPoint1 matching (((Matching unit) is A structure) Equal to False))
- Game - Display to (All players) for 10.00 seconds the text: (number of units in group: + (String((Number of units in Temp_Group))))
-
For each (Integer A) from 1 to TempInteger, do (Actions)
-
Loop - Actions
- Game - Display to (All players) for 10.00 seconds the text: loop run
- Set TempUnit = (Random unit from Temp_Group)
- Set Temp_Point2 = (Position of TempUnit)
- Special Effect - Create a special effect at Temp_Point2 using Abilities\Spells\Demon\DarkPortal\DarkPortalTarget.mdl
- Special Effect - Destroy (Last created special effect)
- Set TempPoint = (Random point in (Playable map area))
-
For each (Integer A) from 1 to 10, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Terrain pathing at TempPoint of type Walkability is off) Equal to True
-
Then - Actions
- Custom script: call RemoveLocation (udg_TempPoint)
- Set TempPoint = (Random point in (Playable map area))
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Game - Display to (All players) for 10.00 seconds the text: mid loop
- Unit - Move TempUnit instantly to TempPoint
- Special Effect - Create a special effect attached to the overhead of TempUnit using Abilities\Spells\Demon\DarkPortal\DarkPortalTarget.mdl
- Special Effect - Destroy (Last created special effect)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Terrain pathing at TempPoint of type Walkability is off) Equal to True
- (TempUnit is A flying unit) Equal to False
-
Then - Actions
- Unit - Explode TempUnit
- Else - Actions
-
If - Conditions
- Unit Group - Remove TempUnit from Temp_Group
- Custom script: call RemoveLocation (udg_TempPoint)
- Custom script: call RemoveLocation (udg_Temp_Point2)
- Game - Display to (All players) for 10.00 seconds the text: loop end
-
Loop - Actions
- Custom script: call RemoveLocation (udg_TempPoint1)
- Custom script: call DestroyGroup(udg_Temp_Group)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events