• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Multiboard Problem

Status
Not open for further replies.
Level 4
Joined
May 12, 2008
Messages
49
Hi, this has to be the third time I post a new thread about Multiboard... but I realized that people telling me what to fix isn't helping in any way, so I ask you to fix this map so there is a local multiboard for each player, cause it isn't working, and yes, I have tried it online.


I am in desperate need of a local multiboard system that works :goblin_boom:


Edit: Here are the triggers if you are to lazy to download and open the map:
Melee Initialization:

  • Events
    • Time - Elapsed game time is 0.00 seconds
  • Conditions
  • Actions
    • For each (Integer A) from 1 to 4, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Player((Integer A))) slot status) Equal to Is playing
            • ((Player((Integer A))) controller) Equal to User
          • Then - Actions
            • Visibility - Create an initially Enabled visibility modifier for (Player((Integer A))) emitting Visibility across (Playable map area)
            • Multiboard - Create a multiboard with 2 columns and 3 rows, titled (Stats + (Name of (Player((Integer A)))))
            • Set Multiboard[(Integer A)] = (Last created multiboard)
            • For each (Integer A) from 1 to 3, do (Actions)
              • Loop - Actions
                • Multiboard - Set the display style for (Last created multiboard) item in column 1, row (Integer A) to Show text and Hide icons
                • Multiboard - Set the display style for (Last created multiboard) item in column 2, row (Integer A) to Show text and Hide icons
            • Multiboard - Set the width for (Last created multiboard) item in column 0, row 0 to 5.00% of the total screen width
            • Multiboard - Set the text for (Last created multiboard) item in column 1, row 1 to Kills:
            • Multiboard - Set the text for (Last created multiboard) item in column 1, row 2 to Deaths:
            • Multiboard - Set the text for (Last created multiboard) item in column 1, row 3 to Level:
            • Multiboard - Show (Last created multiboard)
            • Multiboard - Maximize (Last created multiboard)
          • Else - Actions
    • For each (Integer A) from 1 to 4, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Player((Integer A))) slot status) Equal to Is playing
            • ((Player((Integer A))) controller) Equal to User
          • Then - Actions
            • -------- A weird little thing that will only show a multiboard if the local player is appropriate. --------
            • -------- The concept is that if the current "local player" is being considered, we can show them a multiboard that corresponds to the player number in the loop. --------
            • Custom script: if( GetLocalPlayer() == ConvertedPlayer(bj_forLoopAIndex) ) then
            • Multiboard - Hide Multiboard[(Integer A)]
            • Custom script: endif
          • Else - Actions
Multiboard:
JASS:
function MBActions takes nothing returns nothing
    local player p = GetTriggerPlayer()

    if GetEventPlayerChatString() == "-menu" then
        if GetLocalPlayer() == p then
            call MultiboardDisplay(udg_Multiboard[GetPlayerId(p) +1],true)
        endif
    elseif GetEventPlayerChatString() == "-hide" then
        if GetLocalPlayer() == p then
            call MultiboardDisplay(udg_Multiboard[GetPlayerId(p) +1],false)
        endif
    endif
    
    set p = null
endfunction

//===========================================================================
function InitTrig_Multiboard takes nothing returns nothing
    local trigger t = CreateTrigger()
    local integer i = 0
    
    loop
        exitwhen i == 11
        call TriggerRegisterPlayerChatEvent(t,Player(i),"-",false)
        set i = i + 1
    endloop
    call TriggerAddAction(t,function MBActions)
    set t = null
endfunction

Show em:
  • Events
    • Player - Player 1 (Red) types a chat message containing -menu as An exact match
    • Player - Player 2 (Blue) types a chat message containing -menu as An exact match
    • Player - Player 3 (Teal) types a chat message containing -menu as An exact match
    • Player - Player 4 (Purple) types a chat message containing -menu as An exact match
  • Conditions
  • Actions
    • Custom script: call MultiboardDisplay(udg_Multiboard[bj_forLoopAIndex],false)
    • Custom script: if( GetLocalPlayer() == GetTriggerPlayer() ) then
    • Custom script: call MultiboardDisplay(udg_Multiboard[bj_forLoopAIndex],true)
    • Multiboard - Maximize Multiboard[(Integer A)]
    • Multiboard - Show Multiboard[(Player number of (Triggering player))]
    • Custom script: endif
    • For each (Integer A) from 1 to 4, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Player((Integer A))) slot status) Equal to Is playing
            • ((Player((Integer A))) controller) Equal to User
          • Then - Actions
            • -------- A weird little thing that will only show a multiboard if the local player is appropriate. --------
            • -------- The concept is that if the current "local player" is being considered, we can show them a multiboard that corresponds to the player number in the loop. --------
            • Custom script: call MultiboardDisplay(udg_Multiboard[bj_forLoopAIndex],false)
            • Custom script: if( GetLocalPlayer() == ConvertedPlayer(bj_forLoopAIndex) ) then
            • Custom script: call MultiboardDisplay(udg_Multiboard[bj_forLoopAIndex],true)
            • Custom script: endif
          • Else - Actions
 

Attachments

  • Local Multiboard.w3x
    20.6 KB · Views: 64
Last edited:
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

lets try this: Create a new trigger named "Multiboard", then convert it to custom text and add this:

JASS:
function MBActions takes nothing returns nothing
    local player p = GetTriggerPlayer()

    if GetEventPlayerChatString() == "-menu" then
        if GetLocalPlayer() == p then
            call MultiboardDisplay(udg_Multiboard[GetPlayerId(p) +1],true)
        endif
    elseif GetEventPlayerChatString() == "-hide" then
        if GetLocalPlayer() == p then
            call MultiboardDisplay(udg_Multiboard[GetPlayerId(p) +1],false)
        endif
    endif
    
    set p = null
endfunction

//===========================================================================
function InitTrig_Multiboard takes nothing returns nothing
    local trigger t = CreateTrigger()
    local integer i = 0
    
    loop
        exitwhen i == 11
        call TriggerRegisterPlayerChatEvent(t,Player(i),"-",false)
        set i = i + 1
    endloop
    call TriggerAddAction(t,function MBActions)
    set t = null
endfunction

Now see what happen, but if this still doesn't work for you then ... well well

Greetings and Peace
Dr. Boom
 
Level 16
Joined
May 1, 2008
Messages
1,605
Well, so you problem is, that player 1 doesn't see the multiboard from the beginning?
So why not delete the last loop in your init trigger, which hide the multiboard for all filtered players?

At all what is the "Show em" trigger about? You just need the init and my MBActions trigger for the multiboard show and hide.
Also if you type "-menu" you don't need to hide the board, before you show it again.
 
Status
Not open for further replies.
Top