Multiboards Causing Desync

Luth

Lex Luthor!
Reaction score
41
So, my multi-multiboard implementation causes crashes. :) Multiplayer only, single player is fine. Maybe someone more familiar with these things can lend a hand? Here's my implementation:

Global funcs:
Code:
function ShowMultiboardForPlayer takes integer P returns nothing
    if(udg_FishFinder[P] == null) then
        call MultiboardDisplayBJ( true, udg_GameClockMultiboard )
    else
        call MultiboardDisplayBJ( true, udg_FishFinder[P] )
    endif
endfunction

function CreateFishFinderForPlayer takes integer P returns nothing
    if (GetLocalPlayer() == ConvertedPlayer(P)) then
        call CreateMultiboardBJ( 4, 8, "FiSH Finder" )
        call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 0, 0, 2.00 )
        call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 0, 0, false, false )
        call MultiboardMinimizeBJ( false, GetLastCreatedMultiboard() )
        call MultiboardDisplayBJ( true, GetLastCreatedMultiboard() )
        set udg_FishFinder[P] = GetLastCreatedMultiboard()
    endif
endfunction

function DestroyFishFinderForPlayer takes integer P returns nothing
    if (GetLocalPlayer() == ConvertedPlayer(P)) then
        call DestroyMultiboardBJ( udg_FishFinder[P] )
        set udg_FishFinder[P] = null
    endif
endfunction

At the start of the game (and whenever that wc3 bug causes the need for the multiboards to be reconstructed/re-shown):
Code:
Actions
    Multiboard - Destroy GameClockMultiboard
    Multiboard - Create a multiboard with 2 columns and 1 rows, titled                   F...
    Multiboard - Set the display style for (Last created multiboard) item in column 0, row 0 to Show text and Hide icons
    Multiboard - Set the width for (Last created multiboard) item in column 1, row 1 to 5.00% of the total screen width
    Multiboard - Set the text for (Last created multiboard) item in column 1, row 1 to --
    Multiboard - Set the width for (Last created multiboard) item in column 2, row 1 to 15.00% of the total screen width
    Multiboard - Set the text for (Last created multiboard) item in column 2, row 1 to --
    Multiboard - Maximize (Last created multiboard)
    Set GameClockMultiboard = (Last created multiboard)
    For each (Integer A) from 1 to 10, do (Actions)
        Loop - Actions
            Custom script:   call ShowMultiboardForPlayer( bj_forLoopAIndex )

Activate Fish Finder:
Code:
Activate FiSH Finder
    Events
        Player - Player 1 (Red) Presses the Down Arrow key
        ...
        Player - Player 10 (Light Blue) Presses the Down Arrow key
    Conditions
        Boats[(Player number of (Triggering player))] Not equal to No unit
        (Level of FiSH Finder  for Boats[(Player number of (Triggering player))]) Greater than 0
        (Fishermen[(Player number of (Triggering player))] is hidden) Equal to True
    Actions
        Custom script:   call CreateFishFinderForPlayer( GetConvertedPlayerId(GetTriggerPlayer()) )
        Custom script:   call ShowMultiboardForPlayer( GetConvertedPlayerId(GetTriggerPlayer()) )

Deactivate Fish Finder:
[same as above, except 2nd to last line is:]
Custom script: call DestroyFishFinderForPlayer( GetConvertedPlayerId(GetTriggerPlayer()) )

And then a Fish Finder update function that iterates from 1 to 10 of the FishFinders, if ( udg_FishFinder != null ) then update the multiboard accordingly.


So, I'm not sure which part of that caused the crash in multiplayer, but I'm fairly sure it was the activate, not the update. If I can find someone to host for me, I'll try to crash myself out. Maybe someone who's dealt with this can find something wrong with it?

:confused:
 

corvusHaunt

New Member
Reaction score
96
Well, like I've said before, I don't use multiboards much, and I've never needed to show them for one player. The lack of a native for it in the first place annoys me a bit. Sorry to say, but I'm pretty sure trying to show the multiboard for one player causes the desync. What you may be able to do though is fill the multiboard with localplayer strings. Here is an example about this string thing I just said:
Code:
function blah takes nothing returns nothing
  local string s = "You are not player one"

    if GetLocalPlayer() == Player(0) then
      set s = "You are player one"
    endif

    call DisplayTextToForce(GetPlayersAll(), s)
    //You can guess what this does...
endfunction
So just set the strings for the rows and stuff to "" if the player's fishfinder is "deactivated". I'm sure you understand. Hope it helps :)
 

Luth

Lex Luthor!
Reaction score
41
If I had one multiboard that needed to show different strings, I would do that. But, instead, I have two multiboards: GameClock and FishFinder[11].

GameClock is the same, always, for everyone.

FishFinder is an array of specially suited MultiBoards, tailored to each player.

The format of GC and FF are very, very different from each other, much different than simply different display strings. GC is a 2x1 text only display, while FF is a 4x8 icon only display. I cant even combine the two into one.
 

corvusHaunt

New Member
Reaction score
96
But it is simply displaying strings :)

Multiboard icons require paths right?

Code:
function AddEffectForPlayer takes real x, real y, string path, player forplayer returns nothing
  local effect e
   
    if GetLocalPlayer() != forplayer then
    
      set path = ""
      
    endif
    
    set e = AddSpecialEffect(path, x, y)
    
endfunction

I already had this function made from a few days ago, so excuse me for not making an example with multiboard icons :p
 

Luth

Lex Luthor!
Reaction score
41
The string "Tournament ends at 4:00 am" will not fit into a 2% wide icon-sized box. It wont, in fact, fit that message into the width of the entire Fish Finder window.
 

corvusHaunt

New Member
Reaction score
96
err...what?

I'm talking about the paths for your icons. Make the paths blank for the players with their Fishfinder deactivated, so that they will see an empty multiboard. The example code there was just showing that you can do that. ( the script I made in the last post will only show the effect for 'forplayer' )
 

Luth

Lex Luthor!
Reaction score
41
Yeah yeah, I know that, but the problem is you cant show two multiboards at once, so I have to have two (actually 11) multiboards created and updating, and only show a particular one to any particular player at a time. I dont want to show an empty fish finder, I want to not show it at all and show the clock instead.

Regardless, after a half dozen online tests, I finally have multi-multiboards toggle between each other independent of the rest of the players without crashing or desyncing. :) There was a desync in the array variable that needed straightening, then it was a matter of updating everyone's settings appropriately after every new creation/deletion.

-this thread be dead- :cool:
 

corvusHaunt

New Member
Reaction score
96
So showing multiboards for specific players don't cause desyncs? Hmmm :/

Either way, I was saying you should make it one multiboard, since I know about your other thread about showing multiple ones at once.

Like:
Code:
   _____________________
  |Time -  4:30         |
  |Tournament at: 5:30  |
  |                     |
  |Fishfinder: Activated|
  |  {}                 |
  |       {}            |
  |            {}       |
  |     {}              |
  |_____________________|
Where the {} are the icons :p If a player had it deactivated it would just be blank.
 

emjlr3

Change can be a good thing
Reaction score
395
have you tried searching for this at WC3, i am pretty sure there is a tut. for this

i, being very inexperienced with multiboards, other then just creating basic ones, don't have a clue as to what to do

hell even my mb i tried to optimize in JASS farked up a good bit
 

Luth

Lex Luthor!
Reaction score
41
corvusHaunt said:
So showing multiboards for specific players don't cause desyncs? Hmmm :/

Either way, I was saying you should make it one multiboard, since I know about your other thread about showing multiple ones at once.

Like:
Code:
   _____________________
  |Time -  4:30         |
  |Tournament at: 5:30  |
  |                     |
  |Fishfinder: Activated|
  |  {}                 |
  |       {}            |
  |            {}       |
  |     {}              |
  |_____________________|
Where the {} are the icons :p If a player had it deactivated it would just be blank.

Not as long as you keep the variables in sync. Your solution couldnt be used because text will not flow out of the cell it is assigned, and you cannot have a 'top section' of two wide cells and a 'bottom section' of four small, or something like that. The closest you could get is to divvy up the strings into characters that would fit. It would look something like:
Code:
   _____________________
  [Tim][e -][  4][:30]
  [Tou][rna][men][t a]
  [   ][   ][   ][   ]
  [ X ][   ][   ][   ]
  [   ][   ][ X ][   ]
  [   ][   ][   ][   ]
  [ X ][   ][   ][   ]
  [   ][   ][   ][   ]
  [   ][   ][ X ][   ]
  [   ][   ][   ][   ]
  [ X ][   ][   ][ X ]

  |_____________________|

Emj: I find wc3 most unfriendly, and therefore have become acustomed to avoiding it. The thought of looking there never crossed my mind. :rolleyes:

However, its a moot point, since I have mastered the multi-multiboard, and have it working splendidly! (And the peasants cheered. *hooray*)
 

emjlr3

Change can be a good thing
Reaction score
395
agreed....

in anycase, good job
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top