<- [[.:prplreference| PRPL reference]] <- [[.:prplreference#Scripts|Scripts]] ===== OperateWhilePaused ===== ^Arguments^Result^Notation^ | bool | | [ bool - ] | === Description === Set whether the Core will operate while the game is paused. Good for animations or buttons. This may need to be called in :awake to guard against save/load. (Untested, may work without) This command is per script, not per Core. So, should a Core carry multiple copies of a script, or muliple different scripts, some may OperateWhilePaused while others do not. [[.:ispaused|IsPaused]] is useful to combine with this command. Note: This command must be run before taking effect - place in [[,:awake|:awake]], [[.:gameloaded|:GameLoaded]] or just unpause until this command executes. Note: It is recommended to disable this mode in [[,;destroyed|:destroyed]] if used, to prevent the carryover issues that CRPL sometimes had with it. It may not be necessary. === Examples === once @awake #On recompile, do what would be done when the game is loaded. 0 ->CirclePoint endonce GetMousePosition CurrentPixelCoords Distance 6 lt if #Mouseover "Hello" SetText endif IsPaused if return #Only go on if the game is running endif #We shall move in a circle around the lower-left corner of the map. But not if the game is paused. <-CirclePoint 0.03 add ->CirclePoint Self <-CirclePoint cos 20 mul <-CirclePoint sin 20 mul SetUnitPixelCoords :awake 1 OperateWhilePaused :destroyed 0 OperateWhilePaused