[Trigger] A More Efficient Event For "Unit is attacked"

Status
Not open for further replies.
Level 9
Joined
Nov 4, 2007
Messages
932
[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:
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.
Back
Top