• 🏆 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!

[JASS] Multiboard problem

Status
Not open for further replies.
Level 10
Joined
May 27, 2009
Messages
494
Ok OK OK...

I'm having problems with multiboard.
When I Used to Multiboards (1 shown for Force 1 and 1 shown for Force 2), only the multiboard for Force 2 is shown. It is only my problem. When a new multiboard is displayed (or call MultiboardDisplay(multiboard, boolean)) only the last multiboard that is shown will be displayed. I tried also using the Board library but same problem. Using the GetLocalPlayer() blah blah to get the players.
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

Ok sorry that I get into this but I understand it right, that you have problems to show different multiboards for different player?

What's complicated? You have 2 forces, so you create 2 different multiboard variable. Now you create both multiboards and save Multiboard 1 into varibale 1 and multiboard 2 into variable 2.

Now at the end of the creation you add the following:
JASS:
    if  GetLocalPlayer() == Player(0) then
        call MultiboardDisplay(X, true)
    endif
Now you repeat this for every player. ( Player(0) = Player red - X is the multiboard-variable you want to show ). And the problem with the event just use "Time - Elapsed game time is 0.01 seconds"

Greetings
~ The Bomb King > Dr. Boom
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
You need to A) create the multiboard locally for each player

Desyncs are typically caused by handle creation/destruction

You don't want to be creating a multi-board in local code; that will most definitely cause a desync. In regards to the amount of time you must wait before a multiboard is created, it only has to be after the map initialization thread, meaning a 0-second expiring timer will do the trick (not positive about elapsed game time events).

JASS:
scope MultiboardTrial initializer init

globals
    multiboard array PlayerBoard
endglobals

public function initDelayed takes nothing returns nothing
    local integer i = 0
    loop
        exitwhen i == 12
        set PlayerBoard[i] = CreateMultiboard()
        call MultiboardDisplay(PlayerBoard[i], GetLocalPlayer()==Player(i))
        // There shouldn't be any problem creating many multiboards. I have done
        // this before (mentioned by Bribe near thread start).
        set i = i + 1
    endloop
endfunction

public function init takes nothing returns nothing
    call TimerStart(CreateTimer(), 0, false, function initDelayed)
endfunction

endscope
 
Status
Not open for further replies.
Top