HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Detecting the player issuing an order

05-28-2011, 04:22 PM#1
zeroXD
Is there any clever way to find out which player has issued an order to a unit?
In my situation, shared units are involved, and it'd be advantageous for me and my progress to know.
05-29-2011, 10:51 AM#2
Fledermaus
Nope. Sucks.
05-29-2011, 10:57 AM#3
Bribe
You can detect if the unit is selected by a certain player and not by its actual owner.
05-29-2011, 11:00 AM#4
AzuhaSky
Yeah! I think use Triggering player to detect any issued an order a unit! But i never test for that!
05-29-2011, 11:01 AM#5
Troll-Brain
There are player-unit-order events but they always will fire for the owner of the unit (even if the order is given by a trigger or just by the game engine, like an enemy auto attack), GetTriggerPlayer won't help here.

You can know which players have selected the unit but you can't know which one is ordering the unit, unless the order is an ability which cost gold and/or wood.
05-29-2011, 12:42 PM#6
Bribe
If you control everything by triggers, you would then know exactly which player issued the order. Of course this is not conventional, but is food for thought.

Another trick is to use trackables, fill the map... but I think there is a limit to 10,000 trackables...
05-29-2011, 01:03 PM#7
Troll-Brain
Do trackables detect both click and left click mouse ?

Anyway it's something innacurate and really overkilled, the best one is to use abilities which cost gold and/or wood, at least this is the only way i have in mind which will always work in all situations and the less overskilled. (still need some script around but can de bone).

But for point and target order, if trackables can detect left click and right click that's the way to go, but i'm afraid it would be really to much innacurate (trackable event delay) to be usable.
05-29-2011, 01:09 PM#8
Anitarf
Quote:
Originally Posted by Troll-Brain
Do trackables detect both click and left click mouse ?
No, they don't. What's worse, as far as I remember any clicks made on a trackable will be "intercepted" and won't get registered as orders. So, if you have a unit selected and right-click on a trackable, the unit will not be ordered to move there. Add the delay issues and you see that trackables are useless in this context. It seems there is no way to get a player who issued an order to a unit, the best you can do is get a list of players who currently have that unit selected.
05-29-2011, 01:22 PM#9
Troll-Brain
Trackables seem only useful for some fancy interfaces, like an hero selection, or a big item inventory, something like that where the delay and accurating doesn't really matter.

The cost ability is really limited but can be useful in some cases.

For the selection that's sadly not enough, even if ony one player is selecting the unit, because of orders given by the wc3 ai, though you can easlily detect orders given by trigger and for neutral units that could be usefull (only if there is only one player which has selected the unit ><)

About trackables, i've never used them but already read what you said Anitarf, i guess we could use that for some funny things, like making a no-war zone ^^