sleep vs uiSleep

From Bohemia Interactive Community
Revision as of 14:15, 15 July 2022 by Lou Montana (talk | contribs) (Some wiki formatting)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

sleep pauses the waiting when the game is paused, where uiSleep does not.

sleep uiSleep
// sleep 5; _t = time + 5; waitUntil { time >= _t };
// uiSleep 5; _t = diag_tickTime + 5; waitUntil { diag_tickTime >= _t };

When the simulation is interrupted, time freezes, but not diag_tickTime. Also time at the start of in init.sqf is often reported as 0, even if the mission has already started.