How to cast a spell off of another players unit?

Fritz0006

New Member
Reaction score
0
I am having a problem with one of my spell triggers. I am trying to create a spell that moves a player to a location when it is clicked, however the spell is an ability on another unit owned by another player. The player can access the spell because it has unit-select, but I can't figure out what function to use to get the trigger to know which player is triggering the spell. (note: the triggering player selects the OWNER of the caster unit rather than the player clicking the cast spell button)

I hope someone understands and has an answer for me. JASS or GUI is fine... I accept both.

Thanks.
 

Bird

Ultra Cool Member
Reaction score
29
I had a similar situation to this long ago, although it was opposite to yours (I wanted to *prevent* someone from using another player's unit.

No one had a solution for "triggering player" - so all I did was detect whoever had the unit selected. Doesn't entirely fix your problem, as more than one player could have your unit selected at a time.
 

Fritz0006

New Member
Reaction score
0
Yeah, that doesn't really work in my case because the selected unit is not owned by the triggering player. The 'triggering player' function selects the owner of the unit casting the spell rather than the player who actually clicked on the button.

If all else fails, I can try a shittier way of doing it... which would be like a tavern solution. Buying something without actually getting anything from it.

Still looking for help.
 

Tom Jones

N/A
Reaction score
437
Yeah, that doesn't really work in my case because the selected unit is not owned by the triggering player. The 'triggering player' function selects the owner of the unit casting the spell rather than the player who actually clicked on the button.

If all else fails, I can try a shittier way of doing it... which would be like a tavern solution. Buying something without actually getting anything from it.

Still looking for help.
Think that'll actually be the easiest solution. As you pointed out, make the unit sell a fake unit and then move the buying unit to the desired location.
 

Fritz0006

New Member
Reaction score
0
Yeah, however wont it display a little number to indicate that it is a sold item?

Thats what I wanted to avoid. :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top