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:
At the start of the game (and whenever that wc3 bug causes the need for the multiboards to be reconstructed/re-shown):
Activate Fish Finder:
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?
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?