uiSleep: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Some wiki formatting)
No edit summary
Line 15: Line 15:
|gr1= Program Flow
|gr1= Program Flow


|descr= Suspend execution of script for given UI time. [[uiSleep]] is a sleep method to delay script execution where script time/simulation time is stopped.
|descr= Suspend execution of script for given [[uiTime]]. [[uiSleep]] is a sleep method to delay script execution where script time/simulation time is stopped.
[[uiSleep]] is basically using the system time (uiTime more specifically) and not simulation time.
[[uiSleep]] is basically using the system time (uiTime more specifically) and not simulation time.
So in the cases where [[sleep]] would get stuck indefinitely, [[uiSleep]] can still be used to effectively delay script execution for example in pause or in a mission briefing or an editor or when simulation is paused in general.
So in the cases where [[sleep]] would get stuck indefinitely, [[uiSleep]] can still be used to effectively delay script execution for example in pause or in a mission briefing or an editor or when simulation is paused in general.

Revision as of 18:41, 26 December 2024

Hover & click on the images for description

Description

Description:
Suspend execution of script for given uiTime. uiSleep is a sleep method to delay script execution where script time/simulation time is stopped. uiSleep is basically using the system time (uiTime more specifically) and not simulation time. So in the cases where sleep would get stuck indefinitely, uiSleep can still be used to effectively delay script execution for example in pause or in a mission briefing or an editor or when simulation is paused in general.
Groups:
Program Flow

Syntax

Syntax:
uiSleep delay
Parameters:
delay: Number
Return Value:
Nothing

Examples

Example 1:
In singleplayer:
setAccTime 0.25; // slows down time sleep 1; // waits for 1 second in-game, 4 IRL seconds (1 / 0.25) setAccTime 0; // freezes simulation // sleep 1; // would wait forever uiSleep 1; // waits for 1 IRL second

Additional Information

See also:
sleep waitUntil canSuspend spawn execVM Control Structures sleep vs uiSleep

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note