• 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] A More Efficient Event For "Unit is attacked"

Status
Not open for further replies.
Level 9
Joined
Nov 4, 2007
Messages
933
[SOLVED]
I've been having trouble determining a way of getting a faster or better response for the event A Unit is attacked, however, when using this for an ammo system the process is pretty efficient, but when using it for passive custom abilities and such, this event is at times slow reacting, and sometimes registers more times than it should, so is there any solution to this? Thanks in advance for responding.
 
Last edited:
Level 28
Joined
Jan 26, 2007
Messages
4,789
First, create a trigger with no events and the actions you wish (like bash, for example).

Then, create a trigger that activates at map init.
This trigger should be about this:
  • Init
  • Events
    • Map initialization
  • Conditions
  • Actions
    • Set TempUGroup = (Units in (Playable map area))
    • Unit Group - Pick every unit in TempUGroup and do (Actions)
      • Loop - Actions
        • Trigger - Add to [Your ability-trigger without events] the event (Unit - (Picked unit) Takes damage)
    • Custom script: call DestroyGroup(udg_TempUGroup)
Now, create about the same trigger, but for when a unit enters a region
  • Entering Unit
  • Events
    • Unit - A unit enters (Playable map area)
  • Conditions
  • Actions
    • Trigger - Add to [Your ability-trigger without events] the event (Unit - (Triggering unit) Takes damage)
I guess that's it... now the trigger will activate only when the unit takes damage, instead of when an attack is triggered.
Good luck
 
Status
Not open for further replies.
Top