• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Creating a mutiboard to show for 1 player?

Status
Not open for further replies.
Level 11
Joined
Nov 1, 2008
Messages
828
Alright, i have created it but it just does not show? Is there something i am doing wrong?

  • MuitiBoard
    • Events
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 3 columns and 2 rows, titled Game Menu:
      • Set Game_Menu_Kodotag[1] = (Last created multiboard)
      • Set Player = Player 1 (Red)
      • Custom script: if GetLocalPlayer() == udg_Player then
      • Multiboard - Set the text for Game_Menu_Kodotag[1] item in column 1, row 1 to |cFFFF0000Game:|r
      • Multiboard - Set the text for Game_Menu_Kodotag[1] item in column 2, row 1 to Current_Game
      • Multiboard - Set the text for Game_Menu_Kodotag[1] item in column 1, row 2 to |cFFFF0000Deaths:|r
      • Multiboard - Set the text for Game_Menu_Kodotag[1] item in column 2, row 2 to (|cFFFF0000 + (String(Score_Kodotag_Deaths[1])))
      • Multiboard - Set the text for Game_Menu_Kodotag[1] item in column 1, row 3 to |cFFFF0000Kills:|r
      • Multiboard - Set the text for Game_Menu_Kodotag[1] item in column 2, row 3 to (|cFFFF0000 + (String(Score_Kodotag_Kills[1])))
      • Multiboard - Set the text for Game_Menu_Kodotag[1] item in column 1, row 4 to |cFFFF0000Gold acqu...
      • Multiboard - Set the text for Game_Menu_Kodotag[1] item in column 2, row 4 to (|cffffcc00 + (String(Score_Kodotag_Gold[1])))
      • Multiboard - Set the text for Game_Menu_Kodotag[1] item in column 1, row 5 to |cFFFF0000Structure...
      • Multiboard - Set the text for Game_Menu_Kodotag[1] item in column 2, row 5 to (|cffffcc00 + (String(Score_Kodotag_Structures[1])))
      • Multiboard - Show (Last created multiboard)
      • Multiboard - Set the display style for Game_Menu_Kodotag[1] item in column 1, row 1 to Show text and Hide icons
      • Multiboard - Set the display style for Game_Menu_Kodotag[1] item in column 1, row 2 to Show text and Hide icons
      • Multiboard - Set the display style for Game_Menu_Kodotag[1] item in column 2, row 1 to Show text and Hide icons
      • Multiboard - Set the display style for Game_Menu_Kodotag[1] item in column 2, row 2 to Show text and Hide icons
      • Multiboard - Set the display style for Game_Menu_Kodotag[1] item in column 3, row 1 to Show text and Hide icons
      • Multiboard - Set the display style for Game_Menu_Kodotag[1] item in column 3, row 2 to Show text and Hide icons
      • Multiboard - Set the display style for Game_Menu_Kodotag[1] item in column 4, row 1 to Show text and Hide icons
      • Multiboard - Set the display style for Game_Menu_Kodotag[1] item in column 4, row 2 to Show text and Hide icons
      • Multiboard - Set the display style for Game_Menu_Kodotag[1] item in column 5, row 1 to Show text and Hide icons
      • Multiboard - Set the display style for Game_Menu_Kodotag[1] item in column 5, row 2 to Show text and Hide icons
      • Multiboard - Set the width for Game_Menu_Kodotag[1] item in column 1, row 1 to 6.00% of the total screen width
      • Multiboard - Set the width for Game_Menu_Kodotag[1] item in column 2, row 1 to 6.00% of the total screen width
      • Multiboard - Set the width for Game_Menu_Kodotag[1] item in column 1, row 2 to 6.00% of the total screen width
      • Multiboard - Set the width for Game_Menu_Kodotag[1] item in column 2, row 2 to 6.00% of the total screen width
      • Multiboard - Set the width for Game_Menu_Kodotag[1] item in column 1, row 3 to 6.00% of the total screen width
      • Multiboard - Set the width for Game_Menu_Kodotag[1] item in column 2, row 3 to 6.00% of the total screen width
      • Multiboard - Set the width for Game_Menu_Kodotag[1] item in column 1, row 4 to 6.00% of the total screen width
      • Multiboard - Set the width for Game_Menu_Kodotag[1] item in column 2, row 4 to 6.00% of the total screen width
      • Multiboard - Set the width for Game_Menu_Kodotag[1] item in column 1, row 5 to 6.00% of the total screen width
      • Multiboard - Set the width for Game_Menu_Kodotag[1] item in column 2, row 5 to 6.00% of the total screen width
      • Multiboard - Minimize (Last created multiboard)
      • Multiboard - Maximize (Last created multiboard)
      • Custom script: endif
      • -------- ================================= --------
      • -------- ================================= --------
      • Custom script: if ( GetLocalPlayer() == Player(1) ) then
      • Multiboard - Show Game_Menu_Kodotag[2]
      • Custom script: endif
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Perhaps ?
Try make it a non-array variable and proceed with the same method.

I've had this "array" problem when experimenting with Unit Group with an enabled array.
It won't work since you have to initialize it by set udg_UnitGroup[index] = CreateGroup() first before it is there.

But that is Unit Group, don't know for Multiboards.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Are you perhaps already displaying a different multiboard to the player that needs to see this multiboard?
Because only one multiboard can be displayed at a time.

Also, please use Show Game_Menu_Kodotag[1] instead of Show (Last Created Multiboard) just in case bj_lastCreatedMultiboard gets overridden...

But that is Unit Group, don't know for Multiboards.

He already did that by using this BJ inside GUI:

JASS:
function CreateMultiboardBJ takes integer cols, integer rows, string title returns multiboard
    set bj_lastCreatedMultiboard = CreateMultiboard()
    call MultiboardSetRowCount(bj_lastCreatedMultiboard, rows)
    call MultiboardSetColumnCount(bj_lastCreatedMultiboard, cols)
    call MultiboardSetTitleText(bj_lastCreatedMultiboard, title)
    call MultiboardDisplay(bj_lastCreatedMultiboard, true)
    return bj_lastCreatedMultiboard
endfunction

Also, I find it rather strange that MultiboardDisplay is being called within this BJ since at creation the board should not be displayed.
It will however be displayed after using the following BJ:

JASS:
call MultiboardDisplayBJ( true, GetLastCreatedMultiboard() )

Which is odd because this BJ simply does:

JASS:
function MultiboardDisplayBJ takes boolean show, multiboard mb returns nothing
    call MultiboardDisplay(mb, show)
endfunction


EDIT: Aztec_devil2000 are you sure that
  • Multiboard - Show Game_Menu_Kodotag[2]
will work? I don't see any multiboard being created for that index :/
 
Level 11
Joined
Nov 1, 2008
Messages
828
Are you perhaps already displaying a different multiboard to the player that needs to see this multiboard?
Because only one multiboard can be displayed at a time.
Ahh, there is infact a global multiboard before this, i do hide that one though. Unless there needs to be more time from switching boards?


EDIT: Aztec_devil2000 are you sure that

Multiboard - Show Game_Menu_Kodotag[2]

will work? I don't see any multiboard being created for that index :/
At the moment the multiboard for player 1 doesn't work, so no point creating 1 for 2.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Ahh, there is infact a global multiboard before this, i do hide that one though. Unless there needs to be more time from switching boards?
No, that's fine. I guess there must be something else going on :(


At the moment the multiboard for player 1 doesn't work, so no point creating 1 for 2.

What about moving down the show multibaord action underneath all the set display styles and widths (not that it matters though).
You have already tried removing the local block as defskul suggested?
 
Level 11
Joined
Nov 1, 2008
Messages
828
You have already tried removing the local block as defskul suggested?

I have tried without "Show Player 1 only". Still didn't work.

Edit: Damn, the problem was alil obvouis after i know your not allowed to have 2 muitiboards. When it runs the trigger, it hides the other board after it runs the trigger. But thanks for the help, i wouldn't have gotten this far without yous.
 
Level 13
Joined
Sep 13, 2010
Messages
550
I must tell you that you WILL make desync with your current trigger. GetLocalPlayer custom script block should only contain the multiboard display.
Why? Simple.

JASS:
function MultiboardSetItemValueBJ takes multiboard mb, integer col, integer row, string val returns nothing
    local integer curRow = 0
    local integer curCol = 0
    local integer numRows = MultiboardGetRowCount(mb)
    local integer numCols = MultiboardGetColumnCount(mb)
    local multiboarditem mbitem = null
    // Loop over rows, using 1-based index
    loop
        set curRow = curRow + 1
        exitwhen curRow > numRows
        // Apply setting to the requested row, or all rows (if row is 0)
        if (row == 0 or row == curRow) then
            // Loop over columns, using 1-based index
            set curCol = 0
            loop
                set curCol = curCol + 1
                exitwhen curCol > numCols
                // Apply setting to the requested column, or all columns (if col is 0)
                if (col == 0 or col == curCol) then
                    set mbitem = MultiboardGetItem(mb, curRow - 1, curCol - 1) // Because of this!
                    call MultiboardSetItemValue(mbitem, val)
                    call MultiboardReleaseItem(mbitem)
                endif
            endloop
        endif
    endloop
endfunction
And local multiboarditem mbitem is a handletype multiboarditem extends handle. Except floating texts( texttags ) no handle can be created in local blocks. Also it will still not work properly with displaying the multiboards except if you not hide all multiboard at the end and display them one by one or make the multiboard creating with custom scripts. Since GUI's Create multiboard command displays the created multiboard, you have to do that other way.

It should look like this:
  • MuitiBoard
    • Events
    • Conditions
    • Actions
      • Custom script: set udg_Game_Menu_Kodotag[1] = CreateMultiboard( )
      • Multiboard - Change the number of rows for Game_Menu_Kodotag[1] to 2
      • Multiboard - Change the number of columns for Game_Menu_Kodotag[1] to 3
      • Set Player = Player 1 (Red)
      • -------- Custom script: if GetLocalPlayer() == udg_Player then <- this is now removed --------
      • -------- Your scripts here --------
      • -------- Custom script: endif --------
      • -------- ================================= --------
      • -------- ================================= --------
      • Custom script: if ( GetLocalPlayer() == Player(1) ) then
      • Multiboard - Show Game_Menu_Kodotag[2]
      • Custom script: endif
Ok I am a bit confused with your scripts because you only have 3 columns and 2 rows, but you also set things for a 5th column and 5th row while they not exist. Anyways I tell you a shortcut:

  • Multiboard - Set the display style for Game_Menu_Kodotag[1] item in column 1, row 1 to Show text and Hide icons
  • Multiboard - Set the display style for Game_Menu_Kodotag[1] item in column 1, row 2 to Show text and Hide icons
  • Multiboard - Set the display style for Game_Menu_Kodotag[1] item in column 2, row 1 to Show text and Hide icons
  • Multiboard - Set the display style for Game_Menu_Kodotag[1] item in column 2, row 2 to Show text and Hide icons
  • Multiboard - Set the display style for Game_Menu_Kodotag[1] item in column 3, row 1 to Show text and Hide icons
  • Multiboard - Set the display style for Game_Menu_Kodotag[1] item in column 3, row 2 to Show text and Hide icons
  • Multiboard - Set the display style for Game_Menu_Kodotag[1] item in column 4, row 1 to Show text and Hide icons
  • Multiboard - Set the display style for Game_Menu_Kodotag[1] item in column 4, row 2 to Show text and Hide icons
  • Multiboard - Set the display style for Game_Menu_Kodotag[1] item in column 5, row 1 to Show text and Hide icons
  • Multiboard - Set the display style for Game_Menu_Kodotag[1] item in column 5, row 2 to Show text and Hide icons
You can turn into:

  • Multiboard - Set the display style for Game_Menu_Kodotag[1] item in column 0, row 1 to Show text and Hide icons
  • Multiboard - Set the display style for Game_Menu_Kodotag[1] item in column 0, row 2 to Show text and Hide icons
With setting a column or row to 0 it will apply to all your columns/rows. This works for all multiboard GUI commands like set value, icon, width..

I hope it helps and have a nice day.
 
Last edited:
Status
Not open for further replies.
Top