I want to pick every unt in a group matching some conitions and then deal damage to them. This works fine as long as I don't kill any unit. If I do, then the UnitGroup loop still cycles through all units inside the UnitGroup, but:
1. every other unit after the dead one, doesn't recieve damage any more,
2. the UnitGroup is empty without killing/removing any unit (see log "Unit dies"),
3. functions after that loop aren't executed. (there is other stuff that shoud happen)
What is happening?
/edit1:
/edit2:
1. every other unit after the dead one, doesn't recieve damage any more,
2. the UnitGroup is empty without killing/removing any unit (see log "Unit dies"),
3. functions after that loop aren't executed. (there is other stuff that shoud happen)
What is happening?
- Set a_HA01_TargetGroup[loop_HumanPlayerA] = (Units within 250.00 of (Position of player_HERO[loop_HumanPlayerA]) matching ((((Matching unit) is A ground unit) Equal to True) and ((((Owner of (Matching unit)) is an enemy of (Owner of player_HERO[loop_HumanPlayerA])) Equal to True) or ((Owner of (Matchin
- Set a_HA01_Data_InitalDamage = (((Real((Strength of player_HERO[loop_HumanPlayerA] (Include bonuses)))) + (Real((Intelligence of player_HERO[loop_HumanPlayerA] (Include bonuses))))) x a_HA01_Data_DamageFactor[(Level of HA01_Burning Cross for player_HERO[loop_HumanPlayerA])])
- Set temp_Int = 1
- Game - Display to (All players) the text: (Unit count before damage = + (String((Number of units in a_HA01_TargetGroup[loop_HumanPlayerA]))))
-
Unit Group - Pick every unit in a_HA01_TargetGroup[loop_HumanPlayerA] and do (Actions)
-
Loop - Actions
- Set temp_Real = (Life of (Picked unit))
- Unit - Cause player_HERO[loop_HumanPlayerA] to damage (Picked unit), dealing a_HA01_Data_InitalDamage damage of attack type Spells and damage type Normal
- Game - Display to (All players) the text: ((String(temp_Int)) + ( damaged: From + (((String(temp_Real)) + HP to ) + ((String((Life of (Picked unit)))) + HP.))))
- Set temp_Int = (temp_Int + 1)
-
Loop - Actions
- Game - Display to (All players) the text: (Unit count after damage = + (String((Number of units in a_HA01_TargetGroup[loop_HumanPlayerA]))))
- Unit Group - Remove all units from a_HA01_TargetGroup[loop_HumanPlayerA]
Unit dies:
Unit survives:
Unit survives:
/edit1:
- Unit Group - Remove all units from a_HA01_TargetGroup[loop_HumanPlayerA]
/edit2:
- Set a_HA01_TargetGroup[loop_HumanPlayerA] = (Units within 250.00 of (Position of player_HERO[loop_HumanPlayerA]) matching ((((Matching unit) is A ground unit) Equal to True) and ((((Owner of (Matching unit)) is an enemy of (Owner of player_HERO[loop_HumanPlayerA])) Equal to True) or ((Owner of (Matchin...
Last edited: