- Joined
- Dec 9, 2014
- Messages
- 92
Hi,
I want the computer player to cast an ability when a unit type with that ability enters the range of any unit.
I encountered the problem that you can't check for unit type, so I tried this workaround method of adding an event through a trigger:
How do I get this working and is there another way? I thought about using periodical check, but too many periodical checks causes lag right?
I was also wondering if using unit group - pick every unit through an event add will leak once or every time the second trigger fires, and how to clean that up: if I use
I want the computer player to cast an ability when a unit type with that ability enters the range of any unit.
I encountered the problem that you can't check for unit type, so I tried this workaround method of adding an event through a trigger:
-
trigger events
-
Events
-
Time - Elapsed game time is 0.00 seconds
-
-
Conditions
-
Actions
-
Unit Group - Pick every unit in (Units of type Troll Trapper) and do (Actions)
-
Loop - Actions
-
Trigger - Add to trap <gen> the event (Unit - A unit comes within 400.00 of (Picked unit))
-
-
-
-
-
trap
-
Events
-
Conditions
-
Actions
-
Unit - Order (Picked unit) to Orc Raider - Ensnare (Triggering unit)
-
-
How do I get this working and is there another way? I thought about using periodical check, but too many periodical checks causes lag right?
I was also wondering if using unit group - pick every unit through an event add will leak once or every time the second trigger fires, and how to clean that up: if I use
-
Custom script: set bj_wantDestroyGroup = true