Show multiboard for only one player?

Status
Not open for further replies.
Level 7
Joined
May 11, 2010
Messages
278
Is there a way to have a multiboard only show for one specific player?

If no, is there antoher way to achieve the same functionality? I need some way to display numeric values to a player relating to use of their heroes abilities. The info should always be available and using game messages looks bad. I could use floating text but that tends to look... not very good.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,272
You should not change multiboards locally using GUI. If you want to do so (such that a field is different for each player) then you should use pure JASS. The reason is the GUI multiboard actions have a lot of overhead so might be prone to causing out of sync errors.

It is perfectly fine to display multiboards locally. You can update each player's multiboard globally (so it exists on all clients) however only show them the multiboard that is appropriate for them.

GetLocalPlayer will return the player value for the executing client. Since this is always different between clients it is not deterministic which is why it allows you to run code locally when used with flow control statements. If the code you run locally alters the deterministic state of the game, that client will go out of synchronization with other clients and he will no longer be able to play in the same session as the other clients (out of sync error).

For logical reasons GetLocalPlayer will only ever return currently active "human controlled" players. Neutral, AI and empty slots never have a client assigned to them so cannot ever be returned by GetLocalPlayer.
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
Make 12 multiboards.
Set them in an array.
Change whatever you want on each multiboard as each of them will be shown to a different player.

Hide the multiboards by default and use this:
loop
exitwhen i > 12
set p = Player(i)
if GetLocalPlayer() == p then
call ShowMultiboard(udg_MB_Array, true)
endif
set i = i + 1
endloop
(p and i are local variables of a player and an integer.)
 
Level 7
Joined
May 11, 2010
Messages
278
I know my way around GUI, but I can't JASS for the life of me. I'll try what Wietlol wrote when I've got the time and return if (or rather when, knowing my luck) I can't get it to work :p

You should not change multiboards locally using GUI. If you want to do so (such that a field is different for each player) then you should use pure JASS. The reason is the GUI multiboard actions have a lot of overhead so might be prone to causing out of sync errors.

But if I create one multiboard for each player and show the multiboards to only the relevant player, I should still be able to update it with GUI? Because then it will update for everyone but only show for one player anyways. Right?
 
Level 7
Joined
May 11, 2010
Messages
278
As expected, I did someting wrong but can't figure out what. I can't jass :eek:)

  • Custom script: call ShowMultiboard(udg_InfoBoard[TempInt], true)
I get the error "Expected a function name"

The rest of the trigger looks like this:
  • Actions
    • Set TempPlayer = (Owner of (Sold unit))
    • Set TempInt = (Player number of TempPlayer)
    • Multiboard - Create a multiboard with 2 columns and 1 rows, titled Ability Information
    • Multiboard - Hide (Last created multiboard)
    • Set InfoBoard[TempInt] = (Last created multiboard)
    • Custom script: if GetLocalPlayer() == udg_TempPlayer then
    • Custom script: call ShowMultiboard(udg_InfoBoard[TempInt], true)
    • Custom script: endif
 
Level 7
Joined
May 11, 2010
Messages
278
replace ShowMultiboard with MultiboardDisplay

Thanks!

  • Set localplayer = (Owner of (Triggering unit))
  • Custom script: if udg_localplayer == GetLocalPlayer() then
  • Multiboard - Hide ShipStatus[1]
  • Multiboard - Show CargoMultiboardSmall[1]
  • Custom script: endif
This is an example in GUI

I didn't realize you could actually do that. It makes sense now that you point it out, but I wouldn't have realized by myself :p
 
Status
Not open for further replies.
Top