Order of Operations¶
Parts of Logic Driver operate in a deterministic order and is important to know for more advanced use cases, like manual event binding or evaluating variables in Pro.
State Machine Blueprint (General Usage)¶
-
Initialize - Prepares the state machine, instantiating all nodes and mapping them out for access. This must be called before use and is called automatically when using
CreateStateMachineInstance
or when using State Machine Components withInitialize on Begin Play
checked. -
Start - Begins running the state machine. Usually this is called manually.
-
Update - Update the state machine. This call is done automatically unless you have disabled tick.
-
Stop - Stop execution immediately. When stopped it is possible to start the state machine again, however the execution will resume from the entry states.
-
Shutdown - Stops the state machine and frees some internal resources.
Initialize
must be called again before use. This is generally not necessary to call.
State Machine Graph¶
The following is listed in order of execution when running a state machine.
On Root State Machine Start¶
Fired for all nodes in the graph when a state machine blueprint is first started.
On Node Initialized¶
Fired when a state is entered.
-
Graph Properties evaluate.
-
The state receives the event.
-
Outgoing transitions and connected conduits configured to
EvalWithTransitions
receive this event.
On State Begin¶
When a state becomes active, right after Initialize
.
On State Update¶
When the update call is issued to the state machine and the active state hasn't exited from a transition.
Can Enter Transition¶
Conditional logic of transitions (and conduits) is evaluated. This function returning true signals the previous state should exit and the next state become active.
On State End¶
After a transition has evaluated to true and the active state is switching to another state.
On Node Shutdown¶
Fired after On State End
.
-
Outgoing transitions and connected conduits configured to
EvalWithTransitions
receive this event. -
The state receives the event.
On Transition Entered¶
Fired for the specific transitions or conduits that are currently being taken. This is fired after the Shutdown
sequence is called of all impacted nodes, and before the Initialize
sequence of the next set of nodes.
- Since the next state hasn't initialized yet, graph properties haven't evaluated yet either, but you can do so by calling EvaluateGraphProperties from the node instance.
On Root State Machine Stop¶
Fired for all nodes in the graph when a state machine blueprint is stopped.
Local Graphs and State Stack ¶
When you assign a custom node class, extra Instance
nodes are added to the local graph. These are calls to the functions you defined in your node class blueprint. Execution happens exactly in the order you see, allowing you to perform additional logic before or after the class functions execute. As a reminder you can call GetNodeInstance
in this graph to retrieve the class version of your node, with all functions and variables available for use.
For the state stack order of execution, see the State Stack Guide.