• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Multiboard Troubles

Status
Not open for further replies.
Level 6
Joined
Mar 6, 2006
Messages
169
Evening.

I need help creating a multiboard. And yes, I have read both the Variables tutorial and the multiboard tutorial, but none of them bloody explains exactly what variables you should use, what they do, and which trigger functions uses what variables.

I've been trying to sort this out for over and hour, and it's just impossible.

I just want a multiboard that displays the players names, kills and deaths.

This far I Belive I've created the actual multiboard that will display names, deaths and kills, BUT, I can't get the blasted thing to add kills/deaths to the multiboard since neither tutorial I've read explains what variables to use.

If anyone could explain how to add kills/deaths to the multiboard when you kill and die in-game, it'd be highly appreciated.
 
Level 2
Joined
Jan 18, 2009
Messages
29
as they said... just change the text in colunm x and row y to (value in column x row y + 1)... something like that, but you get the idea (hopefully)
start it with zero and it will work
 
Level 6
Joined
Mar 6, 2006
Messages
169
kills and deaths are integer variables, and you just update those multiboarditems whenever someone dies.

...

Still none who gets it eh?

Kills and deaths are integer variables, alright..

ORC_HERO_KILLS - Integer Variable
HUMAN_HERO_KILLS - Integer Variable
ORC_HERO - No idea what Variable
HUMAN_HERO - No idea what Variable

If it's supposed to be a Unit Variable (Not Unit-Type), then I'm thoroughly confused. Because I have no heroes on the map to select, and it won't let me select which heroes without placing them. So the Variable wouldn't identify any of my hero units as ORC_HERO or HUMAN_HERO.

Right?
 
Level 20
Joined
Oct 21, 2006
Messages
3,231
Note
Kills_Total[#] variable is a total number of kills of Team 1 and Team 2. Total number of kills of Team 1 and Team 2 are shown on the title of the multiboard.

Initialization
Stores player colors, names and colored names into variables so that they can be used easily later.
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set Player_Name[(Integer A)] = (Name of (Player((Integer A))))
      • Set Player_Color[1] = |cffFF0000
      • Set Player_Color[2] = |cff0000FF
      • Set Player_Color[3] = |cff00FFFF
      • Set Player_Color[4] = |cff400080
      • Set Player_Color[5] = |cffFFFF00
      • Set Player_Color[6] = |cffFF8000
      • Set Player_Color[7] = |cff00FF00
      • Set Player_Color[8] = |cffFF00FF
      • Set Player_Color[9] = |cff808080
      • Set Player_Color[10] = |cff8080FF
      • Set Player_Color[11] = |cff004000
      • Set Player_Color[12] = |cff804000
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set Player_ColoredName[(Integer A)] = (Player_Color[(Integer A)] + (Player_Name[(Integer A)] + |r))
Creating the Multiboard
Creates the multiboard when the game time elapsed is 0.50 seconds and shows it for all players. You can use "Player_ColoredName" instead of "(Player_Color[(Player number of Player 1 (Red))] + (Name of Player 1 (Red)))". These triggers are from one of my map and I found that I've made a little mistake over there.
  • Set Multiboard
    • Events
      • Time - Elapsed game time is 0.50 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 3 columns and 13 rows, titled <Empty String>
      • Set Multiboard = (Last created multiboard)
      • -------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
      • Multiboard - Change the title of Multiboard to (Player_Color[(Player number of Player 1 (Red))] + (The Sentinel - + ((String(Kills_Total[1])) + (|r / + (Player_Color[(Player number of Player 7 (Green))] + ((String(Kills_Total[2])) + - The Naga|r))))))
      • -------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
      • Multiboard - Set the display style for Multiboard item in column 0, row 0 to Show text and Hide icons
      • Multiboard - Set the display style for Multiboard item in column 1, row 2 to Show text and Show icons
      • Multiboard - Set the display style for Multiboard item in column 1, row 3 to Show text and Show icons
      • Multiboard - Set the display style for Multiboard item in column 1, row 4 to Show text and Show icons
      • Multiboard - Set the display style for Multiboard item in column 1, row 5 to Show text and Show icons
      • Multiboard - Set the display style for Multiboard item in column 1, row 6 to Show text and Show icons
      • Multiboard - Set the display style for Multiboard item in column 1, row 7 to Show text and Show icons
      • Multiboard - Set the display style for Multiboard item in column 1, row 8 to Show text and Show icons
      • Multiboard - Set the display style for Multiboard item in column 1, row 9 to Show text and Show icons
      • Multiboard - Set the display style for Multiboard item in column 1, row 10 to Show text and Show icons
      • Multiboard - Set the display style for Multiboard item in column 1, row 11 to Show text and Show icons
      • Multiboard - Set the display style for Multiboard item in column 1, row 12 to Show text and Show icons
      • Multiboard - Set the display style for Multiboard item in column 1, row 13 to Show text and Show icons
      • Multiboard - Set the display style for Multiboard item in column 1, row 14 to Show text and Hide icons
      • -------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
      • Multiboard - Set the width for Multiboard item in column 1, row 0 to 12.00% of the total screen width
      • -------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
      • Multiboard - Set the text for Multiboard item in column 1, row 1 to |cffFFFF00Player Na...
      • -------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
      • Multiboard - Set the text for Multiboard item in column 1, row 2 to (Player_Color[(Player number of Player 1 (Red))] + (Name of Player 1 (Red)))
      • Multiboard - Set the icon for Multiboard item in column 1, row 2 to ReplaceableTextures\CommandButtons\BTNNightElfCaptureFlag.blp
      • -------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
      • Multiboard - Set the text for Multiboard item in column 1, row 3 to (Player_Color[(Player number of Player 2 (Blue))] + (Name of Player 2 (Blue)))
      • Multiboard - Set the icon for Multiboard item in column 1, row 3 to UI\Minimap\MinimapIconCreepLoc2.blp
      • -------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
      • Multiboard - Set the text for Multiboard item in column 1, row 4 to (Player_Color[(Player number of Player 3 (Teal))] + (Name of Player 3 (Teal)))
      • Multiboard - Set the icon for Multiboard item in column 1, row 4 to UI\Minimap\MinimapIconCreepLoc2.blp
      • -------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
      • Multiboard - Set the text for Multiboard item in column 1, row 5 to (Player_Color[(Player number of Player 4 (Purple))] + (Name of Player 4 (Purple)))
      • Multiboard - Set the icon for Multiboard item in column 1, row 5 to UI\Minimap\MinimapIconCreepLoc2.blp
      • -------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
      • Multiboard - Set the text for Multiboard item in column 1, row 6 to (Player_Color[(Player number of Player 5 (Yellow))] + (Name of Player 5 (Yellow)))
      • Multiboard - Set the icon for Multiboard item in column 1, row 6 to UI\Minimap\MinimapIconCreepLoc2.blp
      • -------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
      • Multiboard - Set the text for Multiboard item in column 1, row 7 to (Player_Color[(Player number of Player 6 (Orange))] + (Name of Player 6 (Orange)))
      • Multiboard - Set the icon for Multiboard item in column 1, row 7 to UI\Minimap\MinimapIconCreepLoc2.blp
      • -------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
      • Multiboard - Set the text for Multiboard item in column 1, row 8 to (Player_Color[(Player number of Player 7 (Green))] + (Name of Player 7 (Green)))
      • Multiboard - Set the icon for Multiboard item in column 1, row 8 to ReplaceableTextures\CommandButtons\BTNUndeadCaptureFlag.blp
      • -------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
      • Multiboard - Set the text for Multiboard item in column 1, row 9 to (Player_Color[(Player number of Player 8 (Pink))] + (Name of Player 8 (Pink)))
      • Multiboard - Set the icon for Multiboard item in column 1, row 9 to UI\Minimap\MinimapIconCreepLoc2.blp
      • -------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
      • Multiboard - Set the text for Multiboard item in column 1, row 10 to (Player_Color[(Player number of Player 9 (Gray))] + (Name of Player 9 (Gray)))
      • Multiboard - Set the icon for Multiboard item in column 1, row 10 to UI\Minimap\MinimapIconCreepLoc2.blp
      • -------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
      • Multiboard - Set the text for Multiboard item in column 1, row 11 to (Player_Color[(Player number of Player 10 (Light Blue))] + (Name of Player 10 (Light Blue)))
      • Multiboard - Set the icon for Multiboard item in column 1, row 11 to UI\Minimap\MinimapIconCreepLoc2.blp
      • -------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
      • Multiboard - Set the text for Multiboard item in column 1, row 12 to (Player_Color[(Player number of Player 11 (Dark Green))] + (Name of Player 11 (Dark Green)))
      • Multiboard - Set the icon for Multiboard item in column 1, row 12 to UI\Minimap\MinimapIconCreepLoc2.blp
      • -------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
      • Multiboard - Set the text for Multiboard item in column 1, row 13 to (Player_Color[(Player number of Player 12 (Brown))] + (Name of Player 12 (Brown)))
      • Multiboard - Set the icon for Multiboard item in column 1, row 13 to UI\Minimap\MinimapIconCreepLoc2.blp
      • -------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
      • Multiboard - Set the text for Multiboard item in column 2, row 1 to |cffFFFF00Kills|r
      • Multiboard - Set the width for Multiboard item in column 2, row 0 to 4.00% of the total screen width
      • -------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
      • Multiboard - Set the text for Multiboard item in column 3, row 1 to |cffFFFF00Deaths|r
      • Multiboard - Set the width for Multiboard item in column 3, row 0 to 4.00% of the total screen width
      • -------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
      • Multiboard - Minimize Multiboard
      • Multiboard - Maximize Multiboard
Updating the Multiboard
This trigger updates the multiboard to the correct values. The trigger has no event for a reason. Having a trigger that runs every 1.00 can cause minor fps losses for the players with slow computers.
  • Update Multiboard
    • Events
    • Conditions
    • Actions
      • Set Kills_Total[1] = (Kills[1] + (Kills[2] + (Kills[3] + (Kills[4] + (Kills[5] + Kills[6])))))
      • Set Kills_Total[2] = (Kills[7] + (Kills[8] + (Kills[9] + (Kills[10] + (Kills[11] + Kills[12])))))
      • -------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
      • Multiboard - Change the title of Multiboard to (Player_Color[(Player number of Player 1 (Red))] + (The Sentinel - + ((String(Kills_Total[1])) + (|r / + (Player_Color[(Player number of Player 7 (Green))] + ((String(Kills_Total[2])) + - The Naga|r))))))
      • -------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
      • Multiboard - Set the text for Multiboard item in column 2, row 2 to (String(Kills[(Player number of Player 1 (Red))]))
      • Multiboard - Set the text for Multiboard item in column 2, row 3 to (String(Kills[(Player number of Player 2 (Blue))]))
      • Multiboard - Set the text for Multiboard item in column 2, row 4 to (String(Kills[(Player number of Player 3 (Teal))]))
      • Multiboard - Set the text for Multiboard item in column 2, row 5 to (String(Kills[(Player number of Player 4 (Purple))]))
      • Multiboard - Set the text for Multiboard item in column 2, row 6 to (String(Kills[(Player number of Player 5 (Yellow))]))
      • Multiboard - Set the text for Multiboard item in column 2, row 7 to (String(Kills[(Player number of Player 6 (Orange))]))
      • Multiboard - Set the text for Multiboard item in column 2, row 8 to (String(Kills[(Player number of Player 7 (Green))]))
      • Multiboard - Set the text for Multiboard item in column 2, row 9 to (String(Kills[(Player number of Player 8 (Pink))]))
      • Multiboard - Set the text for Multiboard item in column 2, row 10 to (String(Kills[(Player number of Player 9 (Gray))]))
      • Multiboard - Set the text for Multiboard item in column 2, row 11 to (String(Kills[(Player number of Player 10 (Light Blue))]))
      • Multiboard - Set the text for Multiboard item in column 2, row 12 to (String(Kills[(Player number of Player 11 (Dark Green))]))
      • Multiboard - Set the text for Multiboard item in column 2, row 13 to (String(Kills[(Player number of Player 12 (Brown))]))
      • -------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
      • Multiboard - Set the text for Multiboard item in column 3, row 2 to (String(Deaths[(Player number of Player 1 (Red))]))
      • Multiboard - Set the text for Multiboard item in column 3, row 3 to (String(Deaths[(Player number of Player 2 (Blue))]))
      • Multiboard - Set the text for Multiboard item in column 3, row 4 to (String(Deaths[(Player number of Player 3 (Teal))]))
      • Multiboard - Set the text for Multiboard item in column 3, row 5 to (String(Deaths[(Player number of Player 4 (Purple))]))
      • Multiboard - Set the text for Multiboard item in column 3, row 6 to (String(Deaths[(Player number of Player 5 (Yellow))]))
      • Multiboard - Set the text for Multiboard item in column 3, row 7 to (String(Deaths[(Player number of Player 6 (Orange))]))
      • Multiboard - Set the text for Multiboard item in column 3, row 8 to (String(Deaths[(Player number of Player 7 (Green))]))
      • Multiboard - Set the text for Multiboard item in column 3, row 9 to (String(Deaths[(Player number of Player 8 (Pink))]))
      • Multiboard - Set the text for Multiboard item in column 3, row 10 to (String(Deaths[(Player number of Player 9 (Gray))]))
      • Multiboard - Set the text for Multiboard item in column 3, row 11 to (String(Deaths[(Player number of Player 10 (Light Blue))]))
      • Multiboard - Set the text for Multiboard item in column 3, row 12 to (String(Deaths[(Player number of Player 11 (Dark Green))]))
      • Multiboard - Set the text for Multiboard item in column 3, row 13 to (String(Deaths[(Player number of Player 12 (Brown))]))
The event for "Update Multiboard" trigger
This trigger uses "Unit is Dies" as an event and runs the "Update Multiboard" trigger every time when a hero dies, while it updates the multiboard.
  • Kill Hero
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Trigger - Run Update Multiboard <gen> (checking conditions)
Note
No, I didn't write this all just for you, they are from one of my "old" maps, so I just mostly copied them from there, but edited a little.

And... its not the best system. You could just update the killing and dying player's stats and find the correct row with y/x + playernumber.
 
Carrigage, you make it harder than it is. Integer variable is a variable that has a certain value, e.g. number 5.
How do they work?
  • triggr
  • Events
    • Unit - A unit dies
  • Conditions
  • Actions
    • Set Kills[Player Number of (Owner of (Killing unit))] = ((Kills[Player Number of (Owner of (Killing unit))]) + 1)
What's this?
Go to Set Variable action and make a variable called "Kills" of type "Integer". Then, tick the "Array".
What this specific action does? When you have an action of type set Variable = Variable + 1, then, this variable increases by 1, once the specified event has fired. For our occasion, the event is "A unit dies", so, this integer variable will increase its value once a unit dies. So, 1 unit dies, the Integer Variable will become 1. A second unit dies, it will become 2, and so on.
What's the array: The array attaches the specified variable to a specific unit/player and other stuff, up to what you want to do. For our occasion, it attaches the kills variable to the owner of killing unit, so that we get the famous MPI result (= Multi Player Instanceability). So, the Integer variable will increase for each player seperately, once a unit owned by that player kills another unit.
Then, we can have: Player 1 for example kills a unit, so, his integer variable will become 1. Player 2 kills two units, but his integer variable will become 2, not 1, while Player's 1 will remain one, since he only killed one unit.
There are other twists you can do, e.g.:
  • Trigger
  • Events
    • Unit - A unit dies
  • Conditions
    • ((Dying unit) is a Hero) Equal to True
    • (Race of (Dying unit)) Equal to Orc
  • Actions
    • Set Kills[Player Number of (Owner of (Killing unit))] = ((Kills[Player Number of (Owner of (Killing unit))]) + 1)
You can see we have a condition attached now, not only one condition, but two.
So, this one will do:
Once a unit dies, the trigger will detect whether the dying a unit was a hero and belonged to the Orc race. To define the race of the unit, simply go to the Object Editor, "Units" tab, go to your unit and scroll down to "Stats - Race". There is the race of the unit. So, for this trigger only, once a unit dies and is a hero AND orc, the Kills integer will increase by 1. If the unit IS a hero, but not of race orc, the Kills variable won't increase, since it has to meet both requirements: race & hero classification.

For the deaths part, it goes the same, although the variable will look like this:
  • Trigger2
  • Events
    • Unit - A unit dies
  • Conditions
  • Actions
    • Set Deaths[Player Number of (Owner of (Dying unit))] = ((Deaths[Player Number of (Owner of (Dying unit))]) + 1)
This works exactly like the first trigger, although this variable is attached to the owner of the dying unit, so that it will result the deaths' score of a player's units.

Also, the action:
  • Multiboard - Set the Item text to Row (1 + (Player Number of (Owner of (Killing unit))), Column 2 to (Kills[Player Number of (Owner of (Killing unit))])
This will be implemented within the first trigger i gave you, the one with the "Kills" variable, it will actually "refresh" the text in the multiboard for the owner of the killing unit.
  • Multiboard - Set the Item text to Row (1 + (Player Number of (Owner of (Dying unit))), column 3 to Deaths[Player Number of (Owner of (Dying unit))]
This will be for the deaths integer variable. You can see that the column is "3", not "2", as in "Kills" variable.

The initial trigger will be like this:
  • Trigger0
  • Events
    • Time - Elapsed time is 0.00 seconds
  • Conditions
  • Actions
    • Multiboard - Create a multiboard with (1 + <your players>) rows and 3 columns
    • Multiboard - Set the item text of Row 1, column 1 to "Players"
    • Multiboard - Set the item text of Row 1, column 2 to "Kills"
    • Multiboard - Set the item text of Row 1, column 3 to "Deaths"
-> (1 + <your players>): E.g. if your map has 10 players, your rows will be 11, because one row will be used for titles (the Players/ Kills/ Deaths titles).
 
Status
Not open for further replies.
Top