Multiboard Problem

emootootoo

Top Banana
Reaction score
51
I made this rough bit of code to test out making a multiboard for each player, however it only displays a multiboard for player 1. All other players (2-10) do not ever get a multiboard. (The global mb array is an array of size 10)
JASS:

function Trig_Display_Actions takes nothing returns nothing
    local integer i = 9
    local integer rows
    loop
    exitwhen i<0
        set rows = 11
        set udg_mb<i>=CreateMultiboardBJ(2,rows,&quot;test&quot;)
        loop
        exitwhen rows == 0
            call MultiboardSetItemStyleBJ(udg_mb<i>,1,rows,true,false)
            call MultiboardSetItemStyleBJ(udg_mb<i>,2,rows,true,false)
            call MultiboardSetItemWidthBJ(udg_mb<i>,1,rows,8)
            call MultiboardSetItemWidthBJ(udg_mb<i>,2,rows,3)
            set rows = rows - 1
        endloop
        call MultiboardDisplay(udg_mb<i>, GetLocalPlayer() == Player(i)) 
        set i = i-1
    endloop
endfunction</i></i></i></i></i></i>


Anyone know where my logic is failing so I can show each player their unique multiboard?
 

Flare

Stops copies me!
Reaction score
662
JASS:
function Trig_Display_Actions takes nothing returns nothing
    local integer i = 9
    local integer rows
    loop
    exitwhen i&lt;0
        set rows = 11
        set udg_mb<i>=CreateMultiboardBJ(2,rows,&quot;test&quot;)
        loop
        exitwhen rows == 0
            call MultiboardSetItemStyleBJ(udg_mb<i>,1,rows,true,false)
            call MultiboardSetItemStyleBJ(udg_mb<i>,2,rows,true,false)
            call MultiboardSetItemWidthBJ(udg_mb<i>,1,rows,8)
            call MultiboardSetItemWidthBJ(udg_mb<i>,2,rows,3)
            set rows = rows - 1
        endloop
        call MultiboardDisplay(udg_mb<i>, false) 
        if GetLocalPlayer () == Player (i) then
               call MultiboardDisplay (udg_mb<i>, true)
        endif
        set i = i-1
    endloop
endfunction

</i></i></i></i></i></i></i>


Never used multiboards in JASS, but I assume the hide/show works the same as with texttags. Just hide it for all players, then check the local player and show it if GetLocalPlayer () == Player (i)
 

emootootoo

Top Banana
Reaction score
51
That's what I did :p (they are hidden by default)

JASS:
call MultiboardDisplay(udg_mb<i>, GetLocalPlayer() == Player(i)) </i>


I don't know why but it seems like it is using the same multiboard for every player somehow, which is why it is only being displayed to player 1 (the last person to have it displayed to them).

That shouldn't happen because I have created and set 10 multiboards into the array right?
 

emootootoo

Top Banana
Reaction score
51
... I just tested going both ways aswell, and it only worked from 9 to 0 as player 1, and I'm assuming with 0 to 9 if I was player 10 I would see it.

Edit: OK it seems like I just fixed it. Basically I changed it so that it only shows the local player the multiboard but doesn't hide it from the other players. This somehow made it all work on multiple players etc.


So in the end:
JASS:
function Trig_Display_Actions takes nothing returns nothing
    local integer i = 9
    local integer rows
    loop
    exitwhen i&lt;0
        set rows = 11
        set udg_mb<i>=CreateMultiboardBJ(2,rows,&quot;test&quot;)
        loop
        exitwhen rows == 0
            call MultiboardSetItemStyleBJ(udg_mb<i>,1,rows,true,false)
            call MultiboardSetItemStyleBJ(udg_mb<i>,2,rows,true,false)
            call MultiboardSetItemWidthBJ(udg_mb<i>,1,rows,8)
            call MultiboardSetItemWidthBJ(udg_mb<i>,2,rows,3)
            set rows = rows - 1
        endloop
        // Do not display false for the multiboard here
        if GetLocalPlayer () == Player (i) then
               call MultiboardDisplay (udg_mb<i>, true)
        endif
        set i = i-1
    endloop
endfunction</i></i></i></i></i></i>
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top