Retrieve triggering player of an ability casted on a shared unit?

Darkrider

Active Member
Reaction score
3
is possible to retrieve the player that fired an ability that belongs to a unit shared among various players?
 

jwallstone

New Member
Reaction score
33
I actually just worked on this same issue myself! Unfortunately, the Triggering Player only refers to the owner of the unit.

If I figure something out, I'll let you know. Or if anyone else knows of a way, please do enlighten.
 

Rainther

I guess I should write something of value here...
Reaction score
61
One way would be to see what players that got the this unit selected upon ordering. However I'm not quite sure if it'd be able to filter when more then one are selecting the unit.

Can't come up with a solid resolution anyway.
 

Darkrider

Active Member
Reaction score
3
I also tried triggering unit but unssucesfuly...

The idea of seleccion can be a way, but my map is an AoS and many players might be buying at once from the same building :/

coul there be something jassy for this?
 

jwallstone

New Member
Reaction score
33
I just thought of a possible way to do this. One way to do this is to base all the abilities off Charge Gold and Lumber. Luckily, this ability allows you to change the Base Order Id, so you have multiple copies on one unit.

Have a trigger for the Ability is being cast, and record the gold value for each player that has that unit selected. On the Starts the effect of an ability (which I think will happen after the gold is charged) check to see which player's gold has changed.

Problems:
1. Does the gold get charged to the player that used the ability or the owner? If the latter, then this is no good.
2. Can Charge Gold be given a negative value? If so, that'd work better as the player could have 0 gold and this would still work.

Another possibility is to give the unit the Sell Units ability, and trigger it based off buying a unit disguised as an ability, but that has a lot of side effects.
 

Darkrider

Active Member
Reaction score
3
Ok... you helped me in an unexpected way (making abilities look like items) but unfortunately the gold thingy is for the owner of the triggering unit and not for the player who actually triggered the spell :/
 

Rainther

I guess I should write something of value here...
Reaction score
61
If you have like 5 players you could give them all a simple ability each and then disable the rest of the abilities for each and every player :p

That means that you could track the player by the id, however if you got plenty of abilities and players it's not to be recommended.
 

Darkrider

Active Member
Reaction score
3
actually im about to get to something

and they can be detected =D... as soon as i finish my research ill post the map for you to see ^^

thnx a lot rainther

EDIT: I couldn't identify the triggering player, But i could create the item i wanted in the hero i wanted. The fact is, that i don't know how will this behave in multiplayer that is what i want :S
 

Attachments

  • Shared unit Ability recon By Darkrider.w3x
    18.2 KB · Views: 62
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top