- Joined
- Jul 9, 2012
- Messages
- 159
Arrays and Unit Groups - SOLVED!
SOLVED!
Hey!
I am trying to make a spell where the caster sends out 30 carrions swarms over 10 seconds. The damage is trigger based, so I had to make a Carrion Swarm unit which moves in a loop.
Everything in the spell works great but the damage - It's supposed to only damage the units 1 time.
This is the loop trigger where the swarm units are dealing damage to the enemy units:
The problem is that the units won't be added to the arrayed unit group and will therefore take damage multiple times.
Thanks!
SOLVED!
Hey!
I am trying to make a spell where the caster sends out 30 carrions swarms over 10 seconds. The damage is trigger based, so I had to make a Carrion Swarm unit which moves in a loop.
Everything in the spell works great but the damage - It's supposed to only damage the units 1 time.
This is the loop trigger where the swarm units are dealing damage to the enemy units:
-
Unit Group - Pick every unit in (Units within 125.00 of PoDUnitMovePoint[PoDIndex] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of PoDCaster)) Equal to True))) and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Picked unit) is in PoDUG[PoDIndex]) Not equal to True
-
Then - Actions
- Unit Group - Add (Picked unit) to PoDUG[PoDIndex]
- Game - Display to (All players) the text: (String((Number of units in PoDUG[PoDIndex])))
- Unit - Cause PoDCaster to damage (Picked unit), dealing PoDReal damage of attack type Spells and damage type Normal
- Floating Text - Create floating text that reads (String((Integer(PoDReal)))) above (Picked unit) with Z offset 100.00, using font size 8.00, color (100.00%, 25.00%, 25.00%), and 0.00% transparency
- Set TempFloatingText = (Last created floating text)
- Trigger - Run General Floating Text <gen> (checking conditions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
The problem is that the units won't be added to the arrayed unit group and will therefore take damage multiple times.
Thanks!
Last edited: