So after discovering that i can use LAN games to test for desyncs by launching war3 from battle net and worldedits test map function, ive done a bunch of testing and come to the conclusion that this timer is causing the desync.
As with my testing online where it didnt desync sometimes the same happened whilst i was testing on LAN.
-
Countdown Timer - Start Timer as a Repeating timer that will expire in 20.00 seconds
I created a new var for the timer, tested it and got a desync, changed to repeating, desync, tried 20 and 25 seconds, both desynced. Then when i disable the timer action no desync occurs.
The test map is attached. all other triggers are disabled along with all actions within the Map Start trigger where the timer action is located, all imports have been removed, custom game interface and constants have been disabled and some scenario settings have been set to default.
Could someone else test it in a LAN game? If it still desyncs then that would at least eliminate my war3 installation as the cause.
As for the desync itself, i just deleted all the timer actions and replaced them all with the trigger below. It starts turned off and is turned on as the final action in the map Start trigger, Integer_Time is reset back to 0 when each wave has been fully spawned.
-
Timer
-
Events
-
Time - Every 1.00 seconds of game time
-
Conditions
-
Actions
-
Set VariableSet Integer_Timer = (Integer_Timer + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Integer_Timer Greater than or equal to (Integer(Real_WaveTimer))
-
Then - Actions
-
Trigger - Run Next Wave <gen> (ignoring conditions)
-
Else - Actions
As for the changes
@Uncle made, much appreciated.
As for the notes you left, i havent encountered any crashes caused by my custom abilities nor desyncs or lag, all damage caused within them use dummy units to deal damage to avoid triggering them infinitely, the only infinite damage loop i encounted was because i forgot the casting time on shadow strike is its damage interval. The custom values of units is only used for 1 tower so i have no real need for a unit indexer and have no plans to make further use of them. I checked the Anomaly Tower trigger and yeh, am dumb i didnt need to have 2 sets of the same actions so i deleted 1 set and moved it out of the if/then/else statement. As for the rest of the abilities some of them are in their current form because im lazy and havent changed them like i have the others, but they still function correctly.
Ill eventually make a post in the Map Dev section for the map so people can tell me how shit my triggers are and how i can improve things.