• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Question about spells/players

Status
Not open for further replies.
Level 2
Joined
Feb 25, 2011
Messages
15
[SOLVED]Question about spells/players

I would like to know if anyone knows a way to pick or use in "conditions" the player who clicks an ability. Not the one who is owner of the unit channeling spell, just the one who clicks it! :) Help me please, i really need this to complete a system :D +Rep to who helps me :)
 
Last edited:
Level 14
Joined
Apr 20, 2009
Messages
1,543
Are you saying that a player can click on a ability of a unit that is not owned by the player?
I didn't even know that was possible for non-shared units?
Also, how in this case will it ever be MUI (Multi User Instanceable) or MPI (Multi Player Instanceable)?

Show me what you are doing please, I'd love to see what your idea is with this ability.
Or if you could explain it, that will be fine too.

Also: Triggering Player referrs to the player triggering the event.
If the event is: A unit starts the effect of an ability.
Then Triggering player is the same as player of owner of triggering unit.
I wonder how a player who is not owning the unit can click on it's ability?
 
Level 2
Joined
Feb 25, 2011
Messages
15
Yes, in fact it is with units like taverns and buildings that sell units.

Oh yeah sure, i forgot to mention that, my idea with this is to make a new hero selection system in which just 1 tavern can sell infinite amounts of heroes. It works fine in single player, i just need to figure out how to pick the player who clicks an ability.

I am using triggers :)
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
You do realise selling units is not the same as casting abilities right?

Have you seen this event before?
  • Unit - A unit Sells a unit
Triggering unit is the unit selling the ability. Sold unit is the unit being sold, Triggering player is the owner of the selling unit.
You could use owner of sold unit to refference to the player buying the unit in this case.
 
Level 2
Joined
Feb 25, 2011
Messages
15
Yes, i realise that, but i am using the ability "Next/Previous Page" on the tavern and it works! If i could make the clicking player be picked...

Oh yeah i also realize that it can be done with the "selling unit" event but it would be better if i could pick the "clicking player" instead of the "Owner of the Sold Unit".
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
So the tavern has shared unit control and has an ability?
And you are sure you can not use Triggering Player when the ability is cast in this case?

Could you show me the trigger perhaps?

If it really doesn't work then alternatives like dummy sold units and dummy sold items can also be used instead.

Also, I'm not sure if this system is "new" as you describe it. I'm sure lots of people have tried doing this before.
Unless yours is unique to any of the tavern selection systems with previous and next pages so far :)
(I hope I didn't dissapoint you, and I really do support you)
 
Level 2
Joined
Feb 25, 2011
Messages
15
No, the tavern itself has the ability "Select Units" which allows the players to buy units, and also it allows them to use the Tavern's abilities. It does also have the ability "Next/previous Page".

Yes, i am really sure that doesnt work :/

Would it help if i upload the system map so you can check it better?

Ohhh thanks for the info :) Nah, that doesn't dissapoint me because i am creating this system by myself so i learn about my errors and also i improve me triggering knowledge :)
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
No, the tavern itself has the ability "Select Units" which allows the players to buy units, and also it allows them to use the Tavern's abilities. It does also have the ability "Next/previous Page".
Yes, i am really sure that doesnt work :/
Would it help if i upload the system map so you can check it better?

You could do that, or send it through PM.
Doesn't really matter. I'll take a quick look for you and fix it if I find the issue.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
The problem is: there is no way to retrieve the player who started the ability if the unit starting the ability is owned by a different player.
This is a problem that only exists for units like taverns who share ability control.

What you could do in this case is save the player of the unit that the tavern got selected through it's Select Unit ability in a temporary variable.

However, this will cause problems for whenever there are more players in game because whenever a new unit gets selected,
that unit will be the new temporary unit instead and therefore might make the ability work for the wrong player.

What you could also do is: create a dummy unit for each player.
Then whenever a unit is selected by the tavern and the player owning this unit is for example player 1 you could redirect them to the player specific dummy unit.
These dummy units are then owned by that player and thus allows you to have the triggering player and owner of triggering unit refference.

See what I want to say here? It's a lot of trouble for something that can be done with sold units instead...
Using sold units is not only easier but also faster, so do this instead if you want to keep it simple.

Also, a tip: don't use Do Nothing, it is a waste since a function is called that does.... nothing.
Each function that is called takes up a tiny little bit of your trigger's speed ;)


I just gave you 2 options on how to do it, pick one.
 
Last edited:
Level 2
Joined
Feb 25, 2011
Messages
15
Ohhhhhh THANKS YOU REALLY REALLY MUCH! I will use the sold unit function since the other is too much trouble! Thanks! :D
 
Status
Not open for further replies.
Top