1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Trigger] How to Create Multiboard for each player

Discussion in 'Triggers & Scripts' started by ALTELMA, Apr 20, 2012.

  1. ALTELMA

    ALTELMA

    Joined:
    Jan 4, 2009
    Messages:
    113
    Resources:
    0
    Resources:
    0
    I try to create Multiboard , but I don't know how to show Multiboard for each player. Can show example for me plz.
     
  2. Starquizer

    Starquizer

    Joined:
    Mar 3, 2006
    Messages:
    1,526
    Resources:
    6
    Maps:
    1
    Spells:
    2
    Tutorials:
    3
    Resources:
    6
    This is a quick example.

    • Create
      • Events
        • Player - Player 1 (Red) skips a cinematic sequence
      • Conditions
      • Actions
        • Multiboard - Create a multiboard with 5 columns and 2 rows, titled Players Info
        • Multiboard - Set the text for (Last created multiboard) item in column 1, row 1 to Players
        • Multiboard - Set the display style for (Last created multiboard) item in column 1, row 1 to Show text and Hide icons
        • Multiboard - Set the text for (Last created multiboard) item in column 1, row 2 to (Name of Player 1 (Red))
        • Multiboard - Set the display style for (Last created multiboard) item in column 1, row 2 to Show text and Hide icons
        • Multiboard - Show (Last created multiboard)
     
  3. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    You mean display it for the Player X, but not the Player Y ?

    You have to use GetLocalPlayer().
    However, if you can safely hide/show a multiboard in a local block, you can't handle it in a local block (like create/destroy multiboard items), else it will desync.

    Also, you can't display (and maybe create) a multiboard/leaderboard on map init.
     
  4. phuc1570

    phuc1570

    Joined:
    Jun 19, 2010
    Messages:
    138
    Resources:
    0
    Resources:
    0
    I copied this several times. Hope this simple example helps you. Base on this you can make a complicated one.
    Multiboard
    • Create Multiboard
      • Events
        • Time - Elapsed game time is 1.00 seconds
      • Conditions
      • Actions
        • Game - Display to (All players) for 18.00 seconds the text: (In Game |c00ffff00Match's score:|r |c0000ff00Jerry - Tom: |r + (|c0000ffff + ((String(gamescore[1])) + (|r + ( - + ((|c0000ffff + (String(gamescore[2]))) + |r))))))
        • Multiboard - Create a multiboard with 6 columns and 1 rows, titled (Scoreboard for + ((String((gamescore[1] + gamescore[2]))) + games))
        • -------- Width --------
        • Multiboard - Set the width for (Last created multiboard) item in column 1, row 1 to 1.60% of the total screen width
        • Multiboard - Set the width for (Last created multiboard) item in column 2, row 1 to 7.00% of the total screen width
        • Multiboard - Set the width for (Last created multiboard) item in column 3, row 1 to 1.50% of the total screen width
        • Multiboard - Set the width for (Last created multiboard) item in column 4, row 1 to 1.50% of the total screen width
        • Multiboard - Set the width for (Last created multiboard) item in column 5, row 1 to 1.60% of the total screen width
        • Multiboard - Set the width for (Last created multiboard) item in column 6, row 1 to 6.50% of the total screen width
        • -------- Text --------
        • Multiboard - Set the text for (Last created multiboard) item in column 2, row 1 to |c00ffff00Jerry Tea...
        • Multiboard - Set the text for (Last created multiboard) item in column 3, row 1 to (String(gamescore[1]))
        • Multiboard - Set the text for (Last created multiboard) item in column 4, row 1 to (String(gamescore[2]))
        • Multiboard - Set the text for (Last created multiboard) item in column 6, row 1 to |c00ff0000Tom Team|...
        • -------- Now set the fields for the first row, AND our player rows. --------
        • Multiboard - Set the display style for (Last created multiboard) item in column 1, row 1 to Show text and Show icons
        • Multiboard - Set the display style for (Last created multiboard) item in column 2, row 1 to Show text and Hide icons
        • Multiboard - Set the display style for (Last created multiboard) item in column 3, row 1 to Show text and Hide icons
        • Multiboard - Set the display style for (Last created multiboard) item in column 4, row 1 to Show text and Hide icons
        • Multiboard - Set the display style for (Last created multiboard) item in column 5, row 1 to Show text and Show icons
        • Multiboard - Set the display style for (Last created multiboard) item in column 6, row 1 to Show text and Hide icons
        • -------- Icon & Numbers --------
        • Multiboard - Set the icon for (Last created multiboard) item in column 1, row 1 to ReplaceableTextures\CommandButtons\BTNYouDirtyRat!.blp
        • Multiboard - Set the icon for (Last created multiboard) item in column 5, row 1 to ReplaceableTextures\CommandButtons\BTNPuss-in-boots.blp
        • Multiboard - Show (Last created multiboard)
     
    Last edited: Apr 22, 2012
  5. Spartipilo

    Spartipilo

    Joined:
    Jul 14, 2011
    Messages:
    3,190
    Resources:
    0
    Resources:
    0
    phuc.. that isn't helpfull at all. Did you even read the question?

    as Troll-Brain said, you need to use GetLocalPlayer() Which means doing something just for one player, but there are a lot of stuff you can't do because it may desync, so, you have to be very carefull. There are several tutorials here in Hive and in the-helper, and Wc3.net you can read to understand how GetLocalPlayer() works, and how can be used to display different data in different multiboards for different players.
     
  6. ALTELMA

    ALTELMA

    Joined:
    Jan 4, 2009
    Messages:
    113
    Resources:
    0
    Resources:
    0
    Ok Thanks for all answers. I understand for create by uses GetLocalPlayer() and anybody can explain or show example for me. Plz
     
  7. Arhowk

    Arhowk

    Joined:
    Aug 8, 2007
    Messages:
    2,753
    Resources:
    0
    Resources:
    0
    GetLocalPlayer basically returns the hosts computer meaning if you do something liek

    if GetLocalPlayer() == Player(1)

    For whoever is player 1, that condition will be true. But since in player 2, the local playe is player 2 not player 1 so the code will only be run for player 1. This is risky tho and can cause desyncs

    To do this with the multiboard, before you put Show last created multiboard do Custom Script : if GetLocalPlayer() == Player(# of player you want to show for - 1) (because, in jass, player 0 = red, player 1= blue, etc.)

    and than after show last created multiboard

    Custom Script : endif
     
  8. ALTELMA

    ALTELMA

    Joined:
    Jan 4, 2009
    Messages:
    113
    Resources:
    0
    Resources:
    0
    OK I get it, thanks you very much
     
  9. ALTELMA

    ALTELMA

    Joined:
    Jan 4, 2009
    Messages:
    113
    Resources:
    0
    Resources:
    0
    Sorry,I'll try it, but It's doesn't work. I can't show multiboard for right owner player. because I don't know about condition to check player from native Native GetLocalPlayer().
    Can show example to uses GetLocalPlayer() Condition, plz.
     
  10. Spartipilo

    Spartipilo

    Joined:
    Jul 14, 2011
    Messages:
    3,190
    Resources:
    0
    Resources:
    0
    For each integer A from 0 to 12 do
    If GetLocalPlayer == GetPlayerConvertedId(bj_forLoopAIndex) then
    ...
    endif

    (Or something like that).
     
  11. Teelo

    Teelo

    Joined:
    Mar 31, 2009
    Messages:
    709
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Code (vJASS):
    if (GetLocalPlayer() == ...) then


    Instead of [ijass]...[/ijass] use:
    For Event - Triggering Player - [ijass]GetTriggerPlayer()[/ijass]
    For Owner of Triggering Unit - [ijass]GetOwningPlayer(GetTriggerUnit())[/ijass]

    Tell me the condition you want and I will give you the correct code.
     
  12. ALTELMA

    ALTELMA

    Joined:
    Jan 4, 2009
    Messages:
    113
    Resources:
    0
    Resources:
    0
    My Condition is same Spartipilo's reply. but that It's work? And I wonder when I uses GetLocalPlayer() is dangerous. Example Dangerous to me. PLZ!!
     
    Last edited: Apr 27, 2012
  13. Arhowk

    Arhowk

    Joined:
    Aug 8, 2007
    Messages:
    2,753
    Resources:
    0
    Resources:
    0
    What's your home nationality?

    Anyway it's simple for triggering player

    If getlocalplayer ==gettriggerplayer

    For specific player

    Player(#)

    In a integer a loop

    Bj_forloopAindex

    Anyway the rule about not what to use in those blockss

    Don't do anything with units items or destructibles and do not do anything that includes the words create or destroy.
     
  14. Teelo

    Teelo

    Joined:
    Mar 31, 2009
    Messages:
    709
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Create the multiboards beforehand, only put the Show Multiboard part inside the local player part.
     
  15. ALTELMA

    ALTELMA

    Joined:
    Jan 4, 2009
    Messages:
    113
    Resources:
    0
    Resources:
    0
    Sorry for my language.

    I have a question about Condition. Now I can creates multiboard for many player, but Should I select event is refer to Triggerplayer()?
    This Multiboard will show on the time of game is past 15 second (like DotA).

    Tell me Plz. I don't know really.
     
  16. Arhowk

    Arhowk

    Joined:
    Aug 8, 2007
    Messages:
    2,753
    Resources:
    0
    Resources:
    0
    If your doing something like a command to show the multiboard, than the condition you would use is if GetLocalPlayer() == GetTriggerPlayer()
     
  17. ALTELMA

    ALTELMA

    Joined:
    Jan 4, 2009
    Messages:
    113
    Resources:
    0
    Resources:
    0
    Ok I'll try it. Thanks alot. I wonder GetTriggerPlayer() is refer to Who? when that trigger don't have any event? Can you tell me, Plz.
     
  18. Spartipilo

    Spartipilo

    Joined:
    Jul 14, 2011
    Messages:
    3,190
    Resources:
    0
    Resources:
    0
    If the event is related to a player (Player - something...) the GetTriggeringPlayer() is the Triggering Player.
     
  19. ALTELMA

    ALTELMA

    Joined:
    Jan 4, 2009
    Messages:
    113
    Resources:
    0
    Resources:
    0
    But my trigger has event name "Time is elapsed". It's related to any Player. Can I uses GetTriggerPlayer()? And I should select any to fix that problem.

    Plz tell me more

    Code (vJASS):

    function Create_MultiBoard takes nothing returns nothing

         local multiboard array mb
         local integer i = 0
         
         loop
            exitwhen i > 11
            set mb[i] = CreateMultiboard()
            call MultiboardSetRowCount(mb[i], 1)
            call MultiboardSetColumnCount(mb[i], 1)
            call MultiboardSetTitleText(mb[i], "MUULTIBOARD : "+GetPlayerName(Player(0)))
           
            if(GetLocalPlayer() == ????)then // This I wonder Can I use any refer target player????
                call MultiboardDisplay(mb[i], true)
            endif
           
            set i = i  + 1
         endloop
         
    endfunction

    //===========================================================================
    function InitTrig_Create_MultiBoard takes nothing returns nothing
        local trigger t = CreateTrigger()
        call TriggerRegisterTimerEventSingle( t, 0.00 )
        call TriggerAddAction( t, function Create_MultiBoard )
        set t = null
    endfunction

     


    Or Have you suggestion other way please tell me more ....
     
    Last edited: Apr 30, 2012
  20. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    Inside the loop :

    Code (vJASS):
    call MultiboardDisplay(mb[i], Player(i) == GetLocalPlayer())


    This way it will be false for all players excepted for Player(i), then the multiboard will be showed only for the Player(i).

    But instead of a local array variable, it should be global array variable, else you wouldn't be allowed to handle the multiboards later.