You just need the path of an icon. Example:
- Set Icon_String = ReplaceableTextures\CommandButtons\BTNPandarenBrewmaster.blp
- Multiboard - Set the icon for Multiboard item in column 1, row 1 to Icon_String
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]]
Now if you need to refer to that player's hero icon, you use this:
Notice the *some index* -> how you choose this index depends on the events and actions of the trigger this action is used in.
- Multiboard - Set the icon for *Multiboard* item in column X, row Y to HERO_String[Player_Hero_Index[*some index*]]
For example if you used this action during "Pick every player and do (actions)" then instead of *some index* you used (Picked player), etc.
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*
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
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:
Which I think fits the scoreboard better, as players do not need to see unused slots, right?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
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)"
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:
Because the index of Player 3 (Teal) is number 3 and the unit-type's index is 66 as we agreed for this example.
- Set Player_Hero_Index[Player( (triggering player) )] = unit-type's index
- ...
- which is in numbers this:
- Set Player_Hero_Index[3] = 66
...
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:
...because the variable "Player_Hero_Index[3]" has number "66" saved inside it.
- 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]
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>"
You can test this yourself by adding the following command inside map initialization trigger:
You will see that the icon shown will no longer be green icon, but the icon you set in HERO_String[0]
- Set HERO_String[0] = *put path to some random icon of your choice*
I'm sorry to interrupt.
But
What?
- Set AR_Hero_Array[59] = Crap Demon
I'm not sure if you fire the trigger by using another trigger, however the trigger, where you set up paths for icons does not have event.
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"