CBA_statemachine_fnc_addState

Description

Adds a state to a state machine.

Parameters

_stateMachinea state machine <LOCATION>
_onStatecode that is executed when state is active (frequency depends on amount of objects active in state machine) <CODE> (Default: {})
_onStateEnteredcode that is executed once when state was entered, after onTransition (also once for the intial state) <CODE> (Default: {})
_onStateLeavingcode that is executed once when exiting state, before onTransition <CODE> (Default: {})
_nameunique state name STRING (Default: “stateX” with X being a unique number)

Returns

_nameunique state name or empty string on error STRING

Examples

_name = [_stateMachine, {}] call CBA_statemachine_fnc_addState;

Author

BaerMitUmlaut

string used by format
Close