Zealot
Member
- Reaction score
- 11
I made a trigger so that when the unit is attacked it moves in the opposite direction of the attacker a certain range.
Unit has no ability (not even Wander) and yet it returns to it's original spawning point even though I have no trigger that would cause this. The unit is Neutral Passive (could this be the cause?)
This is the trigger:
Also I know it leaks but I'm not fixing it until I find out the answer to this conundrum.[/wc3]
Unit has no ability (not even Wander) and yet it returns to it's original spawning point even though I have no trigger that would cause this. The unit is Neutral Passive (could this be the cause?)
This is the trigger:
Trigger:
- Herbivore AI
- Events
- Unit - A unit Is attacked
- Conditions
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of (Attacked unit)) Equal to Goat
- Then - Actions
- For each (Integer A) from 1 to 5, do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Attacked unit) is in Creature_Group_Goat[(Integer A)]) Equal to True
- Then - Actions
- Unit Group - Pick every unit in Creature_Group_Goat[(Integer A)] and do (Actions)
- Loop - Actions
- Set Creature_Move_Point = ((Position of (Attacking unit)) offset by (Random real number between 1500.00 and 5000.00) towards (Facing of (Attacking unit)) degrees)
- Unit - Order (Picked unit) to Move To Creature_Move_Point
- Loop - Actions
- Unit Group - Pick every unit in Creature_Group_Goat[(Integer A)] and do (Actions)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- For each (Integer A) from 1 to 5, do (Actions)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Events
Also I know it leaks but I'm not fixing it until I find out the answer to this conundrum.[/wc3]