- Joined
- Oct 5, 2012
- Messages
- 67
I need to write a trigger for a ability that ensnares every unit that enters an area ( it shouldn't stun one unit twice though). To achieve this I created 2 groups, one with all units that just entered (and haven't been ensnared yet) and one with all units that allready have been ensnared.
I didn't manage to find a trigger that picks every unit in a group that aren't in another group.
Here is the trigger:
I didn't manage to find a trigger that picks every unit in a group that aren't in another group.
Here is the trigger:
-
Trigger Copy
-
Events
- Time - Every 0.20 seconds of game time
- Conditions
-
Actions
- Unit - Create 1 DummyUnit for (Owner of Owner) at (Position of Owner) facing Default building facing degrees
- Set Ownerdummy = (Last created unit)
- Set Ownerlevel = (Level of Flame Strike for Owner)
- Unit - Set level of Ensnare for Ownerdummy to Ownerlevel
- Unit Group - Add all units of (Units within 300.00 of Ownertarget matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is An Ancient) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Owner of (Matching unit)) is an enemy of (Owner of Ku to group1
-
Unit Group - Pick every unit in group1 and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Picked unit) is in group2) Equal to False
-
Then - Actions
- Set enemytarget = (Picked unit)
- Unit - Order Ownerdummy to Orc Raider - Ensnare enemytarget
- Unit Group - Add enemytarget to group2
- Set enemytarget = No unit
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Unit - Kill dummy
-
Events