- [[crpl:crplreference|CRPL reference]] <- [[crpl:crplreference#utility_commands|Utility Commands]]
===== OperateWhilePaused =====
^Arguments^Result^Notation^
| b1 | |'' -- ''|
=== Description ===
Set to TRUE to allow this script to run while the game is paused. This should be called in the
[[crpl:docs:func_awake|:awake]] function to ensure the flag is set after loading a saved game.
Use [[crpl:docs:IsPaused]] to determine whether or not the game is currently in a paused state.
OperateWhilePaused set to TRUE is known to cause bugs with other scripts attached to the same CRPL Core that do not operate while paused. There is a chance they will mistakenly inherit this flag when unwanted and run paused as well.
If you're using this function, manually set it to FALSE in all your other scripts to avoid bugs.
Effects made with CreateEffect are outside the CPRL Core and will not animate while paused. Movement
orders issued via QueueMove will continue to execute while paused. Timers and delays will continue to run
down while paused. This only affects the current script, not the entire CRPL Core. It is recommended to
use two scripts, one that operates while paused and one that does not, to split out the desired behavior
of your custom CRPL Core.
=== Examples ===
#Enable operation while paused
:awake
OperateWhilePaused(TRUE)