Creates a PFH object, that will execute code every frame, or every x number of seconds.
_function | The function you wish to execute. <CODE> |
_delay | The amount of time in seconds between executions, 0 for every frame. (optional, default: 0) <NUMBER> |
_args | Parameters passed to the function executing. (optional) <ANY> |
_start | Function that is executed when the PFH is added. (optional) <CODE> |
_end | Function that is executed when the PFH is removed. (optional) <CODE> |
_runCondition | Condition that has to return true for the PFH to be executed. (optional, default {true}) <CODE> |
_exitCondition | Condition that has to return true to delete the PFH object. (optional, default {false}) <CODE> |
_private | List of local variables that are serialized between executions. (optional) <CODE> |
_this | The PFH logic. <LOCATION> |
More variables are attached to this PFH logic than can be retrieved via ‘getVariable’. (_this getVariable “params”) It is not advised to overwrite these variables with ‘setVariable’!
”params” | Parameters passed by this function. Same as _args from above. <ANY> |
”handle” | A number representing the handle of the PFH. <NUMBER> |
”private” | List of local variables that are serialized between executions. Same as _private from above. ARRAY |
”start” | Same as _start from above. <CODE> |
”end” | Same as _end from above. <CODE> |
”run” | Same as _function from above. <CODE> |
”run_condition” | Same as _runCondition from above. <CODE> |
”exit_condition” | Same as _exitCondition from above. <CODE> |
”serialize” | Internal reserved variable. |
”deserialize” | Internal reserved variable. |
The PFH logic can be used to store additional custom variables.
_logic | The PFH logic. <LOCATION> |
[ { systemChat format ["frame! params: %1", _this getVariable "params"]; }, 0, ["some_params", [1,2,3]], { systemChat format ["start! params: %1", _this getVariable "params"]; _test = 127; }, { systemChat format ["end! params: %1", _this getVariable "params"]; systemChat str [_test] }, { random 1 > 0.5 }, { random 1 > 0.8 }, "_test" ] call CBA_fnc_createPerFrameHandlerObject;
Nou & Jaynus, donated from ACRE project code for use by the community; commy2