Running Graphs
Last updated
Last updated
Open Logic Graphs can be instantiated at runtime.
When creating a graph in runtime, you pass an Outer (a context), which is an object reference. This allows you to create graphs that are tied to specific objects or actors.
You can create a new runtime worker using either the Create Runtime Worker from Object or Create Runtime Worker from Struct static functions accessible in any object.
Ensure that you store the runtime worker in a variable to prevent it from being garbage collected by Unreal Engine.
To execute an event, use the Multi Execute Event
function from the Runtime Worker.
This function locates all references of the event task and executes them.
You can use the Multi Execute Event Deferred
function which returns an event context.
This deferred approach allows you to change variables on these event tasks before starting the graph with the Finish Execute function.
Open Logic provides functions to synchronize a runtime worker to a graph editor, allowing direct access to runtime tasks within node widget classes.
Bind Runtime Worker
updates all existing node widgets and any newly created ones to update the runtime task.
To access the runtime task of a node widget once it is bound, use the Runtime Task Object from the NodeBase widget class.