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

Hero icons in multiboard

Status
Not open for further replies.
You can index all strings:

Set String[1] = Path for Icon of Hero 1
....
Set String[72] = Path of Icon fo Hero 72

Then in Multiboard:

Multiboard - Set the icon for Multiboard item in column 1, row 1 to Icon_String[IndexOfHero]

I dont know if you already index your heroes, would be best way. If not you use hashtable for example to strore string for each hero type.
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
if it's supposed to be MPI (e.g. one player can have only 1 hero) then you can just save the index inside another integer variable.

e.g.
HeroPortrait[player's number] = *integer number representing the index of picked hero*

then you just show it inside multiboard
AR_Hero_Array[HeroPortrait[player's number]]
 
Level 10
Joined
Mar 17, 2012
Messages
582
if it's supposed to be MPI (e.g. one player can have only 1 hero) then you can just save the index inside another integer variable.

e.g.
HeroPortrait[player's number] = *integer number representing the index of picked hero*

then you just show it inside multiboard
AR_Hero_Array[HeroPortrait[player's number]]

This is kind of MPI))) (noone can have 2 same heroes), but there can be 8 players...
Method that you're talking about is not quite understandable for me... I meen I'm sure that it will work, but I don't know how to bring it to life...

For example I have a trigger that will show heroe's name in multiboard:

  • HeroBlue
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Entering unit) is A Hero) Equal to True
      • (Owner of (Entering unit)) Equal to Player 2 (Blue)
    • Actions
      • Set Hero_Blue = (Triggering unit)
      • Multiboard - Set the text for Statistics item in column 5, row 3 to (|cff0066ff + ((Name of Hero_Blue) + |r))
... but here we have parameter "Name of Hero"...

So, at this moment I have:
1.

AR_Hero_Array[1] = Paladin
...
AR_Hero_Array[72] = Incredible Warrior

2.

HERO_String[1] = ReplaceableTextures\CommandButtons\BTNHeroPaladin.blp
HERO_String[2] = ReplaceableTextures\CommandButtons\BTNHeroArchMage.blp
...
What do I have to do with this? Help me to compone it please =)
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
Ok, I'll try to explain:

Things you have so far
You saved unit-type of each hero inside array - I assume that's the AR_Hero_Array
You also saved image of each hero inside HERO_String array

Now, you did it in a way, so related datas are saved under same indexes.
Example:
Paladin unit is saved under index 1 in AR_Hero_Array and its image is saved in HERO_String array under index 1 as well => you can conclude that related data to Paladin unit are saved under index 1

Now to use the above
To avoid unnecessary loops if you were to do anything with the icon (e.g. player changes hero, leaves the game, etc.), you create another integer variable array, inside which you save the index of picked hero - I'll call this array Player_Hero_Index.
If your map is done so every player can pick only 1 hero (they can control only 1 hero at a time), then you can easily use players' index numbers. Every play slot has one - Player 1 (Red) has index 1, Player 2 (Blue) has index 2 and so on.

So now, when you pick hero, you can save the index of picked hero inside the Player_Hero_Index array and whenever you need to refer to the hero's icon, you can load the number you saved inside Player_Hero_Index.

Basically, this trigger:
  • Pick
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • (Player number of (Triggering player)) Less than or equal to 12
    • Actions
      • Set unit_type = (Unit-type of (Triggering unit))
      • For each (Integer LoopInt) from 1 to 72, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • unit_type Equal to AR_Hero_Array[LoopInt]
            • Then - Actions
              • Set Player_Hero_Index[(Player number of (Triggering player))] = LoopInt
              • Set LoopInt = 72
            • Else - Actions
Now if you need to refer to that player's hero icon, you use this:
  • Multiboard - Set the icon for *Multiboard* item in column X, row Y to HERO_String[Player_Hero_Index[*some index*]]
Notice the *some index* -> how you choose this index depends on the events and actions of the trigger this action is used in.

For example if you used this action during "Pick every player and do (actions)" then instead of *some index* you used (Picked player), etc.


On a side note, looping through 72 units may not be the fastest thing possible, it may actually be better to use hashtable. Unit-types are integer numbers iirc, so it would be
  • Hashtable - Save 1 as (Key Index) of *number of Paladin unit-type* in *Hashtable*
  • Hashtable - Save 2 as (Key Index) of *number of Archmage unit-type* in *Hashtable*
and then just loading the index value using the unit-type of Player's hero.

The question is, how to get correct unit-type's number.
 
Level 10
Joined
Mar 17, 2012
Messages
582
Now if you need to refer to that player's hero icon, you use this:
  • Multiboard - Set the icon for *Multiboard* item in column X, row Y to HERO_String[Player_Hero_Index[*some index*]]
Notice the *some index* -> how you choose this index depends on the events and actions of the trigger this action is used in.

For example if you used this action during "Pick every player and do (actions)" then instead of *some index* you used (Picked player), etc.

So, how can I use this indexing here?:

  • HeroBlue
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Entering unit) is A Hero) Equal to True
      • (Owner of (Entering unit)) Equal to Player 2 (Blue)
    • Actions
      • Set Hero_Blue = (Triggering unit)
      • Multiboard - Set the text for Statistics item in column 6, row 3 to (|cff0066ff + ((Name of Hero_Blue) + |r))
      • Multiboard - Set the icon for Statistics item in column 1, row 3 to HERO_String[Player_Hero_Index[????????????????????????????????]]
And one more thing. If I set any icon, e.g.
  • Set HERO_String[3] = ReplaceableTextures\CommandButtons\BTNHeroMountainKing.blp
I see only green square... why is it so and how to solve it?
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
I think you make things way too complicated for yourself, because you make the whole multiboard static.

You wrote that the map can have up to 8 players... now imagine the situation, where there are only players 1, 2 and 4 and 6. The way you have the multiboard atm would look like this:
Code:
SCOREBOARD
ICON      PLAYER      HERO NAME

[^,^]     Player 1     Jack the hammer

[v,v]     Player 2      Bob Stormstout

*player 3's row with nothing in it*

[x,x]     Player 4      Thane Windhelm

*player 5's row with nothing in it*

[-.-]     Player 6      Luxifer

*player 7's row with nothing in it*

*player 8's row with nothing in it*

if you do it dynamically, not only will you shorten the execution code, you will most likely remove copies of the same trigger (as such, I assume you have copies of same trigger for different player or something like that, going by the trigger you posted)

If done dynamically, you can achieve this:
Code:
SCOREBOARD
ICON      PLAYER      HERO NAME

[^,^]     Player 1     Jack the hammer

[v,v]     Player 2      Bob Stormstout

[x,x]     Player 4      Thane Windhelm

[-.-]     Player 6      Luxifer
Which I think fits the scoreboard better, as players do not need to see unused slots, right?

Of course, the downsize of dynamic multiboard is that you have to track more things (meaning you use more variables) and the code may seem a bit more complex at first.

-----
Anyway, with what you have, you cannot just use Player_Hero_Index, as I don't see you saving the values inside this variable (unless you save it in other trigger, which you did not post).

Now since your trigger is for player 2 (Blue), then it is Player_Hero_Index[2], as the "2" represents the index of the player slot "Player 2 (Blue)"
 
Level 10
Joined
Mar 17, 2012
Messages
582
I think you make things way too complicated for yourself, because you make the whole multiboard static.

You wrote that the map can have up to 8 players... now imagine the situation, where there are only players 1, 2 and 4 and 6. The way you have the multiboard atm would look like this:
Code:
SCOREBOARD
ICON      PLAYER      HERO NAME

[^,^]     Player 1     Jack the hammer

[v,v]     Player 2      Bob Stormstout

*player 3's row with nothing in it*

[x,x]     Player 4      Thane Windhelm

*player 5's row with nothing in it*

[-.-]     Player 6      Luxifer

*player 7's row with nothing in it*

*player 8's row with nothing in it*

if you do it dynamically, not only will you shorten the execution code, you will most likely remove copies of the same trigger (as such, I assume you have copies of same trigger for different player or something like that, going by the trigger you posted)

If done dynamically, you can achieve this:
Code:
SCOREBOARD
ICON      PLAYER      HERO NAME

[^,^]     Player 1     Jack the hammer

[v,v]     Player 2      Bob Stormstout

[x,x]     Player 4      Thane Windhelm

[-.-]     Player 6      Luxifer
Which I think fits the scoreboard better, as players do not need to see unused slots, right?

Of course, the downsize of dynamic multiboard is that you have to track more things (meaning you use more variables) and the code may seem a bit more complex at first.

-----
Anyway, with what you have, you cannot just use Player_Hero_Index, as I don't see you saving the values inside this variable (unless you save it in other trigger, which you did not post).

Now since your trigger is for player 2 (Blue), then it is Player_Hero_Index[2], as the "2" represents the index of the player slot "Player 2 (Blue)"

I agree with you, dynamic multiboard is waaaaaay better than a multiboard I use, but I got no glue how to make it...

I'm not sure, but I guess I've shown all triggers that responsible for the multiboard I have...:ogre_icwydt:

And I've faced one more problem... When I save icon in variable - it show me a green square instead of a picture...

Allright, look, I have:
  • AR Init
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Set AR_Total_Heroes = 72
      • Set AR_Random_Count = 72
      • Set AR_Hero_Array[1] = Paladin
      • Set AR_Hero_Array[2] = Archmage
      • Set AR_Hero_Array[3] = Mountain King
      • Set AR_Hero_Array[4] = Blood Mage
      • Set AR_Hero_Array[5] = Blademaster
      • Set AR_Hero_Array[6] = Far Seer
      • Set AR_Hero_Array[7] = Tauren Chieftain
      • Set AR_Hero_Array[8] = Shadow Hunter
      • Set AR_Hero_Array[9] = Alchemist
      • Set AR_Hero_Array[10] = Tinker
      • Set AR_Hero_Array[11] = Beastmaster
      • Set AR_Hero_Array[12] = Orc Warrior
      • Set AR_Hero_Array[13] = Pandaren Brewmaster
      • Set AR_Hero_Array[14] = Death Knight
      • Set AR_Hero_Array[15] = Lich
      • Set AR_Hero_Array[16] = Dreadlord
      • Set AR_Hero_Array[17] = Crypt Lord
      • Set AR_Hero_Array[18] = Dark Ranger
      • Set AR_Hero_Array[19] = Firelord
      • Set AR_Hero_Array[20] = Pit Lord
      • Set AR_Hero_Array[21] = Keeper of the Grove
      • Set AR_Hero_Array[22] = Priestess of the Moon
      • Set AR_Hero_Array[23] = Demon Hunter
      • Set AR_Hero_Array[24] = Warden
      • Set AR_Hero_Array[25] = Imperial Defender
      • Set AR_Hero_Array[26] = Silver Hand Paladin
      • Set AR_Hero_Array[27] = Cardinal
      • Set AR_Hero_Array[28] = Ice Queen
      • Set AR_Hero_Array[29] = Hellfire Mage
      • Set AR_Hero_Array[30] = Wind Rider
      • Set AR_Hero_Array[31] = Dwarven Sniper
      • Set AR_Hero_Array[32] = Storm Shaman
      • Set AR_Hero_Array[33] = Fire Shaman
      • Set AR_Hero_Array[34] = Tauren Shadow Priest
      • Set AR_Hero_Array[35] = Horde Rider
      • Set AR_Hero_Array[36] = Tuskar Ranger
      • Set AR_Hero_Array[37] = Witch-Doctor
      • Set AR_Hero_Array[38] = Ogre Magi
      • Set AR_Hero_Array[39] = Orc Destroyer
      • Set AR_Hero_Array[40] = Barbarian
      • Set AR_Hero_Array[41] = Master of Metal
      • Set AR_Hero_Array[42] = Eternal Nightmare
      • Set AR_Hero_Array[43] = Warlock
      • Set AR_Hero_Array[44] = Death Prophet
      • Set AR_Hero_Array[45] = Demon Witch
      • Set AR_Hero_Array[46] = Vampire Graf
      • Set AR_Hero_Array[47] = Facetroller
      • Set AR_Hero_Array[48] = Unholy Warrior
      • Set AR_Hero_Array[49] = Reaper
      • Set AR_Hero_Array[50] = Abyss Walker
      • Set AR_Hero_Array[51] = Grave Digger
      • Set AR_Hero_Array[52] = Lightning Revenant
      • Set AR_Hero_Array[53] = Mega Butcher
      • Set AR_Hero_Array[54] = Prophet
      • Set AR_Hero_Array[55] = The Tree of Life
      • Set AR_Hero_Array[56] = The Night Hunter
      • Set AR_Hero_Array[57] = Druid of the Claw
      • Set AR_Hero_Array[58] = The Goddess of Tears
      • Set AR_Hero_Array[59] = Crap Demon
      • Set AR_Hero_Array[60] = Mur'gul Morph agi
      • Set AR_Hero_Array[61] = Stone Giant
      • Set AR_Hero_Array[62] = Tidal Lord
      • Set AR_Hero_Array[63] = Naga Sea Witch
      • Set AR_Hero_Array[64] = Shadow Assassin
      • Set AR_Hero_Array[65] = Elemental Master
      • Set AR_Hero_Array[66] = Gnoll Assassin
      • Set AR_Hero_Array[67] = Night Prowler
      • Set AR_Hero_Array[68] = Azshara's Bodyguard
      • Set AR_Hero_Array[69] = Siege Engineer
      • Set AR_Hero_Array[70] = Overlord of Darkness
      • Set AR_Hero_Array[71] = Earth Shaman
      • Set AR_Hero_Array[72] = Incredible Warrior
      • For each (Integer A) from 1 to 72, do (Actions)
        • Loop - Actions
          • Set AR_Random_Data[(Integer A)] = (Integer A)
this trigger add all my heroes to a veriable (this trigger also takes part in the random mode)
  • STATISTIC
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 6 columns and 11 rows, titled Statistics
      • Set Statistics = (Last created multiboard)
      • Multiboard - Minimize Statistics
      • Multiboard - Set the display style for Statistics item in column 1, row 1 to Hide text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 1, row 2 to Hide text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 1, row 3 to Hide text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 1, row 4 to Hide text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 1, row 5 to Hide text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 1, row 6 to Hide text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 1, row 7 to Hide text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 1, row 8 to Hide text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 1, row 9 to Hide text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 1, row 10 to Hide text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 1, row 11 to Hide text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 2, row 1 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 2, row 2 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 2, row 3 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 2, row 4 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 2, row 5 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 2, row 6 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 2, row 7 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 2, row 8 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 2, row 9 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 2, row 10 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 2, row 11 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 3, row 1 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 3, row 2 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 3, row 3 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 3, row 4 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 3, row 5 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 3, row 6 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 3, row 7 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 3, row 8 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 3, row 9 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 3, row 10 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 3, row 11 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 4, row 1 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 4, row 2 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 4, row 3 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 4, row 4 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 4, row 5 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 4, row 6 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 4, row 7 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 4, row 8 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 4, row 9 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 4, row 10 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 4, row 11 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 5, row 1 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 5, row 2 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 5, row 3 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 5, row 4 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 5, row 5 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 5, row 6 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 5, row 7 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 5, row 8 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 5, row 9 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 5, row 10 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 5, row 11 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 6, row 1 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 6, row 2 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 6, row 3 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 6, row 4 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 6, row 5 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 6, row 6 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 6, row 7 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 6, row 8 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 6, row 9 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 6, row 10 to Show text and Hide icons
      • Multiboard - Set the display style for Statistics item in column 6, row 11 to Show text and Hide icons
      • Multiboard - Set the width for Statistics item in column 1, row 1 to 2.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 1, row 2 to 2.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 1, row 3 to 2.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 1, row 4 to 2.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 1, row 5 to 2.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 1, row 6 to 2.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 1, row 7 to 2.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 1, row 8 to 2.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 1, row 9 to 2.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 1, row 10 to 2.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 1, row 11 to 2.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 2, row 1 to 9.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 2, row 2 to 9.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 2, row 3 to 9.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 2, row 4 to 9.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 2, row 5 to 9.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 2, row 6 to 9.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 2, row 7 to 9.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 2, row 8 to 9.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 2, row 9 to 9.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 2, row 10 to 9.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 2, row 11 to 9.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 6, row 1 to 9.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 6, row 2 to 9.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 6, row 3 to 9.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 6, row 4 to 9.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 6, row 5 to 9.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 6, row 6 to 9.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 6, row 7 to 9.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 6, row 8 to 9.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 6, row 9 to 9.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 6, row 10 to 9.00% of the total screen width
      • Multiboard - Set the width for Statistics item in column 6, row 11 to 9.00% of the total screen width
      • Multiboard - Set the text for Statistics item in column 1, row 3 to <Empty String>
      • Multiboard - Set the text for Statistics item in column 1, row 4 to <Empty String>
      • Multiboard - Set the text for Statistics item in column 1, row 5 to <Empty String>
      • Multiboard - Set the text for Statistics item in column 1, row 6 to <Empty String>
      • Multiboard - Set the text for Statistics item in column 1, row 8 to <Empty String>
      • Multiboard - Set the text for Statistics item in column 1, row 9 to <Empty String>
      • Multiboard - Set the text for Statistics item in column 1, row 10 to <Empty String>
      • Multiboard - Set the text for Statistics item in column 1, row 11 to <Empty String>
      • Multiboard - Set the text for Statistics item in column 2, row 1 to (|cffffcc00 + (Player + |r))
      • Multiboard - Set the text for Statistics item in column 2, row 3 to (|cffff0000 + (Humanoids + |r))
      • Multiboard - Set the text for Statistics item in column 2, row 8 to (|cff00ff00 + (Creatures + |r))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 2 (Blue) slot status) Equal to Is playing
        • Then - Actions
          • Multiboard - Set the text for Statistics item in column 2, row 3 to (|cff0066ff + ((Name of Player 2 (Blue)) + |r))
        • Else - Actions
          • Multiboard - Set the text for Statistics item in column 2, row 3 to <Empty String>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 4 (Purple) slot status) Equal to Is playing
        • Then - Actions
          • Multiboard - Set the text for Statistics item in column 2, row 4 to (|cff550088 + ((Name of Player 4 (Purple)) + |r))
        • Else - Actions
          • Multiboard - Set the text for Statistics item in column 2, row 4 to <Empty String>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 5 (Yellow) slot status) Equal to Is playing
        • Then - Actions
          • Multiboard - Set the text for Statistics item in column 2, row 5 to (|cffffff00 + ((Name of Player 5 (Yellow)) + |r))
        • Else - Actions
          • Multiboard - Set the text for Statistics item in column 2, row 5 to <Empty String>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 6 (Orange) slot status) Equal to Is playing
        • Then - Actions
          • Multiboard - Set the text for Statistics item in column 2, row 6 to (|cffff8800 + ((Name of Player 6 (Orange)) + |r))
        • Else - Actions
          • Multiboard - Set the text for Statistics item in column 2, row 6 to <Empty String>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 8 (Pink) slot status) Equal to Is playing
        • Then - Actions
          • Multiboard - Set the text for Statistics item in column 2, row 8 to (|cffee55bb + ((Name of Player 8 (Pink)) + |r))
        • Else - Actions
          • Multiboard - Set the text for Statistics item in column 2, row 8 to <Empty String>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 9 (Gray) slot status) Equal to Is playing
        • Then - Actions
          • Multiboard - Set the text for Statistics item in column 2, row 9 to (|cff999999 + ((Name of Player 9 (Gray)) + |r))
        • Else - Actions
          • Multiboard - Set the text for Statistics item in column 2, row 9 to <Empty String>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 11 (Dark Green) slot status) Equal to Is playing
        • Then - Actions
          • Multiboard - Set the text for Statistics item in column 2, row 10 to (|cff116644 + ((Name of Player 11 (Dark Green)) + |r))
        • Else - Actions
          • Multiboard - Set the text for Statistics item in column 2, row 10 to <Empty String>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 12 (Brown) slot status) Equal to Is playing
        • Then - Actions
          • Multiboard - Set the text for Statistics item in column 2, row 11 to (|cff552200 + ((Name of Player 12 (Brown)) + |r))
        • Else - Actions
          • Multiboard - Set the text for Statistics item in column 2, row 11 to <Empty String>
      • Multiboard - Set the text for Statistics item in column 3, row 7 to <Empty String>
      • Multiboard - Set the text for Statistics item in column 3, row 1 to (|cff999999 + (L + |r))
      • Multiboard - Set the text for Statistics item in column 4, row 1 to (|cffff0000 + (K + |r))
      • Multiboard - Set the text for Statistics item in column 5, row 1 to (|cff0066ff + (D + |r))
This trigger creates and edits my multiboard
  • HeroBlue
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Entering unit) is A Hero) Equal to True
      • (Owner of (Entering unit)) Equal to Player 2 (Blue)
    • Actions
      • Set Hero_Blue = (Triggering unit)
      • Multiboard - Set the text for Statistics item in column 6, row 3 to (|cff0066ff + ((Name of Hero_Blue) + |r))
This trigger adds a hero owned by player Blue to a variable (yeah I know, it can be modified and so on...)))) (there are 8 of them)
  • Icons
    • Events
    • Conditions
    • Actions
      • Set HERO_String[1] = ReplaceableTextures\CommandButtons\BTNHeroPaladin.blp
      • Set HERO_String[2] = ReplaceableTextures\CommandButtons\BTNHeroArchMage.blp
      • Set HERO_String[3] = ReplaceableTextures\CommandButtons\BTNHeroMountainKing.blp
      • Set HERO_String[4] = ReplaceableTextures\CommandButtons\BTNHeroBloodElfPrince.blp
      • Set HERO_String[4] = ReplaceableTextures\CommandButtons\BTNHeroBloodElfPrince.blp
      • Set HERO_String[5] = ReplaceableTextures\CommandButtons\BTNChaosBlademaster.blp
      • Set HERO_String[6] = ReplaceableTextures\CommandButtons\BTNHeroFarseer.blp
      • Set HERO_String[7] = ReplaceableTextures\CommandButtons\BTNHeroTaurenChieftain.blp
      • Set HERO_String[8] = ReplaceableTextures\CommandButtons\BTNShadowHunter.blp
      • Set HERO_String[9] = ReplaceableTextures\CommandButtons\BTNHeroAlchemist.blp
      • Set HERO_String[10] = ReplaceableTextures\CommandButtons\BTNHeroTinker.blp
      • Set HERO_String[11] = ReplaceableTextures\CommandButtons\BTNBeastMaster.blp
      • Set HERO_String[12] = ReplaceableTextures\CommandButtons\BTNHellScream.blp
      • Set HERO_String[13] = ReplaceableTextures\CommandButtons\BTNPandarenBrewmaster.blp
      • Set HERO_String[14] = ReplaceableTextures\CommandButtons\BTNHeroDeathKnight.blp
      • Set HERO_String[15] = ReplaceableTextures\CommandButtons\BTNHeroLich.blp
      • Set HERO_String[16] = ReplaceableTextures\CommandButtons\BTNHeroDreadLord.blp
      • Set HERO_String[17] = ReplaceableTextures\CommandButtons\BTNHeroCryptLord.blp
      • Set HERO_String[18] = ReplaceableTextures\CommandButtons\BTNBansheeRanger.blp
      • Set HERO_String[19] = ReplaceableTextures\CommandButtons\BTNHeroAvatarOfFlame.blp
      • Set HERO_String[20] = ReplaceableTextures\CommandButtons\BTNPitLord.blp
      • Set HERO_String[21] = ReplaceableTextures\CommandButtons\BTNKeeperOfTheGrove.blp
      • Set HERO_String[22] = ReplaceableTextures\CommandButtons\BTNPriestessOfTheMoon.blp
      • Set HERO_String[23] = ReplaceableTextures\CommandButtons\BTNHeroDemonHunter.blp
      • Set HERO_String[24] = ReplaceableTextures\CommandButtons\BTNHeroWarden.blp
      • Set HERO_String[25] = ReplaceableTextures\CommandButtons\BTNTheCaptain.blp
      • Set HERO_String[26] = ReplaceableTextures\CommandButtons\BTNArthas.blp
      • Set HERO_String[27] = ReplaceableTextures\CommandButtons\BTNPriest.blp
      • Set HERO_String[28] = ReplaceableTextures\CommandButtons\BTNJaina.blp
      • Set HERO_String[29] = ReplaceableTextures\CommandButtons\BTNSorceress.blp
      • Set HERO_String[30] = ReplaceableTextures\CommandButtons\BTNWind Rider.blp
      • Set HERO_String[31] = ReplaceableTextures\CommandButtons\BTNRifleman.blp
      • Set HERO_String[32] = ReplaceableTextures\CommandButtons\BTNThrall.blp
      • Set HERO_String[33] = ReplaceableTextures\CommandButtons\BTNOrcWarlockRed.blp
      • Set HERO_String[34] = ReplaceableTextures\CommandButtons\BTNTauren.blp
      • Set HERO_String[35] = ReplaceableTextures\CommandButtons\BTNChaosWolfRider.blp
      • Set HERO_String[36] = ReplaceableTextures\CommandButtons\BTNTuskaarGold.blp
      • Set HERO_String[37] = ReplaceableTextures\CommandButtons\BTNWitchDoctor.blp
      • Set HERO_String[38] = ReplaceableTextures\CommandButtons\BTNOgreMagi.blp
      • Set HERO_String[39] = ReplaceableTextures\CommandButtons\BTNOrc Destroyer.blp
      • Set HERO_String[40] = ReplaceableTextures\CommandButtons\BTNConan.blp
      • Set HERO_String[41] = ReplaceableTextures\CommandButtons\BTNMordekaiser.blp
      • Set HERO_String[42] = ReplaceableTextures\CommandButtons\BTNShade.blp
      • Set HERO_String[43] = ReplaceableTextures\CommandButtons\BTNEredarWarlockPurple.blp
      • Set HERO_String[44] = ReplaceableTextures\CommandButtons\BTNKelThuzad.blp
      • Set HERO_String[45] = ReplaceableTextures\CommandButtons\BTNChaosWarlock.blp
      • Set HERO_String[46] = ReplaceableTextures\CommandButtons\BTNTichondrius.blp
      • Set HERO_String[47] = ReplaceableTextures\CommandButtons\BTNGhoul.blp
      • Set HERO_String[48] = ReplaceableTextures\CommandButtons\BTNSkeletalOrc.blp
      • Set HERO_String[49] = ReplaceableTextures\CommandButtons\BTNSephiroth.blp
      • Set HERO_String[50] = ReplaceableTextures\CommandButtons\BTNAbyssWalker.blp
      • Set HERO_String[51] = ReplaceableTextures\CommandButtons\BTNZombie.blp
      • Set HERO_String[52] = ReplaceableTextures\CommandButtons\BTNRevenant.blp
      • Set HERO_String[53] = ReplaceableTextures\CommandButtons\BTNAbomination.blp
      • Set HERO_String[54] = ReplaceableTextures\CommandButtons\BTNFurion.blp
      • Set HERO_String[55] = ReplaceableTextures\CommandButtons\BTNEnt.blp
      • Set HERO_String[56] = ReplaceableTextures\CommandButtons\BTNAvengingAssassin.blp
      • Set HERO_String[57] = ReplaceableTextures\CommandButtons\BTNDruidOfTheClaw.blp
      • Set HERO_String[58] = ReplaceableTextures\CommandButtons\BTNHuntress.blp
      • Set HERO_String[59] = ReplaceableTextures\CommandButtons\BTNCrap Demon.blp
      • Set HERO_String[60] = ReplaceableTextures\CommandButtons\BTNMurgulShadowCaster.blp
      • Set HERO_String[61] = ReplaceableTextures\CommandButtons\BTNMountainGiant.blp
      • Set HERO_String[62] = ReplaceableTextures\CommandButtons\BTNSeaGiant.blp
      • Set HERO_String[63] = ReplaceableTextures\CommandButtons\BTNNagaSeaWitch.blp
      • Set HERO_String[64] = ReplaceableTextures\CommandButtons\BTNAkama.blp
      • Set HERO_String[65] = ReplaceableTextures\CommandButtons\BTNIceTrollShadowPriest.blp
      • Set HERO_String[66] = ReplaceableTextures\CommandButtons\BTNGnoll Assassin.blp
      • Set HERO_String[67] = ReplaceableTextures\CommandButtons\BTNSpiderBlack.blp
      • Set HERO_String[68] = ReplaceableTextures\CommandButtons\BTNEvilIllidan.blp
      • Set HERO_String[69] = ReplaceableTextures\CommandButtons\BTNJunkGolem.blp
      • Set HERO_String[70] = ReplaceableTextures\CommandButtons\BTNFelGuard.blp
      • Set HERO_String[71] = ReplaceableTextures\CommandButtons\BTNSpiritWalker.blp
      • Set HERO_String[72] = ReplaceableTextures\CommandButtons\BTNVengeanceIncarnate.blp
This trigger sets icon paths....
  • Hero Icon test
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Entering unit) is A Hero) Equal to True
      • (Player number of (Triggering player)) Less than or equal to 12
    • Actions
      • Set Statistic_Unit_Type = (Unit-type of (Triggering unit))
      • For each (Integer Statistic_LoopInt) from 1 to 72, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Statistic_Unit_Type Equal to AR_Hero_Array[Statistic_LoopInt]
            • Then - Actions
              • Set Player_Hero_Index[(Player number of (Triggering player))] = Statistic_LoopInt
              • Set Statistic_LoopInt = 72
            • Else - Actions
      • Multiboard - Set the icon for Statistics item in column 1, row 3 to HERO_String[Player_Hero_Index[(Player number of (Triggering player))]]
and that's what doesn't work ^^,
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
Because you the action you have for showing icon is this:
"Multiboard - Set the icon for Statistics item in column 1, row 3 to HERO_String[Player_Hero_Index[????????????????????????????????]]"

As I wrote in previous post, for the trigger you posted you should have 2 instead of "???".

The problem is that you most likely have number "0" saved in Player_Hero_Index[], because you don't give it different value anywhere. This variable should hold the index of the hero's unit-type that you defined at the map initialization - that's the trigger where you set Hero[1] = Archmage; Hero[2] = Paladin; ...; Hero[X] = some hero; etc. => You have to save "X" (the index of chosen unit-type) inside Player_Hero_Index.

This is how to code should work step by step
Player picks hero
You loop through all heroes to find out which one was it. For this example, let's say the player is Player 3 (Teal) and the hero he picks is unit-type saved under index 66.

So what should happen next is, that you do this:
  • Set Player_Hero_Index[Player( (triggering player) )] = unit-type's index
  • ...
  • which is in numbers this:
  • Set Player_Hero_Index[3] = 66
Because the index of Player 3 (Teal) is number 3 and the unit-type's index is 66 as we agreed for this example.

...
Now when you want to show the icon, you do it via the command you posted, however now you have correctly set Player_Hero_Index, so it should work. This command:
  • Multiboard - Set the icon for Statistics item in column 1, row 4 to HERO_String[Player_Hero_Index[3]]
  • ...
  • is basically this in numbers:
  • Multiboard - Set the icon for Statistics item in column 1, row 4 to HERO_String[66]
...because the variable "Player_Hero_Index[3]" has number "66" saved inside it.

Now this is the reason for your problem you see?
Currently, in all those Player_Hero_Index, you have saved number "0"... but did you set anything for HERO_String[0] ? As far as I know, you started at HERO_String[1] and went on from the right? This is the reason why a green icon is shown, because you basically tell the game to show an icon at path "<empty string>" :wink:

You can test this yourself by adding the following command inside map initialization trigger:
  • Set HERO_String[0] = *put path to some random icon of your choice*
You will see that the icon shown will no longer be green icon, but the icon you set in HERO_String[0]
 
Level 10
Joined
Mar 17, 2012
Messages
582
Currently, in all those Player_Hero_Index, you have saved number "0"... but did you set anything for HERO_String[0] ? As far as I know, you started at HERO_String[1] and went on from the right? This is the reason why a green icon is shown, because you basically tell the game to show an icon at path "<empty string>" :wink:

You can test this yourself by adding the following command inside map initialization trigger:
  • Set HERO_String[0] = *put path to some random icon of your choice*
You will see that the icon shown will no longer be green icon, but the icon you set in HERO_String[0]

Actually no... I was Trying to set some icon, e.g. Hero_String[4] and it also showed me a green icon...

I'm sorry to interrupt.
But
  • Set AR_Hero_Array[59] = Crap Demon
What?

He is good :thumbs_up:
 
Level 10
Joined
Mar 17, 2012
Messages
582
Yeah sorry for my misleading information earlier... It seemed from your post that you showed String[0] :)

And yeah, triggers need events.
Event is basically "When the trigger fires" / "What must happen for the trigger to fire"

Now everything is good enough)))

The next step will be creating a dynamic multiboard)))
 
Status
Not open for further replies.
Top