- Joined
- Jul 21, 2016
- Messages
- 54
About 50% of the time I play my map it crashes. It can happen anywhere from within the first couple of minutes or up to an hour in. I am on discord with all players as we are playing and I ask them each time if they were doing something interesting. Each time none of the players have anything interesting to report. I must have watched up to 50 replays of point of views of the players as it desyncs. I cannot spot what is causing the game to crash. Most of the time it crashes only part of the lobby and the rest can remain playing, a.k.a. only team 1 crashes or only a subsection of a team crashes. It feels like it is caused by a trigger which causes desyncs between the players. I have been going through all my code trying to remove any triggers that could potentially cause desyncs, but to no avail. I still have 1 suspect remaining that I feel like might be causing the desyncs. I use the functions BlzGetFrameByName, BlzFrameSetText tens of thousands of times per game by calling this function:
Does anyone have any insight on whether or not this function can desync the game? Alternatively, does anyone have a consistent way to trace a desync back to a function call?
JASS:
function ChangeFoodTextBox takes nothing returns nothing
local framehandle fh = BlzGetFrameByName("ResourceBarSupplyText" , 0)
local player myplayer = GetLocalPlayer()
local integer mynumber = GetConvertedPlayerId(GetTriggerPlayer())
local string ftext = ""
set ftext = I2S(( GetPlayerState(myplayer, PLAYER_STATE_RESOURCE_FOOD_CAP) - GetPlayerState(myplayer, PLAYER_STATE_RESOURCE_FOOD_USED) ))
if ( mynumber != 22 ) then
call BlzFrameSetText(fh , ftext)
endif
endfunction