/tg/ Station 13 - Modules - TypesVar Details

subtree

Subtree node: a named, re-usable BT subgraph.

Subtypes override New() to build an arbitrary internal tree and assign its root node to root. tick() delegates entirely to root.tick() and returns whatever it returns.

This decouples the subtree's identity (its type path) from any specific composite semantics (selector/parallel/sequence). The root can be any node type.

The controller's tree-walk helpers (setup_bt_observers, reset_bt_tick_states) descend through the root pointer to reach all internal nodes.

Vars

behavior_nodeslist of BT node descriptors defining this subtree's root. resolve_node_children() builds root from this during tree construction.
behavior_tree_jsonRepo-relative path to the .bt.json source file for this subtree (e.g. "code/datums/ai/bots/bot_patrol.bt.json"). resolve_node_children() derives the compiled path from this and loads the tree at runtime.
bindingsAny bindings this subtree has; assigned by the json
override_idSet this to allow runtime overriding of this subtree, useful for things like pet commands!
override_nodeActive override subtree. When set, tick() delegates to this node instead of root. Set to null to deactivate the override. Managed by set_behavior_tree_override() only.
rootThe internal root node. Populated by resolve_node_children(). Do not set directly.

Var Details

behavior_nodes

list of BT node descriptors defining this subtree's root. resolve_node_children() builds root from this during tree construction.

behavior_tree_json

Repo-relative path to the .bt.json source file for this subtree (e.g. "code/datums/ai/bots/bot_patrol.bt.json"). resolve_node_children() derives the compiled path from this and loads the tree at runtime.

bindings

Any bindings this subtree has; assigned by the json

override_id

Set this to allow runtime overriding of this subtree, useful for things like pet commands!

override_node

Active override subtree. When set, tick() delegates to this node instead of root. Set to null to deactivate the override. Managed by set_behavior_tree_override() only.

root

The internal root node. Populated by resolve_node_children(). Do not set directly.