• 🏆 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!

[Solved] Is triggering player bugged?

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
Many events do not have a triggering player. Also triggering player does not necessarily mean owner of triggering unit, as some people had to find out the hard way in StarCraft II.

I recommend owner of triggering unit unless you are absolutely certain triggering player returns owner of triggering unit.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
in wc3 triggerPlayer always equal to getOwningPLayer(getTriggerUnit()
In StarCraft II for some events it is that, for others it means the player who's interaction caused the event to fire. For example if player 2 was to order a unit of player 1 to cast an ability in StarCraft II then the owner of triggering unit is player 1 but triggering player is player 2.

If you want owner of triggering unit then do not short cut with triggering player as it is bad practice and use the full statement instead. Triggering player might be slightly faster, but in practically every situation this is trivial.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
"in wc3 triggerPlayer always equal to getOwningPLayer(getTriggerUnit()"
Uhm....
"A player enters a chat message containing the text "bla""
"A player skips a cinematic" (esc)
"A player leaves the game"
"A player presses the left arrow key"
"A player's current gold becomes greater than 300"
"A player changes alliance settings"
GetTriggerUnit() my ass :D
 
Status
Not open for further replies.
Top