[Lua] [Solved] desync with transpiled lua code

Hello hive, I am experiencing desyncs with the attached map. Since its transpiled from jass I have also attached the map script as a separate file.

To reproduce the desync, start a game with 2 players and 10 computers, then wait. edit: Please re-download the map and script I forgot something.
 

Attachments

Last edited:
Solved; the issue was that I was initializing a location variable and a hashtable variable outside of any scope. This is an issue even if you re-assign the variable to a new object later. In simpler terms, be sure to initialize locations and hashtables in in init function and leave the global variable or static struct member declarations of those variables uninitialized.
 
Known causes of desync - in-depth analysis
replacing the following: DDLib__TempLoc = Location(0., 0.)
with this: DDLib__TempLoc = DDLib__TempLoc or Location(0., 0.) - strangely enough - has the same fixing properties...

@KitsuneTailsPrower I hope you paid attention to this:
Lua:
function InitCustomTriggers()
  InitTrig_Melee_Initialization()
  --Function not found: call InitTrig_Shimmering_Portal()
  --Function not found: call InitTrig_DD_Library()
  --Function not found: call InitTrig_TimerUtils()
end

Offtopic but what God forsaken converter did you use? Why are these numbers and not FourCC?
BlzCreateUnitWithSkin(p, 1852666999, 9531.4, 5698.9, 145.936, 1852666999)
 
Back
Top