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. Arhowk

    Arhowk

    Joined:
    Aug 8, 2007
    Messages:
    2,753
    Resources:
    0
    Resources:
    0
    Player(i)
    to refer to the loop #.

    and why is the multiboard array local? you wont be able to access it once
    endfunction
     
  2. ALTELMA

    ALTELMA

    Joined:
    Jan 4, 2009
    Messages:
    113
    Resources:
    0
    Resources:
    0


    I 'll try on this, Thanks you.


    Oh I don't know about it, Ok I will using Global instead.

    Thanks for all reply.
     
  3. phuc1570

    phuc1570

    Joined:
    Jun 19, 2010
    Messages:
    138
    Resources:
    0
    Resources:
    0
    I play with this abit. So it'd be like this, right? but nothing happens in game!?!
    Spoiler
    Code (vJASS):
    scope multiboard initializer MultiBoard
        globals
            multiboard array mb
        endglobals
        private function Create_MultiBoard takes nothing returns nothing
             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],"MULTIBOARD : "+GetPlayerName(Player(0)))        
                if GetLocalPlayer()==GetTriggerPlayer()then
                    call MultiboardDisplay(mb[i],Player(i)==GetLocalPlayer())
                endif        
                set i=i+1
             endloop    
        endfunction
        private function MultiBoard takes nothing returns nothing
            local trigger t=CreateTrigger()
            call TriggerRegisterTimerEvent(t,0.00,false)
            call TriggerAddAction(t,function Create_MultiBoard)
            set t = null
        endfunction
    endscope
     
  4. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    Code (vJASS):
    if GetLocalPlayer()==GetTriggerPlayer()then
        call MultiboardDisplay(mb[i],Player(i)==GetLocalPlayer())
    endif


    ->

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


    GetTriggerPlayer will return null here, also the if is not needed because GetLocalPlayer returns a different player on each pc, and then the boolean expression Player(i)==GetLocalPlayer() is already local (asynchronous).
     
  5. phuc1570

    phuc1570

    Joined:
    Jun 19, 2010
    Messages:
    138
    Resources:
    0
    Resources:
    0
    Yes, I've thought of no need for if condition and gone ahead in a couple of hours ago testing the script without the if in that loop (see below) but nothing happens.
    Spoiler
    Code (vJASS):
    scope multiboard initializer MultiBoard
        globals
            multiboard array mb
        endglobals
        private function Create_MultiBoard takes nothing returns nothing
             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],"MULTIBOARD : "+GetPlayerName(Player(0)))      
                call MultiboardDisplay(mb[i],Player(i)==GetLocalPlayer())        
                set i=i+1
             endloop    
        endfunction
        private function MultiBoard takes nothing returns nothing
            local trigger t=CreateTrigger()
            call TriggerRegisterTimerEvent(t,0.10,false)
            call TriggerAddAction(t,function Create_MultiBoard)
            set t = null
        endfunction
    endscope
     
  6. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    It should work, but remember that you can't display several multiboards at the same time (for the same pc), so if one multiboard is already displayed that shouldn't work.
     
  7. phuc1570

    phuc1570

    Joined:
    Jun 19, 2010
    Messages:
    138
    Resources:
    0
    Resources:
    0
    Here's the clue. It doesn't work. Open & test it yourself.
     

    Attached Files:

  8. ALTELMA

    ALTELMA

    Joined:
    Jan 4, 2009
    Messages:
    113
    Resources:
    0
    Resources:
    0
    Sorry, I will ask something on vJass. If I want to use it. jassnewgen is Ok? tell me more,plz.
     
  9. phuc1570

    phuc1570

    Joined:
    Jun 19, 2010
    Messages:
    138
    Resources:
    0
    Resources:
    0
  10. ALTELMA

    ALTELMA

    Joined:
    Jan 4, 2009
    Messages:
    113
    Resources:
    0
    Resources:
    0
    replace? Do you mean replace on W3WorldEditor? becauses I uses JassNewGenPack5d,too.