/tg/ Station 13 - Modules - TypesVar Details - Proc Details

bt_node

Base node for behavior tree nodes

Vars

execution_indexPre-order depth-first index of this node in the tree. Assigned by finalize_tree().
labelShort display label, set at New() by stripping standard path prefixes from the type.
last_execution_indexIndex of the last descendant node in this subtree. Equal to execution_index for leaves.
node_typeNode type identifier.
owning_controllerOwning controller for this node
parent_nodeReference to this node's parent in the resolved tree. Set by ai_controller/finalize_tree(). Null for root-level nodes.

Procs

append_active_nodesAppends this node's active/upcoming state to lines for display. No-op for plain leaf nodes.
append_full_tree_stateAppends this node's full tree state (status + label + children) to lines for display.
assign_execution_indicesAssigns pre-order depth-first execution indices to this node and its subtree. Called once per controller tree by finalize_tree().
collect_reset_childrenAdds all children that must be visited during reset to to_visit. No-op for leaf nodes.
configureApply a configuration list to this node instance by assigning vars directly.
finalize_nodeCalled during finalize_tree() to set owning_controller, register overrides, and enqueue children.
find_by_indexWalks descendants to find the node with the given execution_index. Returns null if not found.
get_childrenReturns the list of direct child bt_node instances for tree traversal. Returns null for leaf nodes (default). Overridden in composites, decorators, and subtrees.
get_status_markerReturns a single-character status marker for display. Overridden by ai_behavior to check running.
has_active_descendantsReturns TRUE if this node or any descendant has an active (running) ai_behavior leaf.
reset_subtree_tick_statesResets this node and all of its descendants, cancelling any behaviors still running in the subtree.
reset_tick_stateResets per-tick state for this node instance. Override in subtypes that hold tick state.
set_descriptor_childrenCalled during build_node_from_descriptor() to resolve and assign child nodes from JSON descriptors.
tickTicked by the ai_controller. Returns BT_SUCCESS, BT_FAILURE, or BT_RUNNING which can change how the parent responds.

Var Details

execution_index

Pre-order depth-first index of this node in the tree. Assigned by finalize_tree().

label

Short display label, set at New() by stripping standard path prefixes from the type.

last_execution_index

Index of the last descendant node in this subtree. Equal to execution_index for leaves.

node_type

Node type identifier.

owning_controller

Owning controller for this node

parent_node

Reference to this node's parent in the resolved tree. Set by ai_controller/finalize_tree(). Null for root-level nodes.

Proc Details

append_active_nodes

Appends this node's active/upcoming state to lines for display. No-op for plain leaf nodes.

append_full_tree_state

Appends this node's full tree state (status + label + children) to lines for display.

assign_execution_indices

Assigns pre-order depth-first execution indices to this node and its subtree. Called once per controller tree by finalize_tree().

collect_reset_children

Adds all children that must be visited during reset to to_visit. No-op for leaf nodes.

configure

Apply a configuration list to this node instance by assigning vars directly.

finalize_node

Called during finalize_tree() to set owning_controller, register overrides, and enqueue children.

find_by_index

Walks descendants to find the node with the given execution_index. Returns null if not found.

get_children

Returns the list of direct child bt_node instances for tree traversal. Returns null for leaf nodes (default). Overridden in composites, decorators, and subtrees.

get_status_marker

Returns a single-character status marker for display. Overridden by ai_behavior to check running.

has_active_descendants

Returns TRUE if this node or any descendant has an active (running) ai_behavior leaf.

reset_subtree_tick_states

Resets this node and all of its descendants, cancelling any behaviors still running in the subtree.

reset_tick_state

Resets per-tick state for this node instance. Override in subtypes that hold tick state.

set_descriptor_children

Called during build_node_from_descriptor() to resolve and assign child nodes from JSON descriptors.

tick

Ticked by the ai_controller. Returns BT_SUCCESS, BT_FAILURE, or BT_RUNNING which can change how the parent responds.