• 🏆 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 issue! [Solved]

Level 10
Joined
Jun 20, 2017
Messages
333
I have this multiboard, the problem is that the player should be added under the second row!
  • Setup Multiboard
    • Events
      • Time - Elapsed game time is 0.02 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 7 columns and ((Number of players in PlayerGroup_ActiveUsers) + 5) rows, titled (String_MapName + |cffff0000(Selecting Modes)|r).
      • Set VariableSet LastCreatedMultiboard = (Last created multiboard)
      • -------- --------
      • -------- First row --------
      • Multiboard - Set the text for LastCreatedMultiboard item in column 1, row 1 to |cffffcc00Number|r
      • Multiboard - Set the text for LastCreatedMultiboard item in column 2, row 1 to |cffffcc00Player Na...
      • Multiboard - Set the text for LastCreatedMultiboard item in column 3, row 1 to |cffffcc00Status|r
      • Multiboard - Set the text for LastCreatedMultiboard item in column 4, row 1 to |cffffcc00Gold|r
      • Multiboard - Set the text for LastCreatedMultiboard item in column 5, row 1 to |cffffcc00Lumber|r
      • Multiboard - Set the text for LastCreatedMultiboard item in column 6, row 1 to |cffffcc00Score|r
      • Multiboard - Set the text for LastCreatedMultiboard item in column 7, row 1 to |cffffcc00Level|r
      • -------- --------
      • -------- Second row --------
      • Multiboard - Set the text for LastCreatedMultiboard item in column 1, row ((Number of players in PlayerGroup_ActiveUsers) + 2) to #
      • Multiboard - Set the display style for LastCreatedMultiboard item in column 1, row ((Number of players in PlayerGroup_ActiveUsers) + 2) to Show text and Hide icons
      • Multiboard - Set the text for LastCreatedMultiboard item in column 2, row ((Number of players in PlayerGroup_ActiveUsers) + 2) to (Humans ( + ((String((Number of players in PlayerGroup_Humans))) + )))
      • Multiboard - Set the text for LastCreatedMultiboard item in column 3, row ((Number of players in PlayerGroup_ActiveUsers) + 2) to is
      • Multiboard - Set the icon for LastCreatedMultiboard item in column 4, row ((Number of players in PlayerGroup_ActiveUsers) + 2) to UI\Feedback\Resources\ResourceGold.blp
      • Multiboard - Set the display style for LastCreatedMultiboard item in column 4, row ((Number of players in PlayerGroup_ActiveUsers) + 2) to Hide text and Show icons
      • Multiboard - Set the icon for LastCreatedMultiboard item in column 5, row ((Number of players in PlayerGroup_ActiveUsers) + 2) to UI\Feedback\Resources\ResourceLumber.blp
      • Multiboard - Set the display style for LastCreatedMultiboard item in column 5, row ((Number of players in PlayerGroup_ActiveUsers) + 2) to Hide text and Show icons
      • Multiboard - Set the text for LastCreatedMultiboard item in column 6, row ((Number of players in PlayerGroup_ActiveUsers) + 2) to Fed
      • Multiboard - Set the icon for LastCreatedMultiboard item in column 7, row ((Number of players in PlayerGroup_ActiveUsers) + 2) to ReplaceableTextures\PassiveButtons\PASBTNStatUp.blp
      • Multiboard - Set the display style for LastCreatedMultiboard item in column 7, row ((Number of players in PlayerGroup_ActiveUsers) + 2) to Hide text and Show icons
      • -------- --------
      • -------- Third row --------
      • Multiboard - Set the text for LastCreatedMultiboard item in column 1, row ((Number of players in PlayerGroup_ActiveUsers) + 3) to #
      • Multiboard - Set the display style for LastCreatedMultiboard item in column 1, row ((Number of players in PlayerGroup_ActiveUsers) + 3) to Show text and Hide icons
      • Multiboard - Set the text for LastCreatedMultiboard item in column 2, row ((Number of players in PlayerGroup_ActiveUsers) + 3) to (Vampires ( + ((String((Number of players in PlayerGroup_Vampires))) + )))
      • Multiboard - Set the text for LastCreatedMultiboard item in column 3, row ((Number of players in PlayerGroup_ActiveUsers) + 3) to is
      • Multiboard - Set the icon for LastCreatedMultiboard item in column 4, row ((Number of players in PlayerGroup_ActiveUsers) + 3) to UI\Feedback\Resources\ResourceGold.blp
      • Multiboard - Set the display style for LastCreatedMultiboard item in column 4, row ((Number of players in PlayerGroup_ActiveUsers) + 3) to Hide text and Show icons
      • Multiboard - Set the icon for LastCreatedMultiboard item in column 5, row ((Number of players in PlayerGroup_ActiveUsers) + 3) to UI\Feedback\Resources\ResourceLumber.blp
      • Multiboard - Set the display style for LastCreatedMultiboard item in column 5, row ((Number of players in PlayerGroup_ActiveUsers) + 3) to Hide text and Show icons
      • Multiboard - Set the text for LastCreatedMultiboard item in column 6, row ((Number of players in PlayerGroup_ActiveUsers) + 3) to Leaked
      • Multiboard - Set the icon for LastCreatedMultiboard item in column 7, row ((Number of players in PlayerGroup_ActiveUsers) + 3) to ReplaceableTextures\PassiveButtons\PASBTNStatUp.blp
      • Multiboard - Set the display style for LastCreatedMultiboard item in column 7, row ((Number of players in PlayerGroup_ActiveUsers) + 3) to Hide text and Show icons
      • -------- --------
      • -------- Fourth row --------
      • Multiboard - Set the text for LastCreatedMultiboard item in column 1, row ((Number of players in PlayerGroup_ActiveUsers) + 4) to -------------------...
      • Multiboard - Set the text for LastCreatedMultiboard item in column 2, row ((Number of players in PlayerGroup_ActiveUsers) + 4) to -------------------...
      • Multiboard - Set the text for LastCreatedMultiboard item in column 3, row ((Number of players in PlayerGroup_ActiveUsers) + 4) to -------------------...
      • Multiboard - Set the text for LastCreatedMultiboard item in column 4, row ((Number of players in PlayerGroup_ActiveUsers) + 4) to -------------------...
      • Multiboard - Set the text for LastCreatedMultiboard item in column 5, row ((Number of players in PlayerGroup_ActiveUsers) + 4) to -------------------...
      • Multiboard - Set the text for LastCreatedMultiboard item in column 6, row ((Number of players in PlayerGroup_ActiveUsers) + 4) to -------------------...
      • Multiboard - Set the text for LastCreatedMultiboard item in column 7, row ((Number of players in PlayerGroup_ActiveUsers) + 4) to -------------------...
      • -------- --------
      • -------- Fifth row --------
      • Multiboard - Set the text for LastCreatedMultiboard item in column 1, row ((Number of players in PlayerGroup_ActiveUsers) + 5) to Game Time
      • -------- --------
      • Multiboard - Set the width for LastCreatedMultiboard item in column 0, row 0 to 7.00% of the total screen width
      • Multiboard - Set the width for LastCreatedMultiboard item in column 1, row 0 to 5.00% of the total screen width
      • Multiboard - Set the width for LastCreatedMultiboard item in column 2, row 0 to 15.00% of the total screen width
      • Multiboard - Set the width for LastCreatedMultiboard item in column 3, row 0 to 5.00% of the total screen width
      • Multiboard - Set the width for LastCreatedMultiboard item in column 7, row 0 to 3.00% of the total screen width
      • Multiboard - Set the width for LastCreatedMultiboard item in column 1, row ((Number of players in PlayerGroup_ActiveUsers) + 5) to 7.00% of the total screen width
      • -------- --------
      • Multiboard - Set the display style for LastCreatedMultiboard item in column 0, row 0 to Show text and Hide icons
      • Multiboard - Set the display style for LastCreatedMultiboard item in column 4, row ((Number of players in PlayerGroup_ActiveUsers) + 2) to Hide text and Show icons
      • Multiboard - Set the display style for LastCreatedMultiboard item in column 5, row ((Number of players in PlayerGroup_ActiveUsers) + 2) to Hide text and Show icons
      • Multiboard - Set the display style for LastCreatedMultiboard item in column 7, row ((Number of players in PlayerGroup_ActiveUsers) + 2) to Hide text and Show icons
      • Multiboard - Set the display style for LastCreatedMultiboard item in column 4, row ((Number of players in PlayerGroup_ActiveUsers) + 3) to Hide text and Show icons
      • Multiboard - Set the display style for LastCreatedMultiboard item in column 5, row ((Number of players in PlayerGroup_ActiveUsers) + 3) to Hide text and Show icons
      • Multiboard - Set the display style for LastCreatedMultiboard item in column 7, row ((Number of players in PlayerGroup_ActiveUsers) + 3) to Hide text and Show icons
      • For each (Integer A) from 1 to 2, do (Actions)
        • Loop - Actions
          • Multiboard - Set the display style for LastCreatedMultiboard item in column (Integer A), row ((Number of players in PlayerGroup_ActiveUsers) + 4) to Show text and Hide icons
          • Multiboard - Set the display style for LastCreatedMultiboard item in column (Integer A), row ((Number of players in PlayerGroup_ActiveUsers) + 5) to Show text and Hide icons
      • -------- --------
      • Set VariableSet Integer_Multiboard = 0
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) is in PlayerGroup_ActiveUsers.) Equal to True
            • Then - Actions
              • Set VariableSet Integer_Multiboard = (Integer_Multiboard + 1)
              • Set VariableSet Integers_MultiboardRow[(Integer A)] = (Integer_Multiboard + 1)
              • -------- --------
              • Multiboard - Set the text for LastCreatedMultiboard item in column 1, row Integers_MultiboardRow[(Integer A)] to ((Strings_PlayersColor[(Integer A)] + (String((Player number of (Player((Integer A))))))) + |r)
              • Multiboard - Set the icon for LastCreatedMultiboard item in column 1, row Integers_MultiboardRow[(Integer A)] to Strings_BuilderIcon[(Integer A)]
              • Multiboard - Set the display style for LastCreatedMultiboard item in column 1, row Integers_MultiboardRow[(Integer A)] to Show text and Show icons
              • Multiboard - Set the text for LastCreatedMultiboard item in column 2, row Integers_MultiboardRow[(Integer A)] to ((Strings_PlayersColor[(Integer A)] + (Name of (Player((Integer A))))) + |r)
            • Else - Actions
      • -------- --------
      • Multiboard - Show LastCreatedMultiboard
      • Multiboard - Maximize LastCreatedMultiboard
 

Attachments

  • Screenshot_3.png
    Screenshot_3.png
    904.2 KB · Views: 10

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
Do you understand what's happening in this section of the trigger?
  • -------- --------
  • Set VariableSet Integer_Multiboard = 0
  • For each (Integer A) from 1 to 12, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Player((Integer A))) is in PlayerGroup_ActiveUsers.) Equal to True
        • Then - Actions
          • Set VariableSet Integer_Multiboard = (Integer_Multiboard + 1)
          • Set VariableSet Integers_MultiboardRow[(Integer A)] = (Integer_Multiboard + 1)
          • -------- --------
          • Multiboard - Set the text for LastCreatedMultiboard item in column 1, row Integers_MultiboardRow[(Integer A)] to ((Strings_PlayersColor[(Integer A)] + (String((Player number of (Player((Integer A))))))) + |r)
          • Multiboard - Set the icon for LastCreatedMultiboard item in column 1, row Integers_MultiboardRow[(Integer A)] to Strings_BuilderIcon[(Integer A)]
          • Multiboard - Set the display style for LastCreatedMultiboard item in column 1, row Integers_MultiboardRow[(Integer A)] to Show text and Show icons
          • Multiboard - Set the text for LastCreatedMultiboard item in column 2, row Integers_MultiboardRow[(Integer A)] to ((Strings_PlayersColor[(Integer A)] + (Name of (Player((Integer A))))) + |r)
        • Else - Actions
Because the solution is very clear once you run through the math.

If Integer_Multiboard starts at 0, and you increase it by 1 for each Player, then Set the player's Row to that value + 1, what do you end up with?

The first player will use Row (0 + 1 + 1) = 2.
The second player will use Row (0 + 2 + 1) = 3.
etc...

So all you have to do is Set Integer_Multiboard to 1 instead of 0 before the For Loop. That way you start at Row 3 and not Row 2.


If you can have multiple Players on both the Human and Vampire teams and you want them to be positioned below their respective team's Row then you'll need to go about this in a slightly different way:
  • -------- HUMANS --------
  • Set VariableSet Integer_Multiboard = 2
  • For each (Integer A) from 1 to 12, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Player((Integer A))) is in HUMANS) Equal to True
        • Then - Actions
          • Set VariableSet Integer_Multiboard = (Integer_Multiboard + 1)
          • Set VariableSet Integers_MultiboardRow[(Integer A)] = Integer_Multiboard
          • -------- --------
          • Multiboard - Set the text for LastCreatedMultiboard item in column 1, row Integer_Multiboard to ((Strings_PlayersColor[(Integer A)] + (String((Player number of (Player((Integer A))))))) + |r)
          • Multiboard - Set the icon for LastCreatedMultiboard item in column 1, row Integer_Multiboard to Strings_BuilderIcon[(Integer A)]
          • Multiboard - Set the display style for LastCreatedMultiboard item in column 1, row Integer_Multiboard to Show text and Show icons
          • Multiboard - Set the text for LastCreatedMultiboard item in column 2, row Integer_Multiboard to ((Strings_PlayersColor[(Integer A)] + (Name of (Player((Integer A))))) + |r)
        • Else - Actions
  • -------- VAMPIRES --------
  • Set VariableSet Integer_Multiboard = (Integer_Multiboard + 1)
  • For each (Integer A) from 1 to 12, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Player((Integer A))) is in VAMPIRES) Equal to True
        • Then - Actions
          • Set VariableSet Integer_Multiboard = (Integer_Multiboard + 1)
          • Set VariableSet Integers_MultiboardRow[(Integer A)] = Integer_Multiboard
          • -------- --------
          • Multiboard - Set the text for LastCreatedMultiboard item in column 1, row Integer_Multiboard to ((Strings_PlayersColor[(Integer A)] + (String((Player number of (Player((Integer A))))))) + |r)
          • Multiboard - Set the icon for LastCreatedMultiboard item in column 1, row Integer_Multiboard to Strings_BuilderIcon[(Integer A)]
          • Multiboard - Set the display style for LastCreatedMultiboard item in column 1, row Integer_Multiboard to Show text and Show icons
          • Multiboard - Set the text for LastCreatedMultiboard item in column 2, row Integer_Multiboard to ((Strings_PlayersColor[(Integer A)] + (Name of (Player((Integer A))))) + |r)
        • Else - Actions
I also simplified things in this example to be a bit more efficient and logical. There's no need for the extra addition in Integers_MultiboardRow[] since Integer_Multiboard can already handle this for you.

Also, naming your multiboard variable LastCreatedMultiboard, I like your style :p
 
Last edited:
Top