• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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 :)
 
Level 39
Joined
Feb 27, 2007
Messages
5,031
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.
 
Level 2
Joined
Jan 26, 2020
Messages
8
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.
Top