canSuspend: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " \| *('''[a-zA-Z0-9]+''') \|r1=" to " \|s1= $1 |r1=")
m (Text replacement - " \|s1=" to " |s1=")
Line 10: Line 10:
{{Feature | Informative |The definition of [[Scheduler#Scheduled_Environment|scheduled]] and [[Scheduler#Unscheduled_Environment|unscheduled environment]] is not the same as whether or not the script execution can or cannot be suspended. For example while .''sqs'' and .''fsm'' scripts are [[Scheduler#Scheduled_Environment|scheduled]] (i.e. added to the [[Scheduler|scheduler]]: [[diag_activeSQSScripts]], [[diag_activeMissionFSMs]]), they cannot use [[sleep]] or be suspended like [[execVM]] or [[spawn]] scripts can, therefore [[canSuspend]] for these types of scripts will return [[false]]. }}
{{Feature | Informative |The definition of [[Scheduler#Scheduled_Environment|scheduled]] and [[Scheduler#Unscheduled_Environment|unscheduled environment]] is not the same as whether or not the script execution can or cannot be suspended. For example while .''sqs'' and .''fsm'' scripts are [[Scheduler#Scheduled_Environment|scheduled]] (i.e. added to the [[Scheduler|scheduler]]: [[diag_activeSQSScripts]], [[diag_activeMissionFSMs]]), they cannot use [[sleep]] or be suspended like [[execVM]] or [[spawn]] scripts can, therefore [[canSuspend]] for these types of scripts will return [[false]]. }}


\|s1= '''canSuspend'''
|s1= '''canSuspend'''


|r1= [[Boolean]]
|r1= [[Boolean]]

Revision as of 16:45, 13 June 2021

Hover & click on the images for description

Description

Description:
Description needed
Groups:
Program Flow

Syntax

Syntax:
canSuspend
Return Value:
Boolean

Examples

Example 1:
onEachFrame { systemChat str canSuspend; //false [] spawn {hint str canSuspend}; //true onEachFrame {}; };
Example 2:
Make sure the function code is always spawned even when called:mysleep = { if (!canSuspend) exitWith {_this spawn mysleep}; sleep _this; hint ("slept " + str _this); }; 5 call mysleep;

Additional Information

See also:
sleepuiSleepwaitUntilcallspawnexecVMisRemoteExecutedisRemoteExecutedJIPremoteExecutedOwnerisUIContextisGamePausedisGameFocused

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