This is an old revision of the document!
void SyncVariable(int tid, num value)
Synchronizes an arbitrary numeric variable from server to all clients. The synchronized value can be retrieved using GetSyncVar and GetSyncVarDefaut. If SyncVariable is called twice with the same value, no network traffic happens.
This function works by spawning an undetectable indestructible actor and using its Speed property to synchronize the value.
This function is intended to be used every tic in a single serverside OPEN script:
script "SyncVariables" OPEN { SyncVariable(TID_LIVESCOUNT, Lives); SyncVariable(TID_LIVINGMONSTERCOUNT, LivingMonsterCount()); SyncVariable(TID_LIFEGAIN, GainedLives); Delay(1); restart; }
This makes property synchronization immediate and efficient (no net traffic when no property changes happen).