sleep vs uiSleep

From Bohemia Interactive Community
Revision as of 18:49, 26 December 2024 by Killzone Kid (talk | contribs)
(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 = uiTime + 5; waitUntil { uiTime >= _t };

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