- Joined
- Jul 21, 2015
- Messages
- 278
Hi everyone,
I need help with conceputalizing how this trigger should work. It involves Arrays because that is how I learned from a previous trigger I asked about, First Time Asking About Arrays. Last time Duckfarter was able to help me out. I'm hoping to summon him again haha.
Anyways what I want this trigger to do is,
*if any neutral passive unit is attacked of the type Eagle (wow), then they are turned into a Neutral Hostile
*After that, the second trigger should check for whether the attacked unit is nearby the attacking unit. (I know the main issue with my posted triggers is that I am not storing them correctly. And also am open to complete redesign of the triggers I have thus far)
*if second trigger condition is met, then the attacked unit becomes neutral passive again and goes back to its original location
*I am completely unsure of how to remove the stored unit from the array
*I also am unsure of what to have the Loop C be in regards to the "For each (Integer LoopC) from 1 to 10, do (Actions)", I just chose 1 to 10 because shrug
Thank you!
Also if this is too vague I can add more information. Also here is a picture of my eagle friends
I need help with conceputalizing how this trigger should work. It involves Arrays because that is how I learned from a previous trigger I asked about, First Time Asking About Arrays. Last time Duckfarter was able to help me out. I'm hoping to summon him again haha.
Anyways what I want this trigger to do is,
*if any neutral passive unit is attacked of the type Eagle (wow), then they are turned into a Neutral Hostile
*After that, the second trigger should check for whether the attacked unit is nearby the attacking unit. (I know the main issue with my posted triggers is that I am not storing them correctly. And also am open to complete redesign of the triggers I have thus far)
*if second trigger condition is met, then the attacked unit becomes neutral passive again and goes back to its original location
*I am completely unsure of how to remove the stored unit from the array
*I also am unsure of what to have the Loop C be in regards to the "For each (Integer LoopC) from 1 to 10, do (Actions)", I just chose 1 to 10 because shrug
Thank you!
Also if this is too vague I can add more information. Also here is a picture of my eagle friends
-
GlobalNeutralPassive
-

Events
-


Unit - A unit Is attacked
-
-

Conditions
-


(Owner of (Attacked unit)) Equal to Neutral Passive
-


(Unit-type of (Attacked unit)) Equal to Eagle (wow)
-
-

Actions
-


Unit - Change ownership of (Attacked unit) to Neutral Hostile and Change color
-


Set VariableSet PointEagle2[1] = (Position of (Attacked unit))
-


Set VariableSet UnitAttacked[1] = (Attacked unit)
-


Set VariableSet UnitAttacking[1] = (Attacking unit)
-


Unit - Remove Sleep Always from (Attacked unit)
-
-
-
SleepingEagles
-

Events
-


Time - Every 20.00 seconds of game time
-
-

Conditions
-

Actions
-


For each (Integer LoopC) from 1 to 10, do (Actions)
-



Loop - Actions
-




Set VariableSet RegionEagle = (Region centered at (Position of UnitAttacking[LoopC]) with size (400.00, 400.00))
-




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





If - Conditions
-






(RegionEagle contains UnitAttacking[LoopC]) Equal to False
-
-





Then - Actions
-






Custom script: call RemoveRect(udg_RegionEagle)
-






Unit - Change ownership of UnitAttacking[LoopC] to Neutral Passive and Retain color
-






Unit - Order UnitAttacking[LoopC] to Move To PointEagle2[LoopC]
-






Wait 5.00 seconds
-






Unit - Add Sleep Always to UnitAttacking[LoopC]
-






Custom script: call RemoveLocation(udg_PointEagle2)
-
-





Else - Actions
-






Custom script: call RemoveRect(udg_RegionEagle)
-
-
-
-
-
-
Last edited:




