• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Multitable MUI issue

Status
Not open for further replies.
Level 10
Joined
Mar 17, 2012
Messages
582
Hi everyone! I've made a multitable, which works fine with a single player, but if I add computers to the game, it stops showing results. Any ideas why?

Init:

  • MASTERIES
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Set M_Columns = 5
      • Set M_Rows = 9
      • For each (Integer M_Player) from 1 to 8, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player(M_Player)) slot status) Equal to Is playing
            • Then - Actions
              • Multiboard - Create a multiboard with M_Columns columns and M_Rows rows, titled Masteries
              • Set MASTERIES[M_Player] = (Last created multiboard)
              • Multiboard - Minimize MASTERIES[M_Player]
              • For each (Integer B) from 1 to M_Rows, do (Actions)
                • Loop - Actions
                  • For each (Integer A) from 2 to M_Columns, do (Actions)
                    • Loop - Actions
                      • Multiboard - Set the display style for MASTERIES[M_Player] item in column (Integer A), row (Integer B) to Show text and Hide icons
                  • Multiboard - Set the display style for MASTERIES[M_Player] item in column 1, row (Integer B) to Hide text and Show icons
              • Multiboard - Set the display style for MASTERIES[M_Player] item in column 1, row 1 to Hide text and Hide icons
              • -------- row 1 --------
              • Multiboard - Set the text for MASTERIES[M_Player] item in column 2, row 1 to |cffffcc00Mastery|r
              • Multiboard - Set the text for MASTERIES[M_Player] item in column 3, row 1 to |cffffcc00Level|r
              • Multiboard - Set the text for MASTERIES[M_Player] item in column 4, row 1 to |cffffcc00Current|r
              • Multiboard - Set the text for MASTERIES[M_Player] item in column 5, row 1 to |cffffcc00Cap|r
              • -------- icons --------
              • Multiboard - Set the icon for MASTERIES[M_Player] item in column 1, row 2 to ReplaceableTextures\CommandButtons\BTNShovel.blp
              • Multiboard - Set the icon for MASTERIES[M_Player] item in column 1, row 3 to ReplaceableTextures\CommandButtons\BTNOrcMeleeUpTwo.blp
              • Multiboard - Set the icon for MASTERIES[M_Player] item in column 1, row 4 to ReplaceableTextures\CommandButtons\BTNGatherGold.blp
              • Multiboard - Set the icon for MASTERIES[M_Player] item in column 1, row 5 to ReplaceableTextures\CommandButtons\BTNCombatKnife.blp
              • Multiboard - Set the icon for MASTERIES[M_Player] item in column 1, row 6 to ReplaceableTextures\CommandButtons\BTNWirtsLeg.blp
              • Multiboard - Set the icon for MASTERIES[M_Player] item in column 1, row 7 to ReplaceableTextures\PassiveButtons\PASBTNEvasion.blp
              • Multiboard - Set the icon for MASTERIES[M_Player] item in column 1, row 8 to ReplaceableTextures\PassiveButtons\PASBTNCriticalStrike.blp
              • Multiboard - Set the icon for MASTERIES[M_Player] item in column 1, row 9 to ReplaceableTextures\CommandButtons\BTNReveal.blp
              • -------- Column 2 --------
              • Multiboard - Set the text for MASTERIES[M_Player] item in column 2, row 2 to (Color[3] + Agriculture|r)
              • Multiboard - Set the text for MASTERIES[M_Player] item in column 2, row 3 to (Color[7] + Forestry|r)
              • Multiboard - Set the text for MASTERIES[M_Player] item in column 2, row 4 to (Color[1] + Mining|r)
              • Multiboard - Set the text for MASTERIES[M_Player] item in column 2, row 5 to (Color[6] + Hunting|r)
              • Multiboard - Set the text for MASTERIES[M_Player] item in column 2, row 6 to (|cffffffff + Athletics|r)
              • Multiboard - Set the text for MASTERIES[M_Player] item in column 2, row 7 to (|cffffcc00 + Evasion|r)
              • Multiboard - Set the text for MASTERIES[M_Player] item in column 2, row 8 to (|cffffcc00 + Critical|r)
              • Multiboard - Set the text for MASTERIES[M_Player] item in column 2, row 9 to (|cffffcc00 + Accuracy|r)
              • -------- Column 4 --------
              • Multiboard - Set the text for MASTERIES[M_Player] item in column 5, row 2 to 290
              • Multiboard - Set the text for MASTERIES[M_Player] item in column 5, row 3 to 290
              • Multiboard - Set the text for MASTERIES[M_Player] item in column 5, row 4 to 290
              • Multiboard - Set the text for MASTERIES[M_Player] item in column 5, row 5 to 240
              • Multiboard - Set the text for MASTERIES[M_Player] item in column 5, row 6 to 240
              • -------- Column widths --------
              • For each (Integer A) from 1 to M_Rows, do (Actions)
                • Loop - Actions
                  • Multiboard - Set the width for MASTERIES[M_Player] item in column 1, row (Integer A) to 1.20% of the total screen width
                  • Multiboard - Set the width for MASTERIES[M_Player] item in column 2, row (Integer A) to 8.00% of the total screen width
                  • Multiboard - Set the width for MASTERIES[M_Player] item in column 3, row (Integer A) to 3.00% of the total screen width
                  • Multiboard - Set the width for MASTERIES[M_Player] item in column 4, row (Integer A) to 4.00% of the total screen width
                  • Multiboard - Set the width for MASTERIES[M_Player] item in column 5, row (Integer A) to 3.00% of the total screen width
            • Else - Actions
      • Trigger - Turn on Masteries loop <gen>


Loop:

  • Masteries loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer M_Int) from 1 to 8, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • ((Player(M_Int)) slot status) Equal to Is playing
                  • (Peasant[M_Int] is alive) Equal to True
            • Then - Actions
              • Game - Display to (All players) the text: ((Name of (Player(M_Int))) + :) + ((String(Dig_Counter[M_Int])) + ( / + (String(Dig_Mastery[M_Int]))))))
              • -------- column 3 --------
              • Multiboard - Set the text for MASTERIES[M_Int] item in column 3, row 2 to (String(Dig_Mastery[M_Int]))
              • Multiboard - Set the text for MASTERIES[M_Int] item in column 3, row 3 to (String(Axe_Mastery[M_Int]))
              • Multiboard - Set the text for MASTERIES[M_Int] item in column 3, row 4 to (String(Mining_Mastery[M_Int]))
              • Multiboard - Set the text for MASTERIES[M_Int] item in column 3, row 5 to (String(Hunt_Level[M_Int]))
              • Multiboard - Set the text for MASTERIES[M_Int] item in column 3, row 6 to (String(Athletic_Mastery[M_Int]))
              • Multiboard - Set the text for MASTERIES[M_Int] item in column 3, row 7 to ((String(Evasion_Int[M_Int])) + %)
              • Multiboard - Set the text for MASTERIES[M_Int] item in column 3, row 8 to ((String(Critical_Chance[M_Int])) + %)
              • Multiboard - Set the text for MASTERIES[M_Int] item in column 3, row 9 to ((String((100 + Accuracy_Int[M_Int]))) + %)
              • -------- column 4 --------
              • Multiboard - Set the text for MASTERIES[M_Int] item in column 4, row 2 to (String(Dig_Counter[M_Int]))
              • Multiboard - Set the text for MASTERIES[M_Int] item in column 4, row 3 to (String(Axe_Mastery_Counter[M_Int]))
              • Multiboard - Set the text for MASTERIES[M_Int] item in column 4, row 4 to (String(Mining_Mastery_Counter[M_Int]))
              • Multiboard - Set the text for MASTERIES[M_Int] item in column 4, row 5 to (String(Hunt_Counter[M_Int]))
              • Multiboard - Set the text for MASTERIES[M_Int] item in column 4, row 6 to (String(Leap_Bonus[M_Int]))
            • Else - Actions


In the second trigger I made a 'Game display message' to see if the variables are working, so they are.

Thanks in advance! :)
 
Last edited:
Level 41
Joined
Feb 27, 2007
Messages
5,208
I don't see anything in there to explicitly show the multiboard besides the minimize line. And you want them to be shown for each player, right? You'll need a localplayer if block:
  • -------- after setting up the multiboard, inside the loop: --------
  • Custom script: if GetLocalPlayer() == Player(udg_M_Int+1) then //GUI player numbers are 1 higher than JASS player numbers; Player(0) = Player 1
  • Multiboard - Show Masteries[M_Int]
  • Custom script: endif
 
but if I add computers to the game, it stops showing results. Any ideas why?
The GUI action "Create Multiboard" displays the created multiboard to all players, but warcraft 3 supports only showing one multiboard at the same time. Currently you will see the multiboard of the player (or bot) playing with the highest nr.

Use some kind of pyrogasms suggestion to only show the multiboard belonging to the local player. After all of the multiboards were created.

Edit: This is a MPI (Multiple Player) problem, not a MUI (Multiple Unit) one.
 
Last edited:
Level 10
Joined
Mar 17, 2012
Messages
582
The GUI action "Create Multiboard" displays the created multiboard to all players, but warcraft 3 supports only showing one multiboard at the same time.
Edit: This is a MPI (Multiple Player) problem, not a MUI (Multiple Unit) one.
Now it makes sense...

  • -------- after setting up the multiboard, inside the loop: --------
  • Custom script: if GetLocalPlayer() == Player(udg_M_Int+1) then //GUI player numbers are 1 higher than JASS player numbers; Player(0) = Player 1
  • Multiboard - Show Masteries[M_Int]
  • Custom script: endif

Should I just add it to the trigger or do I need to delete some part of the code?
 
I suggest to add this lines at the end of your Multiboard creation trigger. This actions write onto the variable GetLocalPlayer (Player) the value of GetLocalPlayer() then one shows the multiboard at index of that GetLocalPlayers number.

  • Custom script: set udg_GetLocalPlayer = GetLocalPlayer()
  • Multiboard - Hide (Last created multiboard)
  • Multiboard - Show Multiboard[(Player number of GetLocalPlayer)]
GetLocalPlayer() returns for each user himself making it quite good for such asynchron behaviour.
Do not use GetLocalPlayer for an action altering directly or indirectly the game state. If you alter the gamestate asynchron there is a high chance for a desync. Showing an visual object, existing for all users, should work without problems.
 
Level 10
Joined
Mar 17, 2012
Messages
582
I suggest to add this lines at the end of your Multiboard creation trigger. This actions write onto the variable GetLocalPlayer (Player) the value of GetLocalPlayer() then one shows the multiboard at index of that GetLocalPlayers number.

  • Custom script: set udg_GetLocalPlayer = GetLocalPlayer()
  • Multiboard - Hide (Last created multiboard)
  • Multiboard - Show Multiboard[(Player number of GetLocalPlayer)]
GetLocalPlayer() returns for each user himself making it quite good for such asynchron behaviour.
Do not use GetLocalPlayer for an action altering directly or indirectly the game state. If you alter the gamestate asynchron there is a high chance for a desync. Showing an visual object, existing for all users, should work without problems.

Seems like it will not start showing 8 different multiboards to each player. Im I right?
If so, I might wanna refactor the table and make one for all, yet more informative...
 
Status
Not open for further replies.
Top