• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Detect Unit Acquisition?

Status
Not open for further replies.
Level 30
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.

  • Events
    • Unit - No unit Acquires a target
Unit - Specific Unit Event

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).
  • Trigger - Add to Acquire Target <gen> the event (Unit - Unit Acquires a target)
At the event (different trigger);
  • Acquire Target
  • Events
  • Conditions
  • Actions
  • -------- ACTIONS HERE --------
 
Level 30
Joined
Jul 23, 2009
Messages
1,033
Download example below

This was very helpful, thanks man! Though I wonder one thing.

If I want the actions to trigger only if the chasing unit is neutral hostile, how do I do? I tried adding

  • (Owner of (Triggering unit)) Equal to (==) Neutral Hostile
To the

  • Track Acquisition
    • Events
    • Conditions
    • Actions
      • -------- ACTIONS HERE --------
      • Game - Display to (All players) the text: ((Name of (Triggering unit)) + ( is chasing + (Name of (Targeted unit))))
But this only resulted in the trigger not working and I really don't understand why :eekani:
 
  • Like
Reactions: ILH
Status
Not open for further replies.
Top