sleep vs uiSleep: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Some wiki formatting)
No edit summary
 
Line 12: Line 12:
| <sqf>
| <sqf>
// uiSleep 5;
// uiSleep 5;
_t = diag_tickTime + 5;
_t = uiTime + 5;
waitUntil { diag_tickTime >= _t };
waitUntil { uiTime >= _t };
</sqf>
</sqf>
|}
|}


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.
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.

Latest revision as of 18:49, 26 December 2024

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.