• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Local Multiboard Issues!

Status
Not open for further replies.
Level 5
Joined
Aug 8, 2012
Messages
154
Hey there!

So in my map each player has their own local multiboard which works fine, and shows them their own stats (kills, deaths, health, etc...).

However, I recently tried to make a different multiboard which can be accessed via the player pressing the Escape key. I used the same sort of GUI that I did for the other, and it works fine in single player, one multiboard replacing the other whenever the player presses escape.

Here is the trigger (without the value checking for kills, etc, being as that is not needed for the help):

  • Create leaderboard
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
      • Player - Player 2 (Blue) skips a cinematic sequence
      • Player - Player 3 (Teal) skips a cinematic sequence
      • Player - Player 4 (Purple) skips a cinematic sequence
    • Conditions
    • Actions
      • Set TP = (Triggering player)
      • Set TPU = (Player number of (Triggering player))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Leaderboardbool[TPU] Equal to False
        • Then - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Custom script: if GetPlayerSlotState(udg_TP) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(udg_TP) == MAP_CONTROL_USER then
              • Multiboard - Create a multiboard with 4 columns and 5 rows, titled WarZ Leaderboard:
              • Set Leaderboard[TPU] = (Last created multiboard)
              • Set Leaderboardbool[TPU] = True
              • Multiboard - Hide Leaderboard[TPU]
              • Multiboard - Set the display style for Leaderboard[TPU] item in column 1, row 1 to Show text and Hide icons
              • Multiboard - Set the display style for Leaderboard[TPU] item in column 1, row 2 to Show text and Show icons
              • Multiboard - Set the display style for Leaderboard[TPU] item in column 1, row 3 to Show text and Show icons
              • Multiboard - Set the display style for Leaderboard[TPU] item in column 1, row 4 to Show text and Show icons
              • Multiboard - Set the display style for Leaderboard[TPU] item in column 1, row 5 to Show text and Show icons
              • Multiboard - Set the display style for Leaderboard[TPU] item in column 2, row 0 to Show text and Hide icons
              • Multiboard - Set the display style for Leaderboard[TPU] item in column 3, row 0 to Show text and Hide icons
              • Multiboard - Set the display style for Leaderboard[TPU] item in column 4, row 0 to Show text and Hide icons
              • Multiboard - Set the icon for Leaderboard[TPU] item in column 1, row 2 to ReplaceableTextures\CommandButtons\BTNVillagerMan.blp
              • Multiboard - Set the icon for Leaderboard[TPU] item in column 1, row 3 to ReplaceableTextures\CommandButtons\BTNVillagerMan.blp
              • Multiboard - Set the icon for Leaderboard[TPU] item in column 1, row 4 to ReplaceableTextures\CommandButtons\BTNVillagerMan.blp
              • Multiboard - Set the icon for Leaderboard[TPU] item in column 1, row 5 to ReplaceableTextures\CommandButtons\BTNVillagerMan.blp
              • Multiboard - Set the width for Leaderboard[TPU] item in column 1, row 0 to 8.00% of the total screen width
              • Multiboard - Set the width for Leaderboard[TPU] item in column 2, row 0 to 6.00% of the total screen width
              • Multiboard - Set the width for Leaderboard[TPU] item in column 3, row 0 to 6.00% of the total screen width
              • Multiboard - Set the width for Leaderboard[TPU] item in column 4, row 0 to 6.00% of the total screen width
              • Multiboard - Set the color for Leaderboard[TPU] item in column 1, row 0 to (100.00%, 100.00%, 0.00%) with 0.00% transparency
              • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 1 to Survivor Name:
              • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 2 to (Name of Player 1 (Red))
              • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 3 to (Name of Player 2 (Blue))
              • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 2 to (Name of Player 3 (Teal))
              • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 2 to (Name of Player 4 (Purple))
              • Multiboard - Set the text for Leaderboard[TPU] item in column 2, row 1 to Z-Kills:
              • Multiboard - Set the text for Leaderboard[TPU] item in column 3, row 1 to Murders:
              • Multiboard - Set the text for Leaderboard[TPU] item in column 4, row 1 to Deaths:
              • Player Group - Add TP to PlayersPlaying
              • Trigger - Add to PlayerLeave <gen> the event (Player - p leaves the game)
              • Custom script: endif
          • Player Group - Pick every player in PlayersPlaying and do (Actions)
            • Loop - Actions
              • Set TP = (Picked player)
              • Set TPU = (Player number of (Picked player))
              • Custom script: if ConvertedPlayer(udg_TPU) == GetLocalPlayer() then
              • Multiboard - Show Leaderboard[TPU]
              • Custom script: endif
        • Else - Actions
          • Custom script: if ConvertedPlayer(udg_TPU) == GetLocalPlayer() then
          • Multiboard - Hide Leaderboard[TPU]
          • Multiboard - Show MB[TPU]
          • Set Leaderboardbool[TPU] = False
          • Custom script: endif
When more than one player accesses this multiboard, however, they are disconnected. This is most likely down the the GetLocalPlayer() in some way or another, but an almost identical trigger worked perfectly in multiplayer without issue.

Can anyone please tell me what I am doing wrong, and how to fix this so that each player can access the multiboard without disconnecting?

Cheers in advance!

P.S: Here is a demo map with just this trigger and the ones for the other multiboard that does work:

View attachment Multiboard testmap.w3x

Hope that helps!
Maldruzard
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Here
  • Set Leaderboardbool[TPU] = False
You're doing that inside a GetLocalPlayer() block, so, you're assigning a value to a Global Variable Array just for the local player. Local Player has the new value, te rest has the other value, on the same variable. Result = Desync.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Why don't you create both multiboard for players on sec 0.00, base them on player index (Table 1 = Player number. Table 2 = PlayerNumberx13) and then just hide/show them accodingly based on a boolean (Set Table1 = True if it's displayed, set it to false when the other is displayed)
 
Level 5
Joined
Aug 8, 2012
Messages
154
I moved the boolean out of the local player block and it is still desyncing... any way to fix it as it is or do I have to change it to the way you suggested?

Cheers!
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
You are creating a new multiboard every time a player press scape and the boolean is equal to false. It means that the other multiboard remains somewhere with tons of information as a huge leak. Destroying/Creating multiboard is just mad, when you can update them :)

I would suggest using the PlayerIndex and PlayerInde*20 to hold both of players multiboards (Table1, and Table2), and create a Boolean that tells you if the Table1 is shown. If it's true, set it to false and display the other, if it's false, hide Table2, show table1, and set it to true.

btw, (All Players) only returns User players wich are playing :) So, there's no need to check if the picked player is a user, and if it's playing.
 
Level 5
Joined
Aug 8, 2012
Messages
154
I don't suppose you would be able to create a lil' example trigger for me? Something is not being understood in my head for some reason D:

I also have no idea what those PlayerIndex things are, variables?

Cheers!
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
  • Create leaderboard
    • Events
      • Time - Elapsed game time is 0.00
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • set i = (Player number of (Picked Player))
          • Multiboard - Create a multiboard with 4 columns and 5 rows, titled WarZ Leaderboard:
          • Set Leaderboard[i] = (Last created multiboard)
          • Multiboard - Set the display style for Leaderboard[i] item in column 1, row 1 to Show text and Hide icons
          • Multiboard - Set the display style for Leaderboard[i] item in column 1, row 2 to Show text and Show icons
          • Multiboard - Set the display style for Leaderboard[i] item in column 1, row 3 to Show text and Show icons
          • Multiboard - Set the display style for Leaderboard[i] item in column 1, row 4 to Show text and Show icons
          • Multiboard - Set the display style for Leaderboard[i] item in column 1, row 5 to Show text and Show icons
          • Multiboard - Set the display style for Leaderboard[i] item in column 2, row 0 to Show text and Hide icons
          • Multiboard - Set the display style for Leaderboard[i] item in column 3, row 0 to Show text and Hide icons
          • Multiboard - Set the display style for Leaderboard[i] item in column 4, row 0 to Show text and Hide icons
          • Multiboard - Set the icon for Leaderboard[i] item in column 1, row 2 to ReplaceableTextures\CommandButtons\BTNVillagerMan.blp
          • Multiboard - Set the icon for Leaderboard[i] item in column 1, row 3 to ReplaceableTextures\CommandButtons\BTNVillagerMan.blp
          • Multiboard - Set the icon for Leaderboard[i] item in column 1, row 4 to ReplaceableTextures\CommandButtons\BTNVillagerMan.blp
          • Multiboard - Set the icon for Leaderboard[i] item in column 1, row 5 to ReplaceableTextures\CommandButtons\BTNVillagerMan.blp
          • Multiboard - Set the width for Leaderboard[i] item in column 1, row 0 to 8.00% of the total screen width
          • Multiboard - Set the width for Leaderboard[i] item in column 2, row 0 to 6.00% of the total screen width
          • Multiboard - Set the width for Leaderboard[i] item in column 3, row 0 to 6.00% of the total screen width
          • Multiboard - Set the width for Leaderboard[i] item in column 4, row 0 to 6.00% of the total screen width
          • Multiboard - Set the color for Leaderboard[i] item in column 1, row 0 to (100.00%, 100.00%, 0.00%) with 0.00% transparency
          • Multiboard - Set the text for Leaderboard[i] item in column 1, row 1 to Survivor Name:
          • Multiboard - Set the text for Leaderboard[i] item in column 1, row 2 to (Name of Player 1 (Red))
          • Multiboard - Set the text for Leaderboard[i] item in column 1, row 3 to (Name of Player 2 (Blue))
          • Multiboard - Set the text for Leaderboard[i] item in column 1, row 2 to (Name of Player 3 (Teal))
          • Multiboard - Set the text for Leaderboard[i] item in column 1, row 2 to (Name of Player 4 (Purple))
          • Multiboard - Set the text for Leaderboard[i] item in column 2, row 1 to Z-Kills:
          • Multiboard - Set the text for Leaderboard[i] item in column 3, row 1 to Murders:
          • Multiboard - Set the text for Leaderboard[i] item in column 4, row 1 to Deaths:
          • Multiboard - Minimize Leaderboard[i]
          • Multiboard - Maximize [LeaderBoard[i]
          • Set BoardBool[i] = True
          • Trigger - Add to PlayerLeave <gen> the event (Player - (Picked Player) leaves the game)
          • set i = (i+15)
          • --------- Create your other Multiboard here for the same player -------
          • Blah blah blah
          • Set Leaderboard[i] = (Last created multiboard)
      • Multiboard - Hide all multiboards
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: if GetLocalPlayer() == Player(bj_forLoopAIndex+1) then
          • Multiboard - Show Leaderboard[(Integer A)]
          • Multiboard - Maximize Leaderboard[(Integer A)]
          • Custom script: endif
To display the other multiboard

  • Untitled Trigger 002
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • set p = (Triggering Player)
      • set i = (Player number of p)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BoardBool[i] = True
        • Then - Actions
          • Set BoardBool[i] = False
          • Custom script: if GetLocalPlayer() == udg_p then
          • Multiboard - Hide Leaderboard[i]
          • Multiboard - Show Leaderboard[i+15]
          • Multiboard - Maximize Leaderboard[i+15]
          • Custom script: endif
        • Else - Actions
          • Set BoardBool[i] = True
          • Custom script: if GetLocalPlayer() == udg_p then
          • Multiboard - Hide Leaderboard[i+15]
          • Multiboard - Show Leaderboard[i]
          • Multiboard - Maximize Leaderboard[i]
          • Custom script: endif
 
Last edited:
Level 5
Joined
Aug 8, 2012
Messages
154
In the first trigger you set both multiboards as the same variable and thus the second trigger is rather confusing to me... Are they both supposed to be saved to the same variable? :S

My triggers currently:

  • Leaderboard create
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set TPU = (Player number of (Picked player))
          • Multiboard - Create a multiboard with 4 columns and 5 rows, titled WarZ Leaderboard:
          • Set Leaderboard[TPU] = (Last created multiboard)
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 1, row 1 to Show text and Hide icons
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 1, row 2 to Show text and Show icons
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 1, row 3 to Show text and Show icons
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 1, row 4 to Show text and Show icons
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 1, row 5 to Show text and Show icons
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 2, row 0 to Show text and Hide icons
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 3, row 0 to Show text and Hide icons
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 4, row 0 to Show text and Hide icons
          • Multiboard - Set the icon for Leaderboard[TPU] item in column 1, row 2 to ReplaceableTextures\CommandButtons\BTNVillagerMan.blp
          • Multiboard - Set the icon for Leaderboard[TPU] item in column 1, row 3 to ReplaceableTextures\CommandButtons\BTNVillagerMan.blp
          • Multiboard - Set the icon for Leaderboard[TPU] item in column 1, row 4 to ReplaceableTextures\CommandButtons\BTNVillagerMan.blp
          • Multiboard - Set the icon for Leaderboard[TPU] item in column 1, row 5 to ReplaceableTextures\CommandButtons\BTNVillagerMan.blp
          • Multiboard - Set the width for Leaderboard[TPU] item in column 1, row 0 to 8.00% of the total screen width
          • Multiboard - Set the width for Leaderboard[TPU] item in column 2, row 0 to 6.00% of the total screen width
          • Multiboard - Set the width for Leaderboard[TPU] item in column 3, row 0 to 6.00% of the total screen width
          • Multiboard - Set the width for Leaderboard[TPU] item in column 4, row 0 to 6.00% of the total screen width
          • Multiboard - Set the color for Leaderboard[TPU] item in column 1, row 0 to (100.00%, 100.00%, 0.00%) with 0.00% transparency
          • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 1 to Survivor Name:
          • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 2 to (Name of Player 1 (Red))
          • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 3 to (Name of Player 2 (Blue))
          • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 2 to (Name of Player 3 (Teal))
          • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 2 to (Name of Player 4 (Purple))
          • Multiboard - Set the text for Leaderboard[TPU] item in column 2, row 1 to Z-Kills:
          • Multiboard - Set the text for Leaderboard[TPU] item in column 3, row 1 to Murders:
          • Multiboard - Set the text for Leaderboard[TPU] item in column 4, row 1 to Deaths:
          • Set Leaderboardbool[TPU] = True
          • Set TPU = (TPU + 15)
          • -------- --- --------
          • Multiboard - Create a multiboard with 2 columns and 4 rows, titled WarZ Killboard
          • Set MB[TPU] = (Last created multiboard)
          • Multiboard - Set the display style for MB[TPU] item in column 0, row 0 to Show text and Hide icons
          • Multiboard - Set the width for MB[TPU] item in column 1, row 0 to 6.00% of the total screen width
          • Multiboard - Set the width for MB[TPU] item in column 2, row 0 to 3.00% of the total screen width
          • Multiboard - Set the color for MB[TPU] item in column 1, row 0 to (100.00%, 100.00%, 0.00%) with 0.00% transparency
          • Multiboard - Set the text for MB[TPU] item in column 1, row 1 to Z-Kills:
          • Multiboard - Set the text for MB[TPU] item in column 1, row 2 to Murders:
          • Multiboard - Set the text for MB[TPU] item in column 1, row 3 to Deaths:
          • Multiboard - Set the text for MB[TPU] item in column 1, row 4 to Blood:
          • Multiboard - Set the text for MB[TPU] item in column 2, row 0 to 0
      • Multiboard - Hide all multiboards
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Custom script: if GetLocalPlayer() == Player(bj_forLoopAIndex+1) then
          • Multiboard - Show MB[(Integer A)]
          • Multiboard - Maximize MB[(Integer A)]
          • Custom script: endif
  • Leaderboard show
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
      • Player - Player 2 (Blue) skips a cinematic sequence
      • Player - Player 3 (Teal) skips a cinematic sequence
      • Player - Player 4 (Purple) skips a cinematic sequence
    • Conditions
    • Actions
      • Set p = (Picked player)
      • Set TPU = (Player number of p)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Leaderboardbool[i] Equal to True
        • Then - Actions
          • Custom script: if GetLocalPlayer() == udg_p then
          • Multiboard - Hide MB[TPU]
          • Multiboard - Show Leaderboard[(TPU + 15)]
          • Custom script: endif
        • Else - Actions
          • Custom script: if GetLocalPlayer() == udg_p then
          • Multiboard - Hide Leaderboard[(TPU + 15)]
          • Multiboard - Show MB[TPU]
          • Custom script: endif
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
In the first trigger I created the multiboard based on i, wich is the player number of the player. Then, i increase "i" by 15 (set i = i+15) and create the other multiboard based on i (wich now is player number+15).

After creating all the multiboards for each player, I hide them all, and them, from 1 to 12 (in the loop) show the Leaderboar[Integer A] means, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, and 12 (wich are the player numbers). Means that, by default, the first table, the one based on the player number is shown. And I set "True" the boolean based on the player number (BoardBool = True) wich means that the Board #1 (based on the Player number) is being shown.

When the player presses escape, I check if the Board#1 is being shown (by checking if BoardBool is true). If it's, I hide the Board#1 and show the Board#2 (wich is based on player number+15). If BoardBool is false, means that the Board#1 is hidden, and Board#2 is being shown, so I hide Board#2 (based on player number+15) and show Board#1 (based on player number)

Example:
Player 1 number is 1
It's first Leaderboard will be Leaderboard[1]
It's second leaderboard will be Leaderboard[1+15] wich is Leaderboard[16]

Player 2 number is 2
It's first Leaderboard will be Leaderboard[2]
It's second leaderboard will be Leaderboard[2+15] wich is Leaderboard[17]

and so on...

<< EDIT >>

I just noticed I never set BoardBool = false. I already edited the main trigger i gave you with the correction.
 
Level 5
Joined
Aug 8, 2012
Messages
154
I have attached my map to this comment, as it is still not working for some reason! D: 'TPU' is just a different integer btw, instead of 'i'.

The triggers are under the 'Multiboard (help)' trigger folder at the bottom of the list; ignore the disabled ones, those are the old ones that didn't work, I am keeping them there just in case I need them.


Cheers!
 
Last edited:
Level 20
Joined
Jul 14, 2011
Messages
3,213
When you create your first Table you do this
  • Set Leaderboard[TPU] = (Last created multiboard)
When you create the second one, you do this
  • Set MB[TPU] = (Last created multiboard)
Then, it doesn't work, because you're handling 2 differente multiboard variables, when you shoukd only work with 1. Replace Leaderboard variable with MB, or replace MB with Leaderboard.

I mean, this could work either way :) But you don't need 2 Multiboard Arrays when you can perfectly work with one.

All your current MB[TPU] should be Leaderboard[TPU+15]
 
Level 5
Joined
Aug 8, 2012
Messages
154
  • Leaderboard create
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set TPU = (Player number of (Picked player))
          • Multiboard - Create a multiboard with 4 columns and 5 rows, titled WarZ Leaderboard:
          • Set Leaderboard[TPU] = (Last created multiboard)
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 1, row 1 to Show text and Hide icons
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 1, row 2 to Show text and Show icons
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 1, row 3 to Show text and Show icons
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 1, row 4 to Show text and Show icons
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 1, row 5 to Show text and Show icons
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 2, row 0 to Show text and Hide icons
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 3, row 0 to Show text and Hide icons
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 4, row 0 to Show text and Hide icons
          • Multiboard - Set the icon for Leaderboard[TPU] item in column 1, row 2 to ReplaceableTextures\CommandButtons\BTNVillagerMan.blp
          • Multiboard - Set the icon for Leaderboard[TPU] item in column 1, row 3 to ReplaceableTextures\CommandButtons\BTNVillagerMan.blp
          • Multiboard - Set the icon for Leaderboard[TPU] item in column 1, row 4 to ReplaceableTextures\CommandButtons\BTNVillagerMan.blp
          • Multiboard - Set the icon for Leaderboard[TPU] item in column 1, row 5 to ReplaceableTextures\CommandButtons\BTNVillagerMan.blp
          • Multiboard - Set the width for Leaderboard[TPU] item in column 1, row 0 to 8.00% of the total screen width
          • Multiboard - Set the width for Leaderboard[TPU] item in column 2, row 0 to 6.00% of the total screen width
          • Multiboard - Set the width for Leaderboard[TPU] item in column 3, row 0 to 6.00% of the total screen width
          • Multiboard - Set the width for Leaderboard[TPU] item in column 4, row 0 to 6.00% of the total screen width
          • Multiboard - Set the color for Leaderboard[TPU] item in column 1, row 0 to (100.00%, 100.00%, 0.00%) with 0.00% transparency
          • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 1 to Survivor Name:
          • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 2 to (Name of Player 1 (Red))
          • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 3 to (Name of Player 2 (Blue))
          • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 2 to (Name of Player 3 (Teal))
          • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 2 to (Name of Player 4 (Purple))
          • Multiboard - Set the text for Leaderboard[TPU] item in column 2, row 1 to Z-Kills:
          • Multiboard - Set the text for Leaderboard[TPU] item in column 3, row 1 to Murders:
          • Multiboard - Set the text for Leaderboard[TPU] item in column 4, row 1 to Deaths:
          • Set Leaderboardbool[TPU] = True
          • Set TPU = (TPU + 15)
          • -------- --- --------
          • Multiboard - Create a multiboard with 2 columns and 4 rows, titled WarZ Killboard
          • Set Leaderboard[TPU] = (Last created multiboard)
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 0, row 0 to Show text and Hide icons
          • Multiboard - Set the width for Leaderboard[TPU] item in column 1, row 0 to 6.00% of the total screen width
          • Multiboard - Set the width for Leaderboard[TPU] item in column 2, row 0 to 3.00% of the total screen width
          • Multiboard - Set the color for Leaderboard[TPU] item in column 1, row 0 to (100.00%, 100.00%, 0.00%) with 0.00% transparency
          • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 1 to Z-Kills:
          • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 2 to Murders:
          • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 3 to Deaths:
          • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 4 to Blood:
          • Multiboard - Set the text for Leaderboard[TPU] item in column 2, row 0 to 0
      • Multiboard - Hide all multiboards
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Custom script: if GetLocalPlayer() == Player(bj_forLoopAIndex+1) then
          • Multiboard - Show Leaderboard[(Integer A)]
          • Multiboard - Maximize Leaderboard[(Integer A)]
          • Custom script: endif
  • Leaderboard show
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
      • Player - Player 2 (Blue) skips a cinematic sequence
      • Player - Player 3 (Teal) skips a cinematic sequence
      • Player - Player 4 (Purple) skips a cinematic sequence
    • Conditions
    • Actions
      • Set p = (Picked player)
      • Set TPU = (Player number of p)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Leaderboardbool[TPU] Equal to True
        • Then - Actions
          • Set Leaderboardbool[TPU] = False
          • Custom script: if GetLocalPlayer() == udg_p then
          • Multiboard - Hide Leaderboard[TPU]
          • Multiboard - Show Leaderboard[(TPU + 15)]
          • Custom script: endif
        • Else - Actions
          • Set Leaderboardbool[TPU] = True
          • Custom script: if GetLocalPlayer() == udg_p then
          • Multiboard - Hide Leaderboard[(TPU + 15)]
          • Multiboard - Show Leaderboard[TPU]
          • Custom script: endif
Still not functional ingame :(
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Hmmm.. I think I know.

Try removing the +1 from this script. It should work.
  • Custom script: if GetLocalPlayer() == Player(bj_forLoopAIndex+1) then
If it doesn't work, then loop from 0 to 3, instead of from 1 to 4.

<< EDIT >>

Try to be precise when you say it doesn't work. It doesn't display? It still desync? There are evil clowns running around your screen when you test?...
 
Level 5
Joined
Aug 8, 2012
Messages
154
Still no :L If you have the map, is any of this working for you? :(

There are evil clowns... and also it just doesn't show up at all, nor does the other MB appear when I press Esc. Nothing happens at all :(
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Lol about the evil clowns xD MY computer takes about 1 minute to save and test your map. It's a pain in the ass. You should work your systems in another map, and then import.

I'm testing to check what the problem is.

<< EDIT >>

It's funny how some dumb stuff can crack our heads off...

The following trigger had something related to Hide all Multiboards, or creating a multiboard when another one was already being shown, I don't know. I just minimized them after creating, and hid them before creating the next one.

I also used the p variable in the loop, because I was getting confused with the player number.

  • Leaderboard create
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set TPU = (Player number of (Picked player))
          • Multiboard - Create a multiboard with 4 columns and 5 rows, titled WarZ Leaderboard:
          • Set Leaderboard[TPU] = (Last created multiboard)
          • Set Leaderboardbool[TPU] = True
          • Multiboard - Minimize Leaderboard[TPU]
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 1, row 1 to Show text and Hide icons
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 1, row 2 to Show text and Show icons
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 1, row 3 to Show text and Show icons
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 1, row 4 to Show text and Show icons
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 1, row 5 to Show text and Show icons
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 2, row 0 to Show text and Hide icons
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 3, row 0 to Show text and Hide icons
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 4, row 0 to Show text and Hide icons
          • Multiboard - Set the icon for Leaderboard[TPU] item in column 1, row 2 to ReplaceableTextures\CommandButtons\BTNVillagerMan.blp
          • Multiboard - Set the icon for Leaderboard[TPU] item in column 1, row 3 to ReplaceableTextures\CommandButtons\BTNVillagerMan.blp
          • Multiboard - Set the icon for Leaderboard[TPU] item in column 1, row 4 to ReplaceableTextures\CommandButtons\BTNVillagerMan.blp
          • Multiboard - Set the icon for Leaderboard[TPU] item in column 1, row 5 to ReplaceableTextures\CommandButtons\BTNVillagerMan.blp
          • Multiboard - Set the width for Leaderboard[TPU] item in column 1, row 0 to 8.00% of the total screen width
          • Multiboard - Set the width for Leaderboard[TPU] item in column 2, row 0 to 6.00% of the total screen width
          • Multiboard - Set the width for Leaderboard[TPU] item in column 3, row 0 to 6.00% of the total screen width
          • Multiboard - Set the width for Leaderboard[TPU] item in column 4, row 0 to 6.00% of the total screen width
          • Multiboard - Set the color for Leaderboard[TPU] item in column 1, row 0 to (100.00%, 100.00%, 0.00%) with 0.00% transparency
          • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 1 to Survivor Name:
          • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 2 to (Name of Player 1 (Red))
          • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 3 to (Name of Player 2 (Blue))
          • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 2 to (Name of Player 3 (Teal))
          • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 2 to (Name of Player 4 (Purple))
          • Multiboard - Set the text for Leaderboard[TPU] item in column 2, row 1 to Z-Kills:
          • Multiboard - Set the text for Leaderboard[TPU] item in column 3, row 1 to Murders:
          • Multiboard - Set the text for Leaderboard[TPU] item in column 4, row 1 to Deaths:
          • Multiboard - Hide Leaderboard[TPU]
          • Set TPU = (TPU + 15)
          • -------- --- --------
          • Multiboard - Create a multiboard with 2 columns and 4 rows, titled WarZ Killboard
          • Set Leaderboard[TPU] = (Last created multiboard)
          • Multiboard - Minimize Leaderboard[TPU]
          • Multiboard - Set the display style for Leaderboard[TPU] item in column 0, row 0 to Show text and Hide icons
          • Multiboard - Set the width for Leaderboard[TPU] item in column 1, row 0 to 6.00% of the total screen width
          • Multiboard - Set the width for Leaderboard[TPU] item in column 2, row 0 to 3.00% of the total screen width
          • Multiboard - Set the color for Leaderboard[TPU] item in column 1, row 0 to (100.00%, 100.00%, 0.00%) with 0.00% transparency
          • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 1 to Z-Kills:
          • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 2 to Murders:
          • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 3 to Deaths:
          • Multiboard - Set the text for Leaderboard[TPU] item in column 1, row 4 to Blood:
          • Multiboard - Set the text for Leaderboard[TPU] item in column 2, row 0 to 0
          • Multiboard - Hide Leaderboard[TPU]
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Set p = (Player((Integer A)))
          • Custom script: if GetLocalPlayer() == udg_p then
          • Multiboard - Show Leaderboard[(Integer A)]
          • Multiboard - Maximize Leaderboard[(Integer A)]
          • Custom script: endif
Now, this one is the dumbest. p was equal to (Picked Player) and should be (Triggering Player). That's why it wasn't working You were also checking If LeaderBool was true, and should be Leaderbool[TPU].
  • Leaderboard show
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
      • Player - Player 2 (Blue) skips a cinematic sequence
      • Player - Player 3 (Teal) skips a cinematic sequence
      • Player - Player 4 (Purple) skips a cinematic sequence
    • Conditions
    • Actions
      • Set p = (Triggering player)
      • Set TPU = (Player number of p)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Leaderboardbool[TPU] Equal to True
        • Then - Actions
          • Set Leaderboardbool[TPU] = False
          • Custom script: if GetLocalPlayer() == udg_p then
          • Multiboard - Hide Leaderboard[TPU]
          • Multiboard - Show Leaderboard[(TPU + 15)]
          • Custom script: endif
        • Else - Actions
          • Set Leaderboardbool[TPU] = True
          • Custom script: if GetLocalPlayer() == udg_p then
          • Multiboard - Hide Leaderboard[(TPU + 15)]
          • Multiboard - Show Leaderboard[TPU]
          • Custom script: endif
Everything works now as intended. I tested it all.
 
Level 5
Joined
Aug 8, 2012
Messages
154
D'oh! Thanks, it works now, just gotta check it for desync and then all shall be good!

For some reason it isnt updating the values properly ingame, but I'm sure I can handle that... hopefully ;L

Edit: Have to spread some rep before repping you again apparently :(
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Well, updating multiboard every 0.2 seconds is not ok. The best would be updating just the value that changes, when it changes, in the board that changes.
 
Level 5
Joined
Aug 8, 2012
Messages
154
Does the updating of stats for the 'Killboard' one have to use Locals due to it being information specifically for that player?
 
Level 5
Joined
Aug 8, 2012
Messages
154
So... I changed the updating tactic, an' all that jazz, and it doesn't desync now - huzzah!

However, for some reason it still only seems to be updating one multiboard (tested it with my laptop over LAN), like if one survivor gets a kill, it gives one player a random murder, and that random player is the one who gets his MB updated, the rest of the people don't get updates at all. Not sure why!

Have uploaded a (smaller) test map just with the triggers and object data:

View attachment Test MB Map.w3x

Is there anything wrong with the trigger? D:
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Your test map is nuts. Don't you even think about doing it that way in your map. 4 Triggers, one for each player? That's mad. Create one trigger, detect the player number of the player involved, and you're done.
  • Murder Copy 2
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Dying unit)) Equal to Survivor
          • (Owner of (Killing unit)) Equal to Player 3 (Teal)
        • Then - Actions
          • Set murder1[3] = (murder1[3] + 1)
          • Multiboard - Set the text for Leaderboard[(TPU + 15)] item in column 2, row 2 to (String(murder1[4]))
          • Multiboard - Set the text for Leaderboard[TPU] item in column 3, row 4 to (String(murder1[3]))
        • Else - Actions
Turns into
  • Murder Copy
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Dying unit)) Equal to Survivor
        • Then - Actions
          • Set TPU = (Player number of (Owner of (Killing unit)))
          • Set murder1[TPU] = (murder1[TPU] + 1)
          • Multiboard - Set the text for Leaderboard[(TPU + 15)] item in column 2, row 2 to (String(murder1[TPU]))
          • Multiboard - Set the text for Leaderboard[TPU] item in column 3, row 3 to (String(murder1[TPU]))
        • Else - Actions
And works for everybody.

  • Blood
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set TPU = (Player number of (Picked player))
          • Set Blood[1] = (Integer((Life of play1cam)))
          • Set Blood[2] = (Integer((Life of play2cam)))
          • Set Blood[3] = (Integer((Life of play3cam)))
          • Set Blood[4] = (Integer((Life of play4cam)))
          • Multiboard - Set the text for Leaderboard[(TPU + 15)] item in column 2, row 4 to (String(Blood[TPU]))
Have you noticed that, In all your triggers, you never Update TPU to the Player Number of the owner of the unit involved in that trigger?

If you're not going to store the integer through the whole game, you can use the same integer variable for all of those wich are instant.
 
Level 5
Joined
Aug 8, 2012
Messages
154
I shall try that! The reason that it was like that to begin with is that the multiboard was one of my first things to trigger (and for my first ever map) so I ended up with a lot of useless triggers and repeats etc due to not knowing about arrays :)
 
Level 5
Joined
Aug 8, 2012
Messages
154
Alas, the problem is that I want everyone's data to update on the 'leaderboard' multiboard, but it can be personally accessed by anyone at any time without disrupting other players in any way. This current way works fine to show one's own stats, but only one's own, not other players.

Here's what it looks like so far:

View attachment Test MB Map.w3x

So is there a way I can change this so it updates everyone's 'leaderboard' MB with everyone's K/D/etc... while still keeping it local?

Cheers!
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
  • Blood
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set Blood[1] = (Integer((Life of play1cam)))
      • Set Blood[2] = (Integer((Life of play2cam)))
      • Set Blood[3] = (Integer((Life of play3cam)))
      • Set Blood[4] = (Integer((Life of play4cam)))
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set TPU = (Player number of (Picked player))
          • Multiboard - Set the text for Leaderboard[(TPU + 15)] item in column 2, row 4 to (String(Blood[TPU]))
Else, you would be updating those 4 variables to the same value for every player in the Player group.

As long as every player multiboard retrieves the data from other players, all the information should be displayed already.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Don't worry. You'll get the hang of it.

I suggest you to start learning JASS.

Create Simple Triggers with one or two actions, convert them to custom script, and see where the actions are, where the events are, the the conditions are, and how can you remove BJ's (if there's any) or how can you improve the coding :) Then start using locals or custom functions :D
 
Status
Not open for further replies.
Top