• 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.

How do I show a multiboard for a certain player and not others?

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
Short answer is use GetLocalPlayer() to run the show action locally on the specific player's client.

Common problem people have is not noticing that GUI create actions automatically call show. Hence if one wants to create the multiboard with GUI one must first create all multiboard objects, then hide the last created multiboard, and then use GetLocalPlayer to show the multiboards to their appropriate players.
 
Level 12
Joined
Dec 2, 2016
Messages
733
Is it possible to display an entire leaderboard to just one player? Like could I make two separate leaderboards for each team? Or does it have to be the same leaderboard that everyone uses and display specific values locally?
 
Level 13
Joined
May 10, 2009
Messages
868
Both options are doable. The latter is tedious to maintain; Create 2 boards, each for a different team.

  • Example
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- ---- Teams ---- --------
      • -------- Humans --------
      • For each (Integer A) from 1 to 11, do (Actions)
        • Loop - Actions
          • Player Group - Add (Player((Integer A))) to TeamA
      • -------- Vampire --------
      • Player Group - Add (Player(12)) to TeamB
      • -------- Leaderboard --------
      • -------- Humans --------
      • Leaderboard - Create a leaderboard for TeamA titled Team A
      • Set BoardA = (Last created leaderboard)
      • Leaderboard - Add Player 1 (Red) to BoardA with label WHATEVER and value 0
      • -------- Vampire --------
      • Leaderboard - Create a leaderboard for TeamB titled Team B
      • Set BoardB = (Last created leaderboard)
      • Leaderboard - Add Player 12 (Brown) to BoardB with label N/A and value 0
 
Level 13
Joined
May 10, 2009
Messages
868
Multiboard is better as you can have many columns, icons, and even minimize it.

Leaderboard:
leader.jpg


Multiboard:
MB7.jpg


I got those screenshots shamelessly on google images.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
Is it possible to display an entire leaderboard to just one player? Like could I make two separate leaderboards for each team? Or does it have to be the same leaderboard that everyone uses and display specific values locally?
One can locally show entire multiboards. It is fairly common for maps to have 1 multiboard per player.

Mutating the same board locally can cause out of sync problems if one is not careful. Hence I do not recommend it unless you know about the inner workings of JASS.
 
Level 12
Joined
Dec 2, 2016
Messages
733
Okay, so this is what I have right now.

My goal is to if the RedPlayer variable is = to the local player then show the multiboard to the red player.

  • Red Multi
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Wait 3.00 seconds
      • Multiboard - Create a multiboard with 4 columns and ((Integer A) + 3) rows, titled |CFFFFFFFFGame time...
      • Set RedPlayerMulti = Player 1 (Red)
      • Custom script: if udg_RedPlayerMulti == GetLocalPlayer() then
      • Multiboard - Show (Last created multiboard)
      • Custom script: endif
But what's happening is it's showing for all players. Not sure how to make the multiboard local itself?

Edit: did it entirely with Jass and it's working now I think haha. Thanks.

btw if anyone reads this, Jass is so identical to Lua for me. Is there some sort of similarity between the both?
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
But what's happening is it's showing for all players. Not sure how to make the multiboard local itself?
I already explained...
Common problem people have is not noticing that GUI create actions automatically call show. Hence if one wants to create the multiboard with GUI one must first create all multiboard objects, then hide the last created multiboard, and then use GetLocalPlayer to show the multiboards to their appropriate players.
The GUI create is showing it for all players. You then show it for 1 player who it is already being shown to. What you want to do is create the multiboard, hide it for all players (standard hide action) and then use GetLocalPlayer to show it locally for red.
btw if anyone reads this, Jass is so identical to Lua for me. Is there some sort of similarity between the both?
JASS was likely based on the language basic. Seeing how it is one of the big old parent languages it likely has similarities to other languages. That said if you are a computer scientist most reasonably designed programming languages are pretty much the same.
 
Status
Not open for further replies.
Top