- Joined
- Jul 23, 2009
- Messages
- 1,033
I need to detect when a unit is starting to chase a unit (via acquisition range), in order to add the chasing unit to a unit group so that I can track it as a unit "in combat". I tried to look it up and I think I got close here but the triggers were not thoroughly enough explained for me to comprehend. Could someone explain it a bit more to me? I would be very grateful.
Unit - Specific Unit Event
- Events
- Unit - No unit Acquires a target
If the unit is a variable, you can use this to register the unit to that event (since that event does not accept variable-type unit).
NOTE: ONLY REGISTER THE UNIT ONCE TO THE EVENT. Registering a unit multiple times to a single event cause instance bugs. How to do this ? Simple. When you want to register, do an IF/THEN/ELSE check, if the unit is not in a Unit Group (variable), add it and register it, if it already enters the unit group, do nothing (literally - leave it blank).
At the event (different trigger);
- Trigger - Add to Acquire Target <gen> the event (Unit - Unit Acquires a target)
- Acquire Target
- Events
- Conditions
- Actions
- -------- ACTIONS HERE --------