• 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] Efficiency of a trigger

Status
Not open for further replies.
Level 4
Joined
Aug 12, 2004
Messages
76
Which is more efficient?
Having multiple trigger having the same "When any unit is attacked" with conditions, or having one trigger with one event of "when any unit is attacked" with multiple conditions and putting them into one?

Also, is there an event that has "When a unit takes damage"?
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Don't know about effiency, but I think it can bug if you do multiple triggers with same events.
Try it though.

And about the "unit takes damage", there is a event like that but only in a Specific Unit events so if you want to do a damage system (sounds like it) or anything like it, you'll have to do it based on 3 triggers.

One would work when a unit starts to attack, it will set a unit variable to the attacker/attacked unit (depends where you want the text?).

A second trigger will work on 0.00 seconds of the game and add a third trigger the event "Unit_Variable is attacked".

And then a thired one which will have your conditions.

This will bug however if more then 1 unit attackes exacly at the same time so ill advise you to ask a JASSer to make you something in JASS.
 
Status
Not open for further replies.
Top