BehaviorTree¶
23 tools for behavior trees with their children, decorators and services, blackboards and their keys, and running a tree in PIE.
Back to the index.
add_behavior_tree_child¶
Additive Idempotent
Add a child under a BehaviorTree composite: a composite (Selector/Sequence/SimpleParallel) when composite is given, or a leaf task (Wait/MoveTo/PlaySound/RunBehavior/...) when task_class is given; exactly one of the two. The child is appended to the parent's Children (array order = execution order). Authoring is data-only: ParentNode/ExecutionIndex are assigned by the BT runtime at load (run_behavior_tree). Idempotent by child_name within the parent, whatever its kind. The returned child_name is how you address a composite as a parent for further children. Configure the node (a MoveTo's key, a Wait's time) with set_behavior_tree_node_property; read its settings with get_object_info on its object_path from get_behavior_tree_info. A failed save makes success false, with saved=false and save_error, the child kept in memory.
| Parameter | Type | Required | Description |
|---|---|---|---|
behavior_tree_path |
string | yes | Path to the UBehaviorTree asset (its RootNode must already be set via set_behavior_tree_root). |
composite |
string | no | Concrete composite class: "Selector" | "Sequence" | "SimpleParallel" (or a BTComposite_* class name). Give this or task_class, not both. |
task_class |
string | no | Concrete task class: "Wait" | "MoveTo" | "PlaySound" | "RunBehavior" | "FinishWithResult" (or a BTTask_* class name). Give this or composite, not both. |
parent_name |
string | no | Optional parent composite name (a child_name from a prior add); "Root" or omitted targets the RootNode. |
child_name |
string | no | Optional stable name for the new node (its identity for idempotency/addressing); defaults to the class type without its BTComposite_/BTTask_ prefix. |
Returns: { behavior_tree_path: string, parent_name: string, child_name: string, child_class: string, child_kind: "composite"|"task", already_exists: bool, child_count: int, saved: bool, save_error?: string }
add_behavior_tree_decorator¶
Additive Idempotent
Attach a decorator (execution condition) to a specific child-edge of a BehaviorTree composite. The decorator is appended to that child's Decorators array and gates whether the child may run. Authoring is data-only: ParentNode/ExecutionIndex are assigned by the BT runtime at load (run_behavior_tree). Idempotent by decorator_name within the child-edge. Configure it (key, condition) with set_behavior_tree_node_property; read: get_object_info on its object_path.
| Parameter | Type | Required | Description |
|---|---|---|---|
behavior_tree_path |
string | yes | Path to the UBehaviorTree asset (its RootNode must already be set, with the target child added). |
child_name |
string | yes | Name of the existing child (a child_name from a prior add_behavior_tree_child) whose edge the decorator gates. |
decorator_class |
string | yes | Concrete decorator class: "Cooldown" | "Loop" | "TimeLimit" | "Blackboard" | ... (or a BTDecorator_* class name). |
parent_name |
string | no | Optional parent composite name owning the child-edge; "Root" or omitted targets the RootNode. |
decorator_name |
string | no | Optional stable name for the new decorator (its identity for idempotency); defaults to the decorator type. |
Returns: { behavior_tree_path: string, parent_name: string, child_name: string, decorator_name: string, decorator_class: string, already_exists: bool, decorator_count: int, saved: bool, save_error?: string }
add_behavior_tree_service¶
Additive Idempotent
Attach a service (background tick) to a BehaviorTree composite. The service is appended to the composite's Services array and ticks while that composite branch is active. Authoring is data-only: ParentNode/ExecutionIndex are assigned by the BT runtime at load (run_behavior_tree). Idempotent by service_name within the composite. Configure it with set_behavior_tree_node_property; read: get_object_info on its object_path.
| Parameter | Type | Required | Description |
|---|---|---|---|
behavior_tree_path |
string | yes | Path to the UBehaviorTree asset (its RootNode must already be set via set_behavior_tree_root). |
service_class |
string | yes | Concrete service class: "DefaultFocus" | "RunEQS" | ... (or a BTService_* class name). |
parent_name |
string | no | Optional composite name to attach the service to; "Root" or omitted targets the RootNode. |
service_name |
string | no | Optional stable name for the new service (its identity for idempotency); defaults to the service type. |
Returns: { behavior_tree_path: string, parent_name: string, service_name: string, service_class: string, already_exists: bool, service_count: int, saved: bool, save_error?: string }
add_blackboard_key¶
Additive Idempotent
Append one key to the own Keys of a UBlackboardData asset loaded by path, re-index its key IDs and save it; no undo step. key_type is Bool, Int, Float, Vector, Rotator, String, Name, Object, Class or Enum (case-insensitive); instance_synced defaults to false. An Object, Class or Enum key gets no base class or enum here: use set_blackboard_key_subsettings. Idempotent: a key of that name and type already there is a success with already_exists=true and saved=false, nothing added or saved (its instance_synced untouched); the same name with another type is an error. A name a parent blackboard already has is an error naming that parent, nothing added: a key of that name would shadow the parent's. verified confirms the key resolves by name. A failed save gives success false, saved=false and save_error, with the key added in memory. Inverse: remove_blackboard_key; read: get_blackboard_data; create the asset: create_blackboard_data.
| Parameter | Type | Required | Description |
|---|---|---|---|
blackboard_path |
string | yes | Path to the UBlackboardData asset. |
key_name |
string | yes | New key name (must be unique on the asset). |
key_type |
string | yes | One of Bool|Int|Float|Vector|Rotator|String|Name|Object|Class|Enum. |
instance_synced |
boolean | no | Whether the key is instance-synced (optional, default false) |
Returns: { blackboard_path: string, key_name: string, key_type: string, key_count: number, verified: bool, saved: bool, already_exists: bool?, save_error: string?, note: string?, keys: [{ name, type, instance_synced }] }
create_behavior_tree¶
Additive Idempotent
Create a UBehaviorTree asset at package_path/name (default folder /Game/AI), optionally bound to the UBlackboardData at blackboard_path, register it and save it; no undo step, and the tree starts with no root node (add one with set_behavior_tree_root). An existing tree at that path is returned with already_exists=true: when blackboard_path names a different blackboard it is rebound and saved (blackboard_rebound=true), otherwise it is left unchanged with saved=false and a message, nothing saved, so a repeat call is idempotent. A blackboard_path that does not load, or a name taken by an asset of another class, is an error; a failed save of a new or rebound tree gives success false with saved=false and save_error. Make the blackboard with create_blackboard_data; read the tree with get_behavior_tree_info; add nodes with add_behavior_tree_child.
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | yes | Asset name (e.g. "BT_Enemy"). |
package_path |
string | no | Target /Game package path (optional, default "/Game/AI") |
blackboard_path |
string | no | Path to a UBlackboardData asset to bind to the new BT (optional) |
Returns: { name: string, package_path: string, behavior_tree_path: string, asset_path: string, blackboard_asset: string?, already_exists: bool, blackboard_rebound: bool?, saved: bool, save_error: string?, message: string? }
create_blackboard_data¶
Additive Idempotent
Create a UBlackboardData asset with no parent at package_path/name (default folder /Game/AI), register it and save it; no undo step. Its only key is the one the engine seeds every new blackboard with, the SelfActor Object key (while AISystem bAddBlackboardSelfKey is on, the default), counted in key_count. Idempotent: a blackboard already at that path is returned unchanged with already_exists=true, saved=false, a message and its key_count, nothing saved. An invalid package name, or a name taken by an asset of another class, is an error; a failed save of the new asset -- refused while PIE runs, under a read-only root, or a read-only file -- gives success false with saved=false and save_error. blackboard_path is the object path the other blackboard tools take. Add keys with add_blackboard_key and constrain them with set_blackboard_key_subsettings; read them with get_blackboard_data; bind it to a tree with create_behavior_tree.
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | yes | Asset name (e.g. "BB_Enemy"). |
package_path |
string | no | Target /Game package path (optional, default "/Game/AI") |
Returns: { name: string, package_path: string, blackboard_path: string, asset_path: string, key_count: number, already_exists: bool, saved: bool, save_error: string?, message: string? }
get_behavior_tree_info¶
Read-only
Read a UBehaviorTree asset found by content path: its name, its blackboard asset with every key it holds in key-ID order, parent blackboard keys first (name, type, instance_synced, the base class or enum subsettings, inherited, and defined_in naming the blackboard that declares the key), and the node tree from RootNode -- each node's name, class and object_path (the path get_properties and set_properties take for its settings), a composite's services and children, and the decorators on each child edge, nested up to 64 levels. Nothing is written. A missing path, or one that does not load as a behavior tree, is an error; a tree with no root gives root_node null. The runtime state of a tree running on an AI actor is get_behavior_tree_status; blackboard asset details: get_blackboard_data; build the tree with set_behavior_tree_root, add_behavior_tree_child, add_behavior_tree_decorator and add_behavior_tree_service. A node's settings: get_object_info on its object_path.
| Parameter | Type | Required | Description |
|---|---|---|---|
behavior_tree_path |
string | yes | Content path of the UBehaviorTree asset, e.g. "/Game/AI/BT_Enemy"; a bare asset name is not resolved |
Returns: { behavior_tree_path: string, name: string, blackboard_asset: string|null, blackboard_keys: [{ name: string, type: string, instance_synced: bool, inherited: bool, defined_in: string }], root_node: object|null }
get_behavior_tree_status¶
Read-only
Read the live state of the behavior tree component driving one actor: has_bt (whether a UBehaviorTreeComponent was found, through the actor's AIController brain or on the actor itself), is_running, is_paused, bt_asset_name (the tree it is running) and active_node_name (the node it is executing, empty when none). The actor is looked up in a running PIE world first, where possessed AI pawns run their trees, then in the editor world; world says which answered (pie or editor) and world_name names it. Read-only. An actor without a tree is a success with has_bt false; an actor found in neither world is an error. Inspect the tree asset itself with get_behavior_tree_info and blackboard values with get_blackboard_value; change the run state with run_behavior_tree, pause_behavior_tree, resume_behavior_tree, restart_behavior_tree or stop_behavior_tree, which look the actor up the same way.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | Object name or label of the AI-possessed pawn, or of its AIController, e.g. 'BP_Guard_C_0'; searched in the PIE world first, then the editor world. |
Returns: { actor_name, world: "pie"|"editor", world_name: string, has_bt: bool, is_running?: bool, is_paused?: bool, bt_asset_name?: string, active_node_name?: string }
get_blackboard_data¶
Read-only
Dump a blackboard from its asset or from a running component. With blackboard_path, which wins when both are given, it reads the UBlackboardData asset: name, parent and key definitions (name, type, instance_synced, base class or enum subsettings). With actor_name, it reads the running UBlackboardComponent of that actor (its AIController blackboard, else one on the actor), the actor looked up in a running PIE world first, then in the editor world, with world (pie or editor) and world_name saying which answered: the component's name, has_valid_asset and num_keys, the key definitions of its blackboard asset as keys, and entries with each key's name, type and current value as text; a component with no asset gives empty lists. Either way every key is listed in key-ID order, those inherited from parent blackboards first, each with inherited and defined_in naming the asset that declares it. Nothing is written. No parameter, an asset that does not load, an actor found by object name or label in neither world, or no running blackboard is an error. One key: get_blackboard_value; write a value: set_blackboard_value; add a key: add_blackboard_key.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | no | Object name or label of the pawn, its AIController, or an actor with its own UBlackboardComponent, whose running blackboard to dump, searched in the PIE world first, then the editor world (first match); ignored when blackboard_path is given |
blackboard_path |
string | no | Content path of a UBlackboardData asset to read instead, e.g. "/Game/AI/BB_Enemy"; takes precedence over actor_name |
Returns: { actor_name: string?, world: "pie"|"editor"? (actor mode), world_name: string? (actor mode), blackboard_asset: string?, name: string?, parent: string?, component_name: string? (actor mode), has_valid_asset: bool? (actor mode), num_keys: number? (actor mode), keys: [{ name, type, instance_synced, base_class?, enum_type?, enum_name?, inherited, defined_in }], entries: [{ name, type, value, inherited, defined_in }]? (actor mode), key_count: number }
get_blackboard_value¶
Read-only
Read one key of the running blackboard of an actor (its AIController blackboard, else one on the actor). The actor is looked up in a running PIE world first, then in the editor world; world says which answered (pie or editor) and world_name names it. value is a number for Int, Float and Enum keys, a bool for Bool, else a string (objects as paths). Read-only.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | Object name or label of the actor whose blackboard to query, searched in the PIE world first, then the editor world (first match) |
key_name |
string | yes | Name of the blackboard key to retrieve |
Returns: { actor_name: string, world: "pie"|"editor", world_name: string, key_name: string, key_type: string, value: number|string|bool }
pause_behavior_tree¶
Destructive
Pause the behavior tree of an actor (its AIController brain component, else a UBehaviorTreeComponent on the actor) with PauseLogic. The actor is looked up in a running PIE world first, then in the editor world; world says which answered (pie or editor) and world_name names it. paused is always true, not read back; was_running is measured. Runtime state only, nothing saved. An actor found in neither world, or one with no behavior tree component, is an error. Continue it with resume_behavior_tree.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | Object name or label of the pawn, its AIController, or an actor with a UBehaviorTreeComponent, searched in the PIE world first, then the editor world (first match). |
Returns: { actor_name, world: "pie"|"editor", world_name: string, paused, was_running }
remove_behavior_tree_child¶
Destructive Idempotent
Remove a child, composite or task, from a BehaviorTree composite. Inverse of add_behavior_tree_child: drops the matching entry from the parent's Children array and saves. With kind, only child-edges of that kind are considered (a node of the other kind with the same name is untouched, and an index pointing at the other kind is an error); omitted, an edge of either kind matches. child_kind reports the kind of the edge removed. Idempotent: a missing child returns removed:false / already_absent:true. A failed save makes success false, with saved=false and save_error, the removal kept in memory.
| Parameter | Type | Required | Description |
|---|---|---|---|
behavior_tree_path |
string | yes | Path to the UBehaviorTree asset. |
child_name |
string | no | Name of the child to remove (a child_name from a prior add_behavior_tree_child); provide this or 'index'. |
index |
number | no | Alternative to child_name: 0-based position in the parent's Children array. |
kind |
string | no | Optional edge kind to match: "composite" or "task"; omitted matches either. Any other value is an error. |
parent_name |
string | no | Optional parent composite name owning the child; "Root" or omitted targets the RootNode. |
Returns: { behavior_tree_path: string, parent_name: string, child_name: string, child_kind: "composite"|"task" (the edge removed; the requested kind, or absent, when nothing matched), removed: bool, already_absent: bool, child_count: int, saved: bool, save_error?: string }
remove_behavior_tree_decorator¶
Destructive Idempotent
Remove a decorator (execution condition) from a specific child-edge of a BehaviorTree composite. Inverse of add_behavior_tree_decorator: drops the matching entry from that child's Decorators array (FBTCompositeChild::Decorators). Idempotent: a missing decorator returns removed:false / already_absent:true.
| Parameter | Type | Required | Description |
|---|---|---|---|
behavior_tree_path |
string | yes | Path to the UBehaviorTree asset. |
child_name |
string | yes | Name of the existing child (a child_name from a prior add) whose edge the decorator gates. |
decorator_name |
string | no | Name of the decorator to remove (a decorator_name from a prior add_behavior_tree_decorator); provide this or 'index'. |
index |
number | no | Alternative to decorator_name: 0-based position in the child-edge's Decorators array. |
parent_name |
string | no | Optional parent composite name owning the child-edge; "Root" or omitted targets the RootNode. |
Returns: { behavior_tree_path: string, parent_name: string, child_name: string, decorator_name: string, removed: bool, already_absent: bool, decorator_count: int, saved: bool, save_error?: string }
remove_behavior_tree_service¶
Destructive Idempotent
Remove a service (background tick) from a BehaviorTree composite. Inverse of add_behavior_tree_service: drops the matching entry from the composite's Services array (UBTCompositeNode::Services). Idempotent: a missing service returns removed:false / already_absent:true.
| Parameter | Type | Required | Description |
|---|---|---|---|
behavior_tree_path |
string | yes | Path to the UBehaviorTree asset. |
service_name |
string | no | Name of the service to remove (a service_name from a prior add_behavior_tree_service); provide this or 'index'. |
index |
number | no | Alternative to service_name: 0-based position in the composite's Services array. |
parent_name |
string | no | Optional composite name the service is attached to; "Root" or omitted targets the RootNode. |
Returns: { behavior_tree_path: string, parent_name: string, service_name: string, removed: bool, already_absent: bool, service_count: int, saved: bool, save_error?: string }
remove_blackboard_key¶
Destructive Idempotent
Remove a key from a UBlackboardData asset and save it. Inverse of add_blackboard_key: drops the matching FBlackboardEntry from UBlackboardData::Keys (then UpdateKeyIDs to re-index). Addresses the key by key_name (as add_blackboard_key created it) or by index into the asset's own Keys array (parent-chain keys are not touched). Idempotent: a missing key returns removed:false / already_absent:true.
| Parameter | Type | Required | Description |
|---|---|---|---|
blackboard_path |
string | yes | Path to the UBlackboardData asset. |
key_name |
string | no | Name of the key to remove (as passed to add_blackboard_key); provide this or 'index'. |
index |
number | no | Alternative to key_name: 0-based position in this asset's own Keys array (excludes inherited parent keys). |
Returns: { blackboard_path: string, key_name: string, key_type: string?, removed: bool, already_absent: bool, key_count: number, saved: bool, save_error?: string, keys: [{ name, type, instance_synced }] }
restart_behavior_tree¶
Destructive
Restart the current behavior tree of an actor from its root (RestartTree), through its AIController brain component or a UBehaviorTreeComponent on the actor; a stopped tree starts again from the last tree it ran. The actor is looked up in a running PIE world first, then in the editor world; world says which answered (pie or editor) and world_name names it. restarted is always true, not measured: check get_behavior_tree_status. Runtime state only, nothing saved. An actor found in neither world, or one with no behavior tree component, is an error.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | Name or label of the AI-possessed pawn (or AIController) whose UBehaviorTreeComponent to restart, searched in the PIE world first, then the editor world. |
Returns: { actor_name, world: "pie"|"editor", world_name: string, restarted: bool }
resume_behavior_tree¶
Destructive
Resume a behavior tree paused by pause_behavior_tree (ResumeLogic), through the actor's AIController brain component or a UBehaviorTreeComponent on the actor. The actor is looked up in a running PIE world first, then in the editor world; world says which answered (pie or editor) and world_name names it. Returns was_paused and is_paused, both read from the component. Runtime state only, nothing saved. An actor found in neither world, or one with no behavior tree component, is an error.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | Name or label of the AI-possessed pawn (or AIController) whose UBehaviorTreeComponent to resume, searched in the PIE world first, then the editor world. |
Returns: { actor_name, world: "pie"|"editor", world_name: string, was_paused: bool, is_paused: bool }
run_behavior_tree¶
Destructive
Start a BehaviorTree asset with AAIController::RunBehaviorTree on an AIController or the pawn it possesses. The actor is looked up in a running PIE world first, where a placed pawn is possessed by its AI controller, then in the editor world, where no pawn is possessed (so an editor-world pawn errors with no AIController); world says which answered (pie or editor) and world_name names it. Returns started and ai_controller; runtime state only, nothing is saved. An actor found in neither world, a tree that does not load, or no AIController is an error. Read the run with get_behavior_tree_status; stop it with stop_behavior_tree.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | Object name or label of the pawn or AIController, searched in the PIE world first, then the editor world (first match). |
behavior_tree_path |
string | yes | Asset path of the UBehaviorTree, e.g. "/Game/AI/BT_Enemy"; a bare asset name is not resolved. |
Returns: { actor_name: string, world: "pie"|"editor", world_name: string, behavior_tree_path: string, started: bool, ai_controller: string }
set_behavior_tree_node_property¶
Destructive Idempotent
Write one setting of one node of a BehaviorTree asset -- a composite, task, decorator or service found by its node name -- then save the tree; no undo step. This is how a placed node is told what to do: a MoveTo's BlackboardKey, a Wait's WaitTime, a Blackboard decorator's key and condition. property_name is an editable property of the node's class or a dotted path into it. A blackboard key selector takes the key's NAME as a string: the key must exist in the tree's blackboard (or a parent) and be a type the selector accepts, else an error naming the keys; a value-or-key pair (WaitTime) takes a plain value for its DefaultValue or {"key": "<blackboard key>"}, a key of a type the pair accepts (a float pair takes a Float key); anything else takes typed JSON (numbers, bools, enum names, structs as objects). A property the class does not have, one that is not editable, or a value that does not fit is an error and nothing is written. The reply re-reads the property (value_after). Read: get_object_info on the node's object_path; place nodes: add_behavior_tree_child / add_behavior_tree_decorator / add_behavior_tree_service.
| Parameter | Type | Required | Description |
|---|---|---|---|
behavior_tree_path |
string | yes | Path to the UBehaviorTree asset. |
node_name |
string | yes | Name of the node (its child_name, decorator_name or service_name); "Root" for the root composite. |
property_name |
string | yes | Editable property of the node's class (e.g. "BlackboardKey", "WaitTime", "AcceptableRadius") or a dotted path into one ("WaitTime.DefaultValue"). |
value |
any | yes | The value: a key name string for a blackboard key selector; a plain value or {"key": name} for a value-or-key pair; typed JSON otherwise. |
parent_name |
string | no | Optional name of the composite (or task) holding the node, to pick one of several nodes with the same name. |
Returns: { behavior_tree_path, node_name, node_class, property_name, value_after, key_type?, saved, save_error? }
set_behavior_tree_root¶
Destructive Idempotent
Give a BehaviorTree asset a new, empty root composite (Selector or Sequence) in one undo step, then save the asset. WARNING: the current root and everything under it (children, decorators, services) are dropped from the tree, so use it once on a tree from create_behavior_tree, which starts with no root, or to start a tree over. Then build under the root with add_behavior_tree_child, add_behavior_tree_decorator and add_behavior_tree_service, inspect with get_behavior_tree_info and run it with run_behavior_tree; for a StateTree use set_state_tree_root instead. Each call makes a fresh empty root, so repeating it ends in the same state but discards anything added since. An unsupported composite or a tree that does not load is an error and nothing changes. A failed save (always while PIE runs) makes success false, with saved=false and save_error, the new root kept in memory.
| Parameter | Type | Required | Description |
|---|---|---|---|
behavior_tree_path |
string | yes | UBehaviorTree asset as a package or object path, e.g. "/Game/AI/BT_Guard". |
composite |
string | no | "Selector" (default: runs children until one succeeds) or "Sequence" (runs children until one fails), case ignored. |
Returns: { behavior_tree_path: string, composite: string, has_root_node: bool, root_node_class: string, saved: bool, save_error: string? }
set_blackboard_key_subsettings¶
Destructive Idempotent
Constrain an existing blackboard key's subsettings on a UBlackboardData asset and save. This is the SECOND HALF of add_blackboard_key, which only sets EntryName/KeyType/bInstanceSynced: it fills the per-type filter the editor would otherwise make you pick by hand -- BaseClass for an Object/Class key, EnumType for an Enum key. At least one of base_class / enum_type is required, and the one you supply must match the key's type. A value already in place is a no-op: already_set=true and saved=false, nothing saved.
| Parameter | Type | Required | Description |
|---|---|---|---|
blackboard_path |
string | yes | Path to the UBlackboardData asset. |
key_name |
string | yes | Name of the existing key to constrain. |
base_class |
string | no | Class path/name (e.g. "/Script/Engine.Actor" or "Actor") for an Object/Class key (optional). |
enum_type |
string | no | Enum path/name (e.g. "/Script/Engine.ECollisionChannel") for an Enum key (optional). |
Returns: { blackboard_path: string, key_name: string, key_type: string, base_class: string?, enum_type: string?, enum_name: string?, already_set: bool, saved: bool, save_error: string?, note: string?, keys: [...] }
set_blackboard_value¶
Destructive Idempotent
Write one key of the running blackboard of an actor (its AIController blackboard, else one on the actor), converting the value string by key type. The actor is looked up in a running PIE world first, then in the editor world; world says which answered (pie or editor) and world_name names it. The key is read back: set is whether it now holds the converted value (false makes success false), and value_read_back is its value as text. An unparsable number or vector is written as 0; an object or class path that does not resolve is an error and nothing changes. Runtime state only, nothing saved. Verify with get_blackboard_value.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | Object name or label of the actor whose blackboard to modify, searched in the PIE world first, then the editor world (first match) |
key_name |
string | yes | Name of the blackboard key to set |
value |
string | no | Value as a string, converted by key type: "42", "0.5", "true" or "1", a name, an enum index, a vector "X=1 Y=2 Z=3", a rotator "P=0 Y=90 R=0", an object or class path. Omitted means empty (0, false, none). |
Returns: { actor_name: string, world: "pie"|"editor", world_name: string, key_name: string, key_type: string, value: string, value_read_back: string, set: bool }
stop_behavior_tree¶
Destructive
Stop the behavior tree of an actor with StopTree (Safe mode), through its AIController brain component or else a UBehaviorTreeComponent on the actor. The actor is looked up in a running PIE world first, then in the editor world; world says which answered (pie or editor) and world_name names it. Runtime state only, nothing saved. was_running is read before the stop (running and not paused); stopped is true when a started tree, running or paused, is no longer started afterwards. A tree that was not started is not an error: success with stopped false and a note. A tree still started after the call (a task still aborting) is an error. An actor found in neither world, or one with no behavior tree component, is an error. Unlike pause_behavior_tree it cannot be continued with resume_behavior_tree: start again with restart_behavior_tree (the last tree) or run_behavior_tree.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | Object name or label of the pawn or AIController, searched in the PIE world first, then the editor world (first match) |
Returns: { actor_name: string, world: "pie"|"editor", world_name: string, was_running: bool, stopped: bool, note?: string }