• 🏆 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 help please!

Status
Not open for further replies.
Level 4
Joined
Jul 25, 2007
Messages
71
Hey everyone, thanks for reading. I've got a tough question regarding multiboards. On my map, there are two teams we'll call "East side" and "West side". I want the multiboard to look similar to this.


Enkei TD!
West Side
(player 1's name)
(player 2's name)
(player 3's name)
East Side
(Player 4's name)
(Player 5's name)
(Player 6's name)
Hightest income: (Player's name)

The players would have varying row numbers, but the foundations, "West Side, East Side and Highest income" would always be there. The reason I cannot assign a specific number row to each piece of data, is because.. What if there are only 2 players per team? Then there would be a multiboard that looks like this

West Side
Player1
Player2
<Missing data>
East Side

etc etc. I'd like the rows to be "flexible" if you may.. I want them to form based on how many players are currently playing. But I'm not sure how to do that. Any ideas?
 
Level 8
Joined
Nov 9, 2008
Messages
502
Yeh when you create the multiboard you make a loop that only goes through and adds a row for the number of times equal to how many players are in the game. You do that for each team.

If soemone leaves, you have a choice of either remaking the multiboard or you can change the players name to 'left' or something.

In pseudo code it would look like:

Create multiboard
set i = 0
loop
exitwhen i = CountPlayersInForce(CreateForce(GetPlayersInTeam1)) - 1
i = i + 1
Add Row to Multiboard
endloop

I can't remember the exact details for making a multiboard but a loop is what you need to use and then refer to i as the row location or whatever, exit when i = number of players.

If you are doing it in JASS then the max has to have -1 because Player1 is Player(0).
 
  • Trigger
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 1 columns and 9 rows, titled Enkei TD!
      • Set Multiboard = (Last created multiboard)
      • Multiboard - Set the text for Multiboard item in column 1, row 1 to West Side
      • Multiboard - Set the text for Multiboard item in column 1, row 5 to East Side
      • Multiboard - Set the text for Multiboard item in column 1, row 9 to Highest Income:
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) controller) Equal to User
              • ((Player((Integer A))) slot status) Equal to Is playing
            • Then - Actions
              • Multiboard - Set the text for Multiboard item in column 1, row (1 + (Integer A)) to (Name of (Player((Integer A))))
            • Else - Actions
      • For each (Integer B) from 4 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer B))) controller) Equal to User
              • ((Player((Integer B))) slot status) Equal to Is playing
            • Then - Actions
              • Multiboard - Set the text for Multiboard item in column 1, row ((Integer B) + 2) to (Name of (Player((Integer B))))
            • Else - Actions
      • For each (Integer C) from 1 to 9, do (Actions)
        • Loop - Actions
          • Multiboard - Set the width for Multiboard item in column 1, row C to 11.00% of the total screen width
          • Multiboard - Set the display style for Multiboard item in column 1, row C to Show text and Hide icons
      • Multiboard - Show Multiboard
      • Multiboard - Minimize Multiboard
      • Multiboard - Maximize Multiboard
 
Status
Not open for further replies.
Top