• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Desync

Status
Not open for further replies.
Level 23
Joined
Apr 3, 2018
Messages
460
My map desyncs but the only places using GetLocalPlayer:

1. change unit transparency
2. change texttag text
3. show/hide multiboards
4. set camera distance, target, etc.
5. create and show a fade filter

Which one of these could it be?

The map triggers are here, they are in cjass (ignore the "character data" folder)
Trigger Viewer | HIVE

Personally I suspect either the multiboards or the fade filters.
 
Last edited:
JASS:
if IAbsBJ(View[GetPlayerId(GetLocalPlayer())].battle_index) != a {text=""}
JASS:
if IAbsBJ(View[GetPlayerId(GetLocalPlayer())].battle_index) == index
{
    CinematicFadeCommonBJ(33, 67, 67, 0.5 * 0.5, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 75, 75)
    FinishCinematicFadeAfterBJ(0.5)
}
Using string literals or concatenations in local blocks has been known to cause desyncs if the string doesn't already exist in the string table.
The function FinishCinematicFadeAfterBJ creates a timer handle, which is obviously very bad.
JASS:
function FinishCinematicFadeAfterBJ takes real duration returns nothing
    // Create a timer to end the cinematic fade.
    set bj_cineFadeFinishTimer = CreateTimer()
    call TimerStart(bj_cineFadeFinishTimer, duration, false, function FinishCinematicFadeBJ)
endfunction
 
Level 23
Joined
Apr 3, 2018
Messages
460
The function FinishCinematicFadeAfterBJ creates a timer handle, which is obviously very bad.
JASS:
function FinishCinematicFadeAfterBJ takes real duration returns nothing
    // Create a timer to end the cinematic fade.
    set bj_cineFadeFinishTimer = CreateTimer()
    call TimerStart(bj_cineFadeFinishTimer, duration, false, function FinishCinematicFadeBJ)
endfunction
Right, this must be it, how did I overlook it?
Thanks!

Not sure about the strings but will put them somewhere in initialization to add to string table, just in case.
 
5. create and show a fade filter
This could be the dangerous point. Have a look at @WaterKnight 's script to use filters properly for one player.
Using string literals or concatenations in local blocks has been known to cause desyncs if the string doesn't already exist in the string table.
I believe same as:
Source? I use local string manipulation extensively in my code, but it never caused any issues.
.. it should be a common tequnique for local usage, so string table seems does not need to be synced. @DracoL1ch made a thread about this topic.
 
Last edited:
Status
Not open for further replies.
Top