uiSleep: Difference between revisions
Jump to navigation
Jump to search
m (Text replace - "{{uc:{{PAGENAME}}}}" to "{{uc:{{PAGENAME}}}} {{uc:{{PAGENAME}}}}") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
(52 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{RV|type=command | ||
| arma2 |= | |game1= arma2 | ||
|version1= 1.05 | |||
|1. | |game2= arma2oa | ||
|version2= 1.50 | |||
| | |game3= tkoh | ||
|version3= 1.00 | |||
| | |game4= arma3 | ||
|version4= 0.50 | |||
| | |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. | ||
[[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. | |||
|s1= [[uiSleep]] delay | |||
|p1= delay: [[Number]] | |||
|r1= [[Nothing]] | |||
|x1= In singleplayer: | |||
<sqf> | |||
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 | |||
</sqf> | |||
</ | |||
|seealso= [[sleep]] [[waitUntil]] [[canSuspend]] [[spawn]] [[execVM]] [[Control Structures]] [[sleep vs uiSleep]] | |||
[[ | }} | ||
[[ | |||
[[ | |||
[[ | |||
[[ |
Latest revision as of 02:27, 18 April 2023
Description
- Description:
- Suspend execution of script for given UI time. 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
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
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