• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Differences between (Triggering unit) and (Entering unit)?

Status
Not open for further replies.
Level 9
Joined
Apr 19, 2011
Messages
447
Hi there.

Lately, I was thinking about this... When we make a trigger that, for example, activates when a unit enters a region, and we want to reference that unit; is there ANY difference between using (Triggering unit) and using (Entering unit).

Another good example would be if our trigger activates when the unit leaves the region. Any difference between (Triggering unit) and (Leaving unit)?

I mean, why do we have so much ways to reference a unit if in most cases we can use (Triggering unit)?

Regards
 
Level 5
Joined
Sep 28, 2010
Messages
75
Yes, there is.
According to what i know, (Triggering Unit) is much more faster than (Entering Unit), (Casting Unit), (Dying Unit), etc.

I have no idea why there are so many ways to reference a unit either. Maybe it is mainly to allow users to understand GUI easily? I always use (Triggering Unit) but in some cases where you use some events like:
  • Unit - A unit Is attacked
The (Attacked Unit) is equal to (Triggering Unit) but there is still the (Attacking Unit), so i guess some references are useful too.
 
Level 4
Joined
Aug 3, 2011
Messages
222
(Entering Unit), (Casting Unit), (Dying Unit) , etc won't working under the (waits)

you can test ---
pause killing unit
wait 5 second
unpause killing unit

it won't unpause but it will be solved if killing unit replaced with Triggering unit
 

Deleted member 177737

D

Deleted member 177737

Triggering Unit can be used in most situations, just try using it in your triggers and you will quickly figure out it's correct usage.

Examples:

  • Untitled Trigger 001
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
      • (Triggering unit) Equal to Peasant 0000 <gen>
    • Actions
      • Unit - Replace (Triggering unit) with a Footman using The new unit's default life and mana
      • Unit - Remove (Triggering unit) from the game
  • Untitled Trigger 002
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Sorceress
    • Actions
      • Unit - Kill (Triggering unit)
I used to think it was more or less a usless thing to use but it can actually keep your triggers smaller and speed them up sometimes.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
(Entering Unit), (Casting Unit), (Dying Unit) , etc won't working under the (waits)

you can test ---
pause killing unit
wait 5 second
unpause killing unit

it won't unpause but it will be solved if killing unit replaced with Triggering unit

That is not true though an urban legend. The event responses are all local but Casting Unit and Target Point Of Ability Being Cast e.g. are buggy and cleared/replaced under circumstances.

A difference would be when your trigger possesses unitevents/playerunitevents of different kinds like when your trigger starts on entering AND leaving a region, Triggering Unit would be set in both cases, Entering Unit and Leaving Unit only in 1 case each.
 
Last edited:
Level 20
Joined
Jul 14, 2011
Messages
3,213
Exactly what WaterKnight said. You can have multiple events in the same trigger, and refer to each type of triggering unit with specific ones (Dying) (Casting) etc...
 
Status
Not open for further replies.
Top