• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

"triggering unit"

Status
Not open for further replies.
I'm looking to save time hunting/pecking for the call functions on my triggers. I remember once seeing a list of what each event registers as the "triggering unit" but I've long lost track of that. Basically events like "unit is attacked" and "unit spawns a summon" confuse the crap out of me because I just can't figure out which one is the triggering unit.

Can someone please help? + Rep for being awesome!
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Well the "triggering" unit is always the unit that triggers the event. For example, in a "Unit is attacked" even, the unit that is being attacked will be the triggering unit. If you have "Unit spawns a summon" its the unit that spawns the summon, not the summon.

Unit is attacked
Unit that is attacked​
Unit spawns a summon
Unit that spawns the summon​
Unit finishes training a unit
Unit that trained the other unit​

It pretty much always follows the same logic.
 
That "pretty much always" doesn't apply to the "unit spawns a summon".

I tried testing what you said and in my "spawn summon" trigger I tell it to kill the triggering unit and keep wondering why the summon keeps dying. So I then told it to kill the summoning unit directly, which is what I want, it works, but defies the logic of your post. Also the trigger fires based off of the summon's stats, and I swapped "triggering unit" with "summoned unit" and received the exact same results.

It doesn't make sense.

I'd really like to see that list, I just can't find it anywhere...
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
You're right. I'm sorry I honestly thought that they all followed the exact same logic I don't really use summoning abilities much, and rarely do I use certain events. My apologies.

Oh, I see why I thought it followed the same logic. In JASS the events are labeled a little differently, and it sounds more appropriate for example "Unit starts construction". In JASS the constant for this event is EVENT_UNIT_CONSTRUCTION_START. This means when a unit is at the beginning of its construction, rather than the unit "constructing" it. For your example of "Unit spawns a summoned unit", the JASS translation is EVENT_UNIT_SUMMONED and refers to a unit under the effects of being summoned rather than the unit doing the summoning. It is a little hazy but if you Convert to Custom Text you'll be able to see what I mean more.

I could make a list for you right now if you wanted. If you convert it to Custom Text and read the constants in capital letters like I used above and it will become a lot more clear. Once you convert a trigger to custom text, you can press Ctrl+Z to return it back to the GUI format. I recommend just converting it to text, checking the constant, then pressing Ctrl+Z so that there is no interruptions. It saves your the hassle of occasionally not being able to convert it back to GUI caused by various interruptions.
 
Status
Not open for further replies.
Top