• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Jass Multiboard unique to each player

Status
Not open for further replies.
Level 4
Joined
May 1, 2008
Messages
72
Hello, I am having an issue getting a multiboard working so that each player has a unique multiboard. The multiboard for player 1 loads, then when I have the one load for player 2, the multiboard for player 1 disappears. I have tested this as player 2, and that multiboard does appear after 10 seconds.

Multiboard code
  • Quest Multiboard Copy
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Set VariableSet unit[0] = "working"
      • Set VariableSet unit[1] = not working
      • Multiboard - Create a multiboard with 2 columns and 2 rows, titled Test.
      • Set VariableSet QuestMultiboard_P1 = (Last created multiboard)
      • Multiboard - Hide QuestMultiboard_P1
      • Multiboard - Set the display style for QuestMultiboard_P1 item in column 1, row 1 to Show text and Hide icons
      • Multiboard - Set the text for QuestMultiboard_P1 item in column 1, row 1 to unit[0]
      • Multiboard - Create a multiboard with 2 columns and 2 rows, titled Test.
      • Set VariableSet QuestMultiboard_P2 = (Last created multiboard)
      • Multiboard - Hide QuestMultiboard_P2
      • Multiboard - Set the display style for QuestMultiboard_P2 item in column 1, row 1 to Show text and Hide icons
      • Multiboard - Set the text for QuestMultiboard_P2 item in column 1, row 1 to unit[1]
Player 1 Multiboard code

JASS:
function Trig_Show_for_player_1_Copy_Actions takes nothing returns nothing
    local boolean show = false
    if ( GetLocalPlayer() == Player(0) ) then
         set show = true
    endif
    call MultiboardDisplay(udg_QuestMultiboard_P1,show)
endfunction

//===========================================================================
function InitTrig_Show_for_player_1_Copy takes nothing returns nothing
    set gg_trg_Show_for_player_1_Copy = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_Show_for_player_1_Copy, 5 )
    call TriggerAddAction( gg_trg_Show_for_player_1_Copy, function Trig_Show_for_player_1_Copy_Actions )
endfunction

Player 2 Multiboard code

JASS:
function Trig_Show_for_player_2_Copy_Actions takes nothing returns nothing
    local boolean show = false
    if ( GetLocalPlayer() == Player(1) ) then
         set show = true
    endif
    call MultiboardDisplay(udg_QuestMultiboard_P2,show)
endfunction

//===========================================================================
function InitTrig_Show_for_player_2_Copy takes nothing returns nothing
    set gg_trg_Show_for_player_2_Copy = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_Show_for_player_2_Copy, 10 )
    call TriggerAddAction( gg_trg_Show_for_player_2_Copy, function Trig_Show_for_player_2_Copy_Actions )
endfunction
 
+1 to what Wrda said. It should be safe to use MultiboardDisplay for a single player (locally). I'm guessing if you call that function globally, it might do some weird side-effects that cause the current multiboard to disappear.

Here's how you'd adjust your triggers:
JASS:
function Trig_Show_for_player_1_Copy_Actions takes nothing returns nothing
    if ( GetLocalPlayer() == Player(0) ) then
        call MultiboardDisplay(udg_QuestMultiboard_P1, true)
    endif
endfunction

//===========================================================================
function InitTrig_Show_for_player_1_Copy takes nothing returns nothing
    set gg_trg_Show_for_player_1_Copy = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_Show_for_player_1_Copy, 5 )
    call TriggerAddAction( gg_trg_Show_for_player_1_Copy, function Trig_Show_for_player_1_Copy_Actions )
endfunction

JASS:
function Trig_Show_for_player_2_Copy_Actions takes nothing returns nothing
    if ( GetLocalPlayer() == Player(1) ) then
        call MultiboardDisplay(udg_QuestMultiboard_P2, true)
    endif
endfunction

//===========================================================================
function InitTrig_Show_for_player_2_Copy takes nothing returns nothing
    set gg_trg_Show_for_player_2_Copy = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_Show_for_player_2_Copy, 10 )
    call TriggerAddAction( gg_trg_Show_for_player_2_Copy, function Trig_Show_for_player_2_Copy_Actions )
endfunction
 
Status
Not open for further replies.
Back
Top