[JASS] Get player who issued order?

Status
Not open for further replies.
Level 2
Joined
Jan 26, 2020
Messages
8
Hey guys.

I have a neutral passive unit which any player can click on and use its abilities (by using shop sharing).
Is there a way to detect the player who issues the ability order?

Thanks :)
 
If Triggering Player doesn’t work you could check which players have the shop selected when it’s ordered. That wouldn’t be conclusive if multiple people have it selected.

It might be possible to give multiple copies of the abilities to the unit and disable all but one of set of them on the UI locally for each player. Then you just check which ability was actually cast. This would totally fuck up cooldowns, though.
 
GetTriggeringPlayer does not work. Here's how I solved it: Whenever a player selects the neutral unit, a tiny copy of the unit is created on top of it, and the triggering player is immediately forced to select this dummy unit. The dummy unit is given a reference to the triggering player. Not the most elegant solution I suppose, but it works.
 
Status
Not open for further replies.
Back
Top