• 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.

[Solved] Question related to DialogButton.

Status
Not open for further replies.
Level 11
Joined
Oct 11, 2012
Messages
711
Hi all. If one player only controls one hero, when the player click a dialog button, how can I get the controlling hero to respond?
For example, Player 1 controls Hero 1. When Player 1 clicks a dialog button, Hero 1 gets leveled up.
Thank you.
 
Level 11
Joined
Oct 11, 2012
Messages
711
Store heroes into array indexed by the player number.
Then get player number of triggering player when dialog button is clicked.
And use however you want.

Triggering player is the clicking player.

You could store the heroes into a unit array, each player has the hero in a index that is the player number.

Hero - set level of units[player number] to level of units[player number] + 1

Thanks both of you. It worked. :) +Rep if I can.
 
Status
Not open for further replies.
Top