Skip to content

StateTree

57 tools for State Trees: states, tasks, transitions and conditions, evaluators, considerations, parameters and bindings, compiling and validating.

Back to the index.

add_consideration

Additive

Append a utility consideration node (a struct deriving from FStateTreeConsiderationBase, with its default values) to the Considerations of one state of a StateTree asset, in one undo step, then save the asset without compiling it. Considerations score the state 0..1 when its parent picks children by utility (set_state_selection_behavior, e.g. TrySelectChildrenWithHighestUtility). Each call appends another node, even of a type the state already has, so a repeat call stacks a duplicate. A missing tree, editor data or state, or a struct that is not found or is not a consideration, is an error before anything changes; a failed save (for example while PIE runs) makes success false with the change only in memory. Set its values (Constant, Input...) with set_consideration_property; list them: list_considerations; inverse: remove_consideration; check the tree with compile_state_tree.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard", as list_state_trees (trees[].path) returns it.
state_name string yes Name of the state that gets the consideration, as get_state_tree_info lists it; the first state with that name in a depth-first walk is used.
consideration_class string yes Consideration struct name or /Script path, a leading F optional (e.g. "StateTreeFloatInputConsideration"), or one of the aliases Constant, FloatInput / Float Input, EnumInput / Enum Input.

Returns: { tree_path, state_name, consideration_class, consideration_count, added, saved }

add_evaluator

Additive Idempotent

Attach an evaluator node (by struct name, via reflection) to a UStateTree; evaluators are TREE-scoped (they live on UStateTreeEditorData::Evaluators, not on a state) and tick for the whole tree, so this command takes no state_name. Idempotent: an evaluator of the same struct already present is not appended again.

Parameter Type Required Description
tree_path string yes Asset path to the UStateTree.
evaluator_class string yes Evaluator struct name or /Script path; must derive from StateTreeEvaluatorBase (e.g. "TestEval_A" from the StateTree test suite, or any project/plugin evaluator struct).

Returns: { tree_path, evaluator_class, evaluator_count, already_existed, added, saved }

add_state

Destructive Idempotent

Add a top-level state of type State (a new SubTree; it cannot create a child of another state) to an existing StateTree asset, then compile and save it; there is no undo step. Create the tree first with create_state_tree; then fill the state with add_state_task, add_state_transition and add_consideration, make it the root with set_state_tree_root, change its type with set_state_type, delete it with remove_state and read the hierarchy back with get_state_tree_info. Idempotent: when a state at any depth already has that name (case-insensitive), nothing is changed or saved and already_existed is true. A tree that does not load or has no editor data is an error; a failed save (for example while PIE runs) makes success false with the state only in memory.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard", as create_state_tree or list_state_trees (trees[].path) returns it.
state_name string yes Name of the new state, e.g. "Patrol"; it should be unique in the whole tree, because every other state command finds a state by this name (the first match, depth-first).

Returns: { tree_path, state_name, state_count, already_existed, added, saved }

add_state_enter_condition

Additive

Append a new enter-condition node, of the struct named by condition_struct and with that struct's default values, to the EnterConditions of one state of a StateTree asset, in one undo step, then save the asset without compiling it. Each call appends another node, so repeating it stacks a duplicate condition. A missing tree, editor data, state or struct, or a struct that does not derive from FStateTreeConditionBase, is an error before anything changes; a failed save (for example while PIE runs) makes success false with the change only in memory. Struct names: list_condition_types; list them: list_conditions; set a field: set_condition_property; inverse: remove_state_enter_condition; a condition on a transition: add_state_transition_condition; check the result with compile_state_tree.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".
state_name string yes Name of the state that gets the condition; the first state with that name in a depth-first walk of the hierarchy is used
condition_struct string yes Condition struct name or /Script path; must derive from StateTreeConditionBase (e.g. "StateTreeRandomCondition"); a leading F is optional

Returns: { tree_path, state_name, condition_struct, enter_condition_count, added, saved }

add_state_task

Additive

Append a task node, of the struct named by task_struct with its default values, to the Tasks of one state of a StateTree asset, in one undo step, then save the asset without compiling it. Use it for work that runs while that state is active; for a task that runs as long as the whole tree runs use add_state_tree_global_task. Each call appends another node, so a repeat call stacks a duplicate task. A missing tree, editor data or state, or a struct that is not found or does not derive from FStateTreeTaskBase, is an error before anything changes; a failed save (for example while PIE runs) makes success false with the change only in memory. Struct names: list_task_types; make the state first with add_state; set a field: set_task_property; list: list_tasks; inverse: remove_task; check the tree with compile_state_tree.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard", as list_state_trees (trees[].path) returns it.
state_name string yes Name of the state that gets the task, as get_state_tree_info lists it; the first state with that name in a depth-first walk is used.
task_struct string yes Task struct name or /Script path, as list_task_types returns it; must derive from StateTreeTaskBase (e.g. "StateTreeDebugTextTask"); a leading F is optional.

Returns: { tree_path, state_name, task_struct, task_count, added, saved }

add_state_transition

Additive

Append a transition from from_state to to_state on a StateTree asset (trigger OnStateCompleted, type GotoState), then compile and save it; each call adds another one. event_name only fills RequiredEvent, which matters with an OnEvent trigger: set that with set_state_transition. Returns transition_count and saved.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".
from_state string yes Name of the source state, which owns the new transition.
to_state string yes Name of the target state the transition goes to.
event_name string no Gameplay tag stored as the transition RequiredEvent, e.g. "AI.Event.Alert"; a tag that is not registered is ignored without error.

Returns: { tree_path, from_state, to_state, event_name, transition_count, added, saved }

add_state_transition_condition

Additive

Append a new condition node, of the struct named by condition_struct and with that struct's default values, to the Conditions of one transition of a state of a StateTree asset, then save the asset without compiling it; there is no undo step. The transition is addressed by state_name and transition_index, its 0-based position in that state's list as get_state_tree_info reports it (transitions[].index). Each call appends another node. A missing tree or state, a missing or out-of-range transition_index, or a struct that does not derive from FStateTreeConditionBase is an error before anything changes; a failed save (for example while PIE runs) makes success false with the change only in memory. Struct names: list_condition_types; set a field: set_condition_property with target_kind "transition"; inverse: remove_state_transition_condition; a condition for entering a state: add_state_enter_condition.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".
state_name string yes Name of the state owning the transition; the first state with that name in a depth-first walk of the hierarchy is used
transition_index integer yes 0-based index of the transition within that state (the index field of get_state_tree_info transitions); required
condition_struct string yes Condition struct name or /Script path; must derive from StateTreeConditionBase (e.g. "StateTreeRandomCondition")

Returns: { tree_path, state_name, transition_index, condition_struct, condition_count, added, saved }

add_state_tree_binding

Destructive Idempotent

Bind a UStateTree root parameter (source) to a target node's input property (target), so the node reads the parameter at runtime. The target defaults to a state Task, but target_kind selects any FStateTreeEditorNode list: enter_condition/consideration (on the state) or global_task/evaluator (on the tree) — the binding anchor (FStateTreeEditorNode::ID) is identical for every kind. Authors an FStateTreePropertyPathBinding in the editor data's property bindings (idempotent per target path — re-binding the same target replaces it); validate it resolves with compile_state_tree.

Parameter Type Required Description
tree_path string yes Asset path to the UStateTree.
target_property string yes Name of the target node's input property to bind (the binding target), e.g. "BindableText".
source_parameter string yes Name of the root parameter to bind from (the binding source; add it with add_state_tree_parameter first).
state_name string no Name of the state owning the target node (required for target_kind task|enter_condition|consideration; ignored for global_task|evaluator, which live on the tree).
target_kind string no Which node list holds the target: "task" (default) | "enter_condition" | "consideration" | "global_task" | "evaluator".
target_index number no Optional index into the selected node list (default 0).

Returns: { tree_path: string, state_name: string?, target_kind: string, target_index: int, target_property: string, source_parameter: string, source_struct_id: string, target_struct_id: string, bound: bool, binding_count: int, saved: bool }

add_state_tree_global_task

Additive

Append a global task node, of the task struct named by task_struct with its default values, to a StateTree asset, then save the asset without compiling it; there is no undo step. Global tasks belong to the tree, not to a state, and run for as long as the tree runs: for a task that runs only while one state is active use add_state_task instead. Each call appends another node, so repeating it stacks a duplicate task. A tree that does not load or has no editor data, a struct that is not found, or one that does not derive from FStateTreeTaskBase is an error before anything changes; a failed save (for example while PIE runs) makes success false with the task only in memory. Struct names: list_task_types; list them: list_state_tree_global_tasks; set a field: set_state_tree_global_task_property; inverse: remove_state_tree_global_task; check the result with compile_state_tree.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard", as list_state_trees (trees[].path) returns it.
task_struct string yes Task struct name as list_task_types returns it, or its /Script path; a leading F is optional; must derive from FStateTreeTaskBase (e.g. "StateTreeDebugTextTask").

Returns: { tree_path, task_struct, global_task_count, added, saved }

add_state_tree_parameter

Additive Idempotent

Add a typed parameter to the root parameter bag of a StateTree asset (the parameters that bindings and per-component overrides read), in one undo step, then save the asset without compiling it. Idempotent: when the tree already has a parameter of that name (case-insensitive) and type, nothing is changed or saved and the reply says added false and already_existed true; the same name with another type is an error and nothing changes. parameter_name is the name in the tree. A missing tree or editor data is an error; a failed save (for example while PIE runs) makes success false with the change only in memory. Set its value with set_state_tree_parameter; inverse: remove_state_tree_parameter; bind it with add_state_tree_binding; per-actor values: set_state_tree_component_parameter_override.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".
parameter_name string yes Name of the parameter to add, e.g. "Speed"; a name already in the bag, compared case-insensitively, is never added a second time.
parameter_type string no Scalar type: bool, int (default), int64, float, double, name, string, text, byte; case is ignored, int32 and fstring are accepted as aliases, and an unrecognised type silently becomes a string parameter

Returns: { tree_path, parameter_name, parameter_type, parameter_count, added, already_existed, saved, note? }

compile_state_tree

Destructive

Validate and compile a StateTree asset through the StateTree editing subsystem (the editor's Compile button), then save it to disk, and report compiled with the error and warning counts of the compiler log. Use it after authoring with add_state, add_state_task, add_state_transition or set_task_property, which mostly save without compiling; to check a tree without saving it use validate_state_tree, which also returns the messages themselves. The asset is saved even when compilation fails, so compiled false with error_count above 0 still has success true; success is false only when the save fails (for example while PIE runs). A tree that does not load or has no editor data is an error and nothing is compiled. Repeating the call compiles and saves again.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard", as list_state_trees (trees[].path) returns it.

Returns: { tree_path, compiled, error_count, warning_count, message_count, saved }

create_state_tree

Additive

Create a StateTree asset at package_path/tree_name (or load the one already there), giving it any missing editor data, the plugin UMCPStateTreeSchema when it has no schema and a Root state when it has no states, then compile and save it. Returns tree_path, state_count, created and saved.

Parameter Type Required Description
tree_name string yes Asset name without path, e.g. "ST_Guard"; an asset of another class with that name is an error.
package_path string no Content folder for the asset, e.g. "/Game/AI" (default /Game/MCP).

Returns: { tree_path, tree_name, state_count, created, saved }

get_component_state_tree_path

Read-only

Read which StateTree asset the UStateTreeComponent of an editor-world actor runs (its StateTreeRef), without changing anything. The actor is the first whose object name or editor label matches; an actor with no StateTreeComponent gives has_state_tree_component false and an empty state_tree_path, and a component with no tree bound an empty path. Bind or override with set_state_tree_component_parameter_override.

Parameter Type Required Description
actor_label string yes Editor label or object name of the actor to inspect

Returns: { actor_label, has_state_tree_component, component_name?, state_tree_path }

get_condition_info

Read-only

Dump one condition node of a StateTree state as JSON without changing the asset: an enter condition of the state or, with target_kind "transition", a condition of one of its transitions. Returns class, instance_id and properties, the node struct fields (instance data is not included).

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".
state_name string yes Name of the state that owns the condition; the command fails without it.
condition_index integer yes 0-based index into the selected condition list, as counted by list_conditions or get_state_tree_info (transitions[].condition_count).
target_kind string no Which list to read: "state" (default, the state EnterConditions) or "transition" (the Conditions of transition transition_index); any other value reads the enter conditions.
transition_index integer no 0-based index into the state transitions; required when target_kind is "transition" and ignored otherwise.

Returns: { tree_path, state_name, target_kind, transition_index, condition_index, class, instance_id, properties: {...} }

get_condition_property

Read-only

Read one property of a condition node on a StateTree state by reflection, without changing the asset: an enter condition (condition_index), or with target_kind "transition" a condition of transition transition_index. Use it instead of get_properties, which cannot address a node inside a state's condition arrays. Returns the value as JSON with its C++ type and has_value; only node struct properties are reachable, not instance data. Whole node: get_condition_info; write: set_condition_property.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".
state_name string yes Name of the state that owns the condition; the command fails without it.
property string yes Name of a property on the condition node struct, e.g. "bInvert" on a compare condition; case-insensitive.
target_kind string no Which list holds the condition: "state" (default, EnterConditions) or "transition" (Conditions of transition transition_index); any other value means "state".
condition_index integer no 0-based index into the selected condition list; omitting it fails as out of range.
transition_index integer no 0-based index into the state transitions; used only when target_kind is "transition", where omitting it fails.

Returns: { tree_path, state_name, target_kind, transition_index, condition_index, property, type, value, has_value }

get_consideration_info

Read-only

Read one utility consideration of a state of a StateTree asset without changing it: its struct name (class), its instance_id (node GUID), every property of the node struct as JSON (properties), and its instance data -- the per-node values such as the Constant of a Constant consideration or the Input of a Float Input one -- as instance_data with its struct or class name in instance_type (both empty when the consideration has none). Use it to see a whole node at once; for one field use get_consideration_property, to write one set_consideration_property, and to find the index list_considerations. A missing tree, editor data or state, a missing consideration_index, or one out of range is an error.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard", as list_state_trees (trees[].path) returns it.
state_name string yes Name of the state that owns the consideration; the first state with that name in a depth-first walk is used.
consideration_index integer yes 0-based index of the consideration in that state, e.g. 0, as list_considerations reports it (index); required.

Returns: { tree_path, state_name, consideration_index, class, instance_id, properties: {...}, instance_type: string, instance_data: {...} }

get_consideration_property

Read-only

Read one property of a utility consideration node on a StateTree state (consideration_index, from list_considerations) by reflection, without changing the asset. Use it instead of get_properties, which cannot address a node inside a state's Considerations array. Returns the value as JSON with its C++ type and has_value; only node struct properties are reachable, not instance data. Whole node: get_consideration_info; write: set_consideration_property.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".
state_name string yes Name of the state that owns the consideration; the command fails without it.
consideration_index integer yes 0-based index into the state Considerations, as listed by list_considerations.
property string yes Name of a property on the consideration node struct; case-insensitive.

Returns: { tree_path, state_name, consideration_index, property, type, value, has_value }

get_evaluator_info

Read-only

Dump one tree-scoped evaluator of a StateTree asset as JSON without changing it. Returns evaluator_index, class, instance_id and properties, the node struct fields (instance data is not included). Find the index with list_evaluators.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".
evaluator_index integer yes 0-based index into the tree Evaluators, as listed by list_evaluators; out of range is an error.

Returns: { tree_path, evaluator_index, class, instance_id, properties: {...} }

get_evaluator_property

Read-only

Read one property of a tree-scoped evaluator node of a StateTree asset (evaluator_index, from list_evaluators) by reflection, without changing it. Use it instead of get_properties, which cannot address a node inside the tree's Evaluators array. Returns the value as JSON with its C++ type and has_value; only node struct properties are reachable, not instance data. Whole node: get_evaluator_info; write: set_evaluator_property.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".
property string yes Name of a property on the evaluator node struct, e.g. "Name"; case-insensitive.
evaluator_index integer no 0-based index into the tree Evaluators, as listed by list_evaluators; omitting it fails as out of range.

Returns: { tree_path, evaluator_index, property, type, value, has_value }

get_state_tree_info

Read-only

Read the whole structure of a StateTree asset without changing it, as it is in memory (unsaved edits included), or one state's subtree when root_state is given. states has one entry per state, depth-first with the last top-level state first, giving its type, selection behavior, task completion, parent, depth and task, enter-condition, child and transition counts; transitions has one entry per transition with from_state, its index within that state (what the transition commands take), to_state, trigger, priority, event tag, condition count, delay and enabled -- filter it by from_state for one state's transitions; parameters gives each root parameter's type, or its class, struct or enum name, and its value_type. The root_state field of the reply is the first top-level state, empty when there is none. A tree that cannot be loaded or has no editor data, or a root_state that names no state, is an error. One state's nodes: list_tasks, list_conditions, list_considerations; finding trees: list_state_trees; compile check: validate_state_tree.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".
root_state string no Optional state name (the first match in a depth-first walk, case-insensitive): states and transitions, and their counts, then cover only that state, at depth 0, and its descendants. Omitted, the whole tree.

Returns: { tree_path, state_count, states: [{ name, type, selection_behavior, completion, parent, depth, task_count, enter_condition_count, children, transitions }], transition_count, transitions: [{ from_state, index, to_state, trigger, priority, event_tag, condition_count, delay, delay_duration, enabled }], evaluator_count, global_task_count, binding_count, parameter_count, parameters: [{ name, type, value_type }], root_state }

get_state_tree_theme_colors

Read-only

List the theme color palette of a StateTree asset (UStateTreeEditorData Colors) without changing it. Returns count and colors [{display_name, color_ref, r, g, b, a}], color_ref being the GUID that states point to. Takes state_tree_path, not tree_path; set colors with set_state_tree_theme_color.

Parameter Type Required Description
state_tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard"; named state_tree_path here, unlike its sibling tools.

Returns: { count, colors: [{display_name, color_ref, r, g, b, a}] }

get_task_info

Read-only

Read one task of a named state in a StateTree asset without changing it: the task node's struct name (class), its instance_id and every property of the node struct as JSON (properties). The task's instance data is not included. Errors when the tree, its editor data or the state is missing, or task_index is out of range; state_name picks the first state with that name. List a state's tasks with list_tasks; read or write one field with get_task_property or set_task_property; global tasks: list_state_tree_global_tasks.

Parameter Type Required Description
tree_path string yes Asset path to the UStateTree.
state_name string yes Name of the state.
task_index integer yes 0-based index into State->Tasks.

Returns: { tree_path, state_name, task_index, class, instance_id, properties: {...} }

get_task_property

Read-only

Read one property of a task node on a StateTree state (task_index, from list_tasks) by reflection, without changing the asset. Use it instead of get_properties, which cannot address a node inside a state's Tasks array. Returns the value as JSON with its C++ type and has_value; only node struct properties are reachable, not instance data. Whole node: get_task_info; write: set_task_property.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".
state_name string yes Name of the state that owns the task; the command fails without it.
task_index integer yes 0-based index into the state Tasks, as listed by list_tasks.
property string yes Name of a property on the task node struct, e.g. "FontScale" on a debug text task; case-insensitive.

Returns: { tree_path, state_name, task_index, property, type, value, has_value }

list_condition_types

Read-only

List the concrete condition struct types (children of FStateTreeConditionBase, abstract ones skipped) of the loaded modules, sorted by name, for add_state_enter_condition and add_state_transition_condition. Returns count and types [{name, struct_path}]; struct_path is the struct's own path in the module that declares it, so either field can be passed.

Parameter Type Required Description
offset integer no Index of the first entry returned, counted from 0 (default 0). Read the next page at the reply's next_offset.
limit integer no Most entries returned per call, 1..1000 (default 100).

Returns: { count (entries in this page), types: [{ name, struct_path }], total: int, offset: int, limit: int, returned: int, truncated: bool, next_offset: int|null }

list_conditions

Read-only

List the enter conditions of a state. (Transition-level conditions are counted by get_state_tree_info, transitions[].condition_count; a full per-transition dump is not available yet.)

Parameter Type Required Description
tree_path string yes Asset path to the UStateTree.
state_name string yes Name of the state.

Returns: { tree_path, state_name, count, conditions: [{ index, class, instance_id }] }

list_considerations

Read-only

List the utility considerations of one state of a StateTree asset without changing it: count and, per consideration in array order, its index, class (the consideration struct name) and instance_id (the node GUID). A state with none gives count 0 and an empty list; a missing tree, editor data or state is an error. index is what get_consideration_info, get_consideration_property, set_consideration_property and remove_consideration take; add one with add_consideration. Other node lists of a state: list_tasks, list_conditions (enter conditions); tree-scoped nodes: list_evaluators, list_state_tree_global_tasks; every count at once: get_state_tree_info.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".
state_name string yes Name of the state; the first state with that name in a depth-first walk of the hierarchy is used.

Returns: { tree_path, state_name, count, considerations: [{ index, class, instance_id }] }

list_evaluator_types

Read-only

List the concrete evaluator struct types (children of FStateTreeEvaluatorBase, abstract ones skipped) of the loaded modules, sorted by name, for add_evaluator. Returns count and types [{name, struct_path}]; struct_path is the struct's own path in the module that declares it, so either field can be passed.

Parameter Type Required Description
offset integer no Index of the first entry returned, counted from 0 (default 0). Read the next page at the reply's next_offset.
limit integer no Most entries returned per call, 1..1000 (default 100).

Returns: { count (entries in this page), types: [{ name, struct_path }], total: int, offset: int, limit: int, returned: int, truncated: bool, next_offset: int|null }

list_evaluators

Read-only

List the evaluators of a StateTree asset without changing it, as they are in memory (unsaved edits included): count and, per evaluator in array order, its index, class (the evaluator struct name) and instance_id (the node GUID). Evaluators belong to the tree, not to a state, so no state is named; a tree without any gives count 0 and an empty list. A tree that does not load or has no editor data is an error. index is what get_evaluator_info, get_evaluator_property, set_evaluator_property and remove_evaluator take; add one with add_evaluator; the evaluator struct types that exist: list_evaluator_types; tree-scoped tasks: list_state_tree_global_tasks.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard", as list_state_trees (trees[].path) returns it.

Returns: { tree_path, count, evaluators: [{ index, class, instance_id }] }

list_state_tree_bindings

Read-only

List the property bindings stored in the editor data of a StateTree asset, without changing it. Returns count and bindings [{index, source_path, target_path, source_id, target_id}] in index order, paged with offset/limit, where source_id and target_id are the struct GUIDs of the two ends. Add bindings with add_state_tree_binding and remove them with remove_state_tree_binding.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".
offset integer no Index of the first entry returned, counted from 0 (default 0). Read the next page at the reply's next_offset.
limit integer no Most entries returned per call, 1..1000 (default 100).

Returns: { tree_path, count (entries in this page), bindings: [{ index, source_path, target_path, source_id, target_id }], total: int, offset: int, limit: int, returned: int, truncated: bool, next_offset: int|null }

list_state_tree_global_tasks

Read-only

List the global tasks of a StateTree asset (tasks that run for the whole tree, not one state) without changing it. Returns count and global_tasks [{index, class, instance_id}]; index is what set_state_tree_global_task_property and remove_state_tree_global_task take.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".

Returns: { tree_path, count, global_tasks: [{ index, class, instance_id }] }

list_state_trees

Read-only

List the StateTree assets (subclasses included) in a content folder and all its subfolders, from the Asset Registry, without loading or changing them: per tree its object path, asset name and class, sorted by path and paged with offset/limit. A folder with no trees, or one that does not exist, gives count 0 rather than an error. Use it to find the tree_path every other StateTree tool takes; then read one tree's states, transitions and parameters with get_state_tree_info, or create a new one with create_state_tree; the tree a placed component runs: get_component_state_tree_path.

Parameter Type Required Description
package_path string no Content folder to search, recursively, as a long package path with no trailing slash, e.g. "/Game/AI" (default "/Game"); a plugin's content lives under its mount point, e.g. "/MyPlugin".
offset integer no Index of the first entry returned, counted from 0 (default 0). Read the next page at the reply's next_offset.
limit integer no Most entries returned per call, 1..1000 (default 100).

Returns: { package_path, count (entries in this page), trees: [{ path, name, class }], total: int, offset: int, limit: int, returned: int, truncated: bool, next_offset: int|null }

list_task_types

Read-only

List the StateTree task struct types (FStateTreeTaskBase and its children; structs tagged Abstract are skipped) of the modules loaded now, sorted by name, without changing anything: the names add_state_task and add_state_tree_global_task take as task_struct. A task from a plugin whose module is not loaded is not listed. struct_path is the struct's own path in the module that declares it (e.g. /Script/StateTreeModule.StateTreeDelayTask, /Script/GameplayStateTreeModule.StateTreeRunEnvQueryTask), so either field can be passed. Other node types: list_condition_types, list_evaluator_types; the tasks already on a state: list_tasks; on the whole tree: list_state_tree_global_tasks.

Parameter Type Required Description
offset integer no Index of the first entry returned, counted from 0 (default 0). Read the next page at the reply's next_offset.
limit integer no Most entries returned per call, 1..1000 (default 100).

Returns: { count (entries in this page), types: [{ name, struct_path }], total: int, offset: int, limit: int, returned: int, truncated: bool, next_offset: int|null }

list_tasks

Read-only

List the tasks of one state of a StateTree asset without changing it, as they are in memory (unsaved edits included): count and, per task in array order, its index, class (the task struct name) and instance_id (the node GUID). A state with no tasks gives count 0 and an empty list; a missing tree, editor data or state is an error. index is what get_task_info, get_task_property, set_task_property and remove_task take; add a task with add_state_task. Tree-scoped tasks are not here: list_state_tree_global_tasks; other node lists of a state: list_conditions, list_considerations; every state with its counts at once: get_state_tree_info.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard", as list_state_trees (trees[].path) returns it.
state_name string yes Name of the state, as get_state_tree_info lists it; the first state with that name in a depth-first walk is used.

Returns: { tree_path, state_name, count, tasks: [{ index, class, instance_id }] }

remove_consideration

Destructive

Remove one utility consideration, by 0-based index, from the Considerations of one state of a StateTree asset, in one undo step, then save the asset without compiling it; later considerations shift down one index, so a repeat call with the same index removes the next one. Find the index with list_considerations, or check the node first with get_consideration_info. An out-of-range index removes and saves nothing and still succeeds, with removed false and a note. A missing tree, editor data or state, or a missing consideration_index, is an error. A failed save makes success false, with saved false, save_error and the change only in memory. Inverse: add_consideration; other nodes of a state: remove_task, remove_state_enter_condition.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard", as list_state_trees (trees[].path) returns it.
state_name string yes Name of the state that owns the consideration, as get_state_tree_info lists it; the first state with that name in a depth-first walk is used.
consideration_index integer yes 0-based index into the state's Considerations, as list_considerations returns it (considerations[].index).

Returns: { tree_path, state_name, consideration_index, removed, remaining, saved, note?, save_error? }

remove_evaluator

Destructive

Remove one evaluator node from a StateTree asset (evaluators are tree-scoped, so no state is named) by its 0-based index, in one undo step, then save the asset without compiling it; later evaluators shift down one index, and bindings that read from it are not cleaned up (remove_state_tree_binding). Find the index with list_evaluators. Inverse: add_evaluator; a tree-scoped task instead: remove_state_tree_global_task. An out-of-range index removes and saves nothing and still succeeds, with removed false and a note. A missing tree or editor data, or a missing evaluator_index, is an error. A failed save (for example while PIE runs) makes success false, with saved false and save_error, the removal only in memory.Check the tree afterwards with compile_state_tree.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard", as list_state_trees (trees[].path) returns it.
evaluator_index integer yes 0-based index of the evaluator in the tree, e.g. 0, as list_evaluators reports it; required.

Returns: { tree_path, evaluator_index, removed, remaining, saved }

remove_state

Destructive Idempotent

Remove one state, found by name at any depth, from a StateTree asset with its tasks, conditions and transitions, in one undo step, then save the asset without compiling it. With with_descendants true (the default) its child states go too; with false they are kept and take its place in its parent's list (or at the top level), in their order, as moved_children and new_parent report. states_removed counts the states that went, read back from the tree. Transitions in other states that pointed at a removed state are left dangling: fix them with set_state_transition or remove_state_transition, then check with compile_state_tree. Idempotent: a name that matches no state changes and saves nothing and returns removed false with a note. A tree that does not load or has no editor data is an error. A failed save (for example while PIE runs) makes success false, with saved false and save_error, the removal only in memory. Inverse: add_state (top-level states only); see the hierarchy with get_state_tree_info.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard", as list_state_trees (trees[].path) returns it.
state_name string yes Name of the state to remove, as get_state_tree_info lists it; the first state with that name in a depth-first walk is removed.
with_descendants boolean no true (default) removes the state's whole subtree; false removes only the state and moves its children up one level, to where it was.

Returns: { tree_path, state_name, removed, with_descendants, states_removed, moved_children: [string], new_parent (empty at the top level), remaining_top_level, saved, save_error?, note }

remove_state_enter_condition

Destructive

Remove one enter condition, by index, from a state of a StateTree asset and save the asset. An out-of-range index removes nothing and still succeeds, with removed false and a note. Returns removed, remaining and saved; a failed save makes success false, with save_error. For transition conditions use remove_state_transition_condition.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".
state_name string yes Name of the state that owns the condition; the command fails without it.
condition_index integer yes 0-based index into the state EnterConditions, as listed by list_conditions.

Returns: { tree_path, state_name, condition_index, removed, remaining, saved, note }

remove_state_transition

Destructive

Remove one transition, with its conditions, from a state of a StateTree asset by its 0-based index, in one undo step, then save the asset without compiling it; later transitions shift down one index. Find the index in get_state_tree_info (transitions[].index, filtered by from_state). Use it to delete a transition; to change one in place use set_state_transition, to drop only a condition of it use remove_state_transition_condition; inverse: add_state_transition. An out-of-range index removes and saves nothing and still succeeds, with removed false and a note. A missing tree, editor data or state, or a missing transition_index, is an error. A failed save (for example while PIE runs) leaves saved false while success stays true.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard", as list_state_trees (trees[].path) returns it.
state_name string yes Name of the state that owns the transition (its from_state); the first state with that name in a depth-first walk is used.
transition_index integer yes 0-based index of the transition in that state's list, e.g. 0, as get_state_tree_info reports it (transitions[].index); required.

Returns: { tree_path, state_name, transition_index, removed, remaining, saved }

remove_state_transition_condition

Destructive

Remove one condition, by index, from a transition of a StateTree state and save the asset. An out-of-range transition_index is an error; an out-of-range condition_index removes nothing and still succeeds, with removed false. Returns removed, remaining and saved; a failed save makes success false, with save_error.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".
state_name string yes Name of the state that owns the transition; the command fails without it.
transition_index integer yes 0-based index into the state transitions, as listed by get_state_tree_info (transitions[].index).
condition_index integer yes 0-based index into the Conditions of that transition.

Returns: { tree_path, state_name, transition_index, condition_index, removed, remaining, saved, note }

remove_state_tree_binding

Destructive

Remove the property binding whose target is target_property on one node of a StateTree asset (and any binding to a sub-property of it), the way the StateTree editor clears a binding, then save the asset. Nothing bound there is not an error: removed is false and the asset is not saved. Returns removed, removed_count and remaining (bindings left in the tree); list them with list_state_tree_bindings.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".
target_kind string yes Node list of the binding target: "task", "condition" (a state enter condition; "enter_condition" also works), "consideration", "transition" (a transition condition), "global_task" or "evaluator".
target_property string yes Property path of the binding target on that node, as list_state_tree_bindings shows it in target_path, e.g. "BindableText".
state_name string no Name of the state that owns the target node; needed for the task, condition, consideration and transition kinds.
transition_index integer no 0-based index into the state transitions; used only by the transition kind.
target_index integer no 0-based index of the target node in its list, default 0; for the transition kind, the index into the Conditions of that transition.

Returns: { tree_path, target_kind, state_name?, target_index, target_property, target_struct_id, removed, removed_count, remaining, saved }

remove_state_tree_global_task

Destructive

Remove one global task node (a task of the whole tree, not of a state) from a StateTree asset by its 0-based index, in one undo step, then save the asset without compiling it; later global tasks shift down one index. Find the index with list_state_tree_global_tasks. For a task of one state use remove_task; inverse: add_state_tree_global_task. An out-of-range index removes and saves nothing and still succeeds, with removed false and a note. A missing tree or editor data, or a missing global_task_index, is an error. A failed save (for example while PIE runs) makes success false, with saved false and save_error, the removal only in memory.Check the tree afterwards with compile_state_tree.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard", as list_state_trees (trees[].path) returns it.
global_task_index integer yes 0-based index of the global task, e.g. 0, as list_state_tree_global_tasks reports it (global_tasks[].index); required.

Returns: { tree_path, global_task_index, removed, remaining, saved }

remove_state_tree_parameter

Destructive Idempotent

Remove one parameter, by name, from the root parameter bag of a StateTree asset (the parameters that bindings and per-component overrides read), in one undo step, then save the asset without compiling it. Idempotent: a name the tree does not have (compared case-insensitively) changes and saves nothing and answers removed false with a note. Bindings that read the parameter are left in place: find them with list_state_tree_bindings and drop them with remove_state_tree_binding. Inverse: add_state_tree_parameter; to change only its value use set_state_tree_parameter; the current parameters: get_state_tree_info. A tree that does not load or has no editor data is an error. A failed save (for example while PIE runs, or with the .uasset read-only) makes success false, with saved false, save_error and the removal only in memory.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard", as list_state_trees (trees[].path) returns it.
parameter_name string yes Name of the root parameter, as get_state_tree_info lists it in parameters[].name, e.g. "Speed"; compared case-insensitively.

Returns: { tree_path, parameter_name, removed, parameter_count, saved, save_error?, note? }

remove_task

Destructive

Remove one task node from a state of a StateTree asset by its 0-based index, in one undo step, then save the asset without compiling it; later tasks shift down one index, and bindings that targeted the task are not cleaned up (remove_state_tree_binding). Find the index with list_tasks. For a tree-scoped task use remove_state_tree_global_task; inverse: add_state_task. An out-of-range index removes and saves nothing and still succeeds, with removed false and a note. A missing tree, editor data or state, or a missing task_index, is an error. A failed save (for example while PIE runs) makes success false, with saved false and save_error, the removal only in memory.Check the tree afterwards with compile_state_tree.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard", as list_state_trees (trees[].path) returns it.
state_name string yes Name of the state that owns the task; the first state with that name in a depth-first walk is used.
task_index integer yes 0-based index of the task in that state, e.g. 0, as list_tasks reports it (tasks[].index); required.

Returns: { tree_path, state_name, task_index, removed, remaining, saved }

set_condition_property

Destructive Idempotent

Write one property of a condition node on a StateTree state by reflection and save the asset: an enter condition, or with target_kind "transition" a condition of transition transition_index. set_properties cannot reach it: the node is a struct in the state's condition list, addressed here by state_name and condition_index. Only node struct properties, not instance data. No undo step, no compile (compile_state_tree). The same value again gives value_changed false and still saves; a failed save makes success false, with saved=false and save_error. Read: get_condition_property.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".
state_name string yes Name of the state that owns the condition; the command fails without it.
property string yes Name of a property on the condition node struct, e.g. "bInvert" on a compare condition; case-insensitive.
value any yes New value as JSON: a number, bool or string, or an object for a struct property, applied through FJsonObjectConverter.
target_kind string no Which list holds the condition: "state" (default, EnterConditions) or "transition" (Conditions of transition transition_index); any other value means "state".
transition_index integer no 0-based index into the state transitions; used only when target_kind is "transition", where omitting it fails.
condition_index integer no 0-based index into the selected condition list; omitting it fails as out of range.

Returns: { tree_path, state_name, target_kind, transition_index, condition_index, property, set, value_changed, saved, new_value?, save_error? }

set_consideration_property

Destructive Idempotent

Write one property of a utility consideration node of a StateTree state (state_name, consideration_index) and save the asset. set_properties cannot reach it: the node is a struct in the state's Considerations list. Node struct properties only, not instance data. No undo, no compile (compile_state_tree); the same value again gives value_changed false yet saves, and a failed save makes success false, with saved=false and save_error. Read: get_consideration_property.

Parameter Type Required Description
tree_path string yes Asset path to the UStateTree.
state_name string yes Name of the state.
consideration_index integer yes 0-based index into State->Considerations.
property string yes FProperty name on the consideration struct.
value any yes JSON value to apply (any FJsonObjectConverter-supported type).

Returns: { tree_path, state_name, consideration_index, property, set, value_changed, saved, new_value?, save_error? }

set_evaluator_property

Destructive Idempotent

Write one property of a tree-scoped evaluator node of a StateTree asset (evaluator_index) by reflection and save the asset. set_properties cannot reach it: the evaluator is a struct in the tree's Evaluators list, not an addressable object. Only node struct properties are reachable, not instance data. No undo step and no compile (compile_state_tree). value_changed false means the value was already there; the asset is saved anyway, and a failed save makes success false, with saved=false and save_error. Read: get_evaluator_property; indexes: list_evaluators.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".
evaluator_index integer yes 0-based index into the tree Evaluators, as listed by list_evaluators; out of range is an error.
property string yes Name of a property on the evaluator node struct; case-insensitive.
value any yes New value as JSON: a number, bool or string, or an object for a struct property, applied through FJsonObjectConverter.

Returns: { tree_path, evaluator_index, property, set, value_changed, saved, new_value?, save_error? }

set_state_completion_type

Destructive Idempotent

Set when a state of a StateTree asset counts as completed from its tasks (UStateTreeState TasksCompletion): All waits for every task, Any (the engine default) for the first one; it is not a success or failure result. One undo step, then the asset is saved without compiling it. It always writes and saves, even when the state already has that value (set is then still true). An unknown completion_type, a missing tree or editor data, or a missing state is an error before anything changes; a failed save (for example while PIE runs) makes success false with the change only in memory. The tasks it aggregates: list_tasks, add_state_task; other state settings: set_state_type, set_state_selection_behavior; read back with get_state_tree_info (states[] task completion); check the tree with compile_state_tree.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard", as list_state_trees (trees[].path) returns it.
state_name string yes Name of the state, as get_state_tree_info lists it; the first state with that name in a depth-first walk is used.
completion_type string yes "All" or "Any" (case-insensitive; the engine default for a new state is Any).

Returns: { tree_path, state_name, completion_type, set, saved }

set_state_selection_behavior

Destructive Idempotent

Set how one state of a StateTree asset is entered when the tree selects it (UStateTreeState SelectionBehavior: enter it, try its children in order, at random or by utility, or follow its transitions), in one undo step, then save the asset without compiling it. A state that already has that behavior changes and saves nothing (changed false, saved false). An unknown behavior name, a missing tree or a missing state is an error before anything changes; a failed save (for example while PIE runs) makes success false with the change only in memory. The utility behaviors score the children through their considerations (add_consideration). Other state settings: set_state_type (its linked_asset_path links another tree), set_state_completion_type; read back with get_state_tree_info; check the tree with compile_state_tree.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".
state_name string yes Name of the state to change; the first state with that name in a depth-first walk of the hierarchy is used
selection_behavior string yes One of None | TryEnterState | TrySelectChildrenInOrder | TrySelectChildrenAtRandom | TrySelectChildrenWithHighestUtility | TrySelectChildrenAtRandomWeightedByUtility | TryFollowTransitions; an EStateTreeStateSelectionBehavior:: prefix is accepted

Returns: { tree_path, state_name, selection_behavior, set, changed, saved, note? }

set_state_transition

Destructive Idempotent

Update any subset of the fields of an existing transition of a state of a StateTree asset -- trigger, priority, type, target state, event tag and payload, enabled flag and delay -- in one undo step, then save the asset without compiling it. Only fields explicitly passed are written; everything else is preserved, and the reply reads every field back. Every input is checked before any is written: an unknown enum name, target_state, event_tag or payload_struct, or a missing or out-of-range transition_index, is an error naming each bad input, and nothing is changed or saved, so errors in a reply is always empty. A call that leaves every field as it was changes and saves nothing (changed false, saved false, a note). A failed save (for example while PIE runs) makes success false. A new transition: add_state_transition; inverse: remove_state_transition; conditions: add_state_transition_condition.

Parameter Type Required Description
tree_path string yes Asset path of the UStateTree
state_name string yes State that owns the transition; the first state with that name in a depth-first walk of the hierarchy is used
transition_index integer yes Index into the state's Transitions array (0-based, transitions[].index of get_state_tree_info); required
trigger string no Optional EStateTreeTransitionTrigger name (None|OnStateCompleted|OnStateTick|OnEvent|OnDelta|...)
priority string no Optional EStateTreeTransitionPriority name (Lowest|Low|Normal|High|Highest)
transition_type string no Optional EStateTreeTransitionType name (None|Succeeded|Failed|GotoState|Parent|NextState|NextSelectableState|NextParent|NextSelectableParent)
target_state string no Optional re-target by state name (only when you want to redirect the edge)
event_tag string no Optional event tag as a literal FGameplayTag string (e.g. "GameplayCue.Movement.Jumped")
payload_struct string no Optional UScriptStruct name or /Script path for the event payload
enabled boolean no Optional bool (defaults preserved when omitted)
delay boolean no Optional bool (when true, delay_duration and delay_variance are honored by the editor)
delay_duration number no Optional number (seconds)
delay_variance number no Optional number (seconds of random variance)

Returns: { tree_path, state_name, transition_index, trigger, priority, transition_type, target_state, event_tag, payload_struct, enabled, delay, delay_duration, delay_variance, applied_fields: [string] (the fields passed), errors: [string], changed, saved, note? }

set_state_tree_component_parameter_override

Destructive Idempotent

Override a single UStateTree root parameter on a UStateTreeComponent living on a placed actor. CRITICAL: the implementation calls UStateTreeStateTreeReference::SetPropertyOverridden(ParamGuid, true) — without this, the runtime reads from the asset default and the per-instance value is silently dropped. The value is written via FInstancedPropertyBag::SetValueSerializedString so the engine parses the string into the parameter's actual type (Bool/Int/Float/Vector/Struct/...). The tree must already declare the parameter; add it with add_state_tree_parameter first. Use clear_overrides=true to remove the override (asset default takes over again) without writing a value. If the component has no bound tree, pass state_tree_path to auto-bind before overriding (cold-start convenience); the public UStateTreeComponent::SetStateTree(UStateTree*) handles the bind through reflection on the protected StateTreeRef member.

Parameter Type Required Description
actor_label string yes Actor label/name that owns the UStateTreeComponent (resolved against the editor world)
parameter_name string no Root parameter name to override (must exist on the bound tree); required unless clear_overrides is true
value string no String-encoded value; type-driven by the parameter's FPropertyBagPropertyDesc. Required unless clear_overrides is true
state_tree_path string no Optional path to a UStateTree to bind the component to if no tree is already bound
clear_overrides boolean no If true, drop all per-instance overrides on the component (asset defaults take over); value is ignored

Returns: { actor_label, component_class, parameter_name, parameter_id, value, was_overridden, cleared, saved, bound_tree }

set_state_tree_global_task_property

Destructive Idempotent

Write one property of an existing global task's node struct in a StateTree asset, by global_task_index, and save the asset; despite the name it adds nothing (create the task with add_state_tree_global_task). set_properties cannot reach a StateTree node, so use this; instance data is not reachable. The tree is not compiled (compile_state_tree). Returns value_changed, new_value and saved; a failed save makes success false, with saved=false and save_error.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".
global_task_index integer yes 0-based index into the tree GlobalTasks, as listed by list_state_tree_global_tasks; out of range is an error.
property string yes Name of a property on the global task node struct, e.g. "FontScale" on a debug text task; case-insensitive.
value any yes New value as JSON: a number, bool or string, or an object for a struct property, applied through FJsonObjectConverter.

Returns: { tree_path, global_task_index, property, set, value_changed, saved, new_value?, save_error? }

set_state_tree_parameter

Destructive Idempotent

Set the value of an existing root parameter of a StateTree asset and save it. Works for bool, byte, int32, int64, float, double, name, string and text parameters; array and other types return an error. Add the parameter first with add_state_tree_parameter. Returns value_changed, new_value and saved.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".
parameter string yes Name of a root parameter that already exists, as listed by get_state_tree_info (parameters[].name); an unknown name is an error.
value any yes New value as JSON matching the parameter type: true or false, a number, or a string for name, string and text parameters.

Returns: { tree_path, parameter, set, value_changed, saved, new_value? }

set_state_tree_root

Destructive Idempotent

Make a top-level state the root of a StateTree asset by moving it to the first SubTree slot, then compile and save it. A nested state is refused. Returns root_state with set and saved, or already_root when it was already first (nothing saved).

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".
root_state_name string yes Name of a top-level state, such as one made by add_state; a state nested under another is refused.

Returns: { tree_path, root_state, already_root, set, saved }

set_state_tree_theme_color

Destructive Idempotent

Upsert a theme color in UStateTreeEditorData::Colors. CRITICAL: if a color with the same DisplayName (case-insensitive) already exists, its ColorRef UUID is preserved — state-level ColorRef references keep resolving, and the editor retains the original color identity in the asset's change history. Newly-created colors get a fresh UUID; the caller is responsible for re-binding any state ColorRefs that referenced an orphaned previous UUID. r/g/b default to 1.0; a defaults to 1.0. The engine stores Colors as a TSet<FStateTreeEditorColor> keyed on ColorRef (display name uniqueness is the caller's responsibility — duplicate names are allowed by the engine but produce ambiguous lookups downstream).

Parameter Type Required Description
state_tree_path string yes Asset path of the UStateTree
color_name string yes Display name (required, case-insensitive lookup)
r number no red 0..1 (default 1.0)
g number no green 0..1 (default 1.0)
b number no blue 0..1 (default 1.0)
a number no alpha 0..1 (default 1.0)

Returns: { state_tree_path, color_name, color_ref, r, g, b, a, was_new, saved }

set_state_type

Destructive Idempotent

Set the type of one state of a StateTree asset (EStateTreeStateType: State, Group, Linked, LinkedAsset or Subtree), in one undo step, then save the asset without compiling it; with linked_asset_path it also points a LinkedAsset state at another StateTree. The state is the first one named state_name in a depth-first walk of the hierarchy. Without linked_asset_path only the type is written: the follow-up the StateTree details panel applies (clearing a group's tasks, resetting a link) does not run. With it, the engine setter UStateTreeState::SetLinkedStateAsset runs: it clears the state's tasks, takes the parameter layout of the linked tree and sets SelectionBehavior to TryEnterState, and the call always writes and saves. A state that already has that type, with no linked_asset_path, changes and saves nothing (changed false, saved false). An unknown type name, a missing tree or state, a linked_asset_path with another state_type, or a linked tree that does not load is an error before anything changes; a failed save makes success false. Read back with get_state_tree_info; selection: set_state_selection_behavior.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".
state_name string yes Name of the state to change; the command fails without it.
state_type string yes Enum value name: State, Group, Linked, LinkedAsset or Subtree (an EStateTreeStateType:: prefix is accepted).
linked_asset_path string no Optional asset path of the UStateTree a LinkedAsset state runs, e.g. "/Game/AI/ST_Sub"; only with state_type LinkedAsset.

Returns: { tree_path, state_name, state_type, linked_asset (the state's linked tree, empty when none), set, changed, saved, note? }

set_task_property

Destructive Idempotent

Write one property of a task's node struct on a StateTree state (state_name + task_index) and save the tree. set_properties cannot reach a StateTree node, so use this; instance data is not reachable. value_changed is false when the value was already held (the tree is still saved). A failed save makes success false, with saved=false and save_error. No undo step, not compiled (compile_state_tree). Read with get_task_property.

Parameter Type Required Description
tree_path string yes Asset path to the UStateTree.
state_name string yes Name of the state.
task_index integer yes 0-based index into State->Tasks.
property string yes FProperty name on the task struct.
value any yes JSON value to apply (any FJsonObjectConverter-supported type).

Returns: { tree_path, state_name, task_index, property, set, value_changed, saved, new_value?, save_error? }

validate_state_tree

Destructive

Compile a StateTree asset in memory and report its errors and warnings without saving: valid, compiled, error_count, warning_count and the messages. It still marks the package dirty and refreshes the compiled data in memory; compile_state_tree compiles and saves.

Parameter Type Required Description
tree_path string yes Asset path of the StateTree, e.g. "/Game/AI/ST_Guard".

Returns: { tree_path, valid, compiled, error_count, warning_count, message_count, saved, errors: [{severity, message}], warnings: [{severity, message}], note }