Skip to content

@temporary-escape/mod-sdk / BehaviorTreeBuilder

Class: BehaviorTreeBuilder ​

Defined in: behaviors.ts:190

Composes a behavior tree on the host through the __Behaviors_* host functions. addNode returns a BehaviorNode wrapper; createKey allocates a mod-defined blackboard key; register consumes the builder, after which the tree is addressable by name from ComponentAgent.behaviorName.

Constructors ​

Constructor ​

ts
new BehaviorTreeBuilder(): BehaviorTreeBuilder;

Defined in: behaviors.ts:193

Returns ​

BehaviorTreeBuilder

Methods ​

addNode() ​

ts
addNode(
   parent: BehaviorNode | null, 
   type: NodeType, 
   name: string
): BehaviorNode;

Defined in: behaviors.ts:198

Adds a node; pass null as parent for the tree's root node.

Parameters ​

ParameterType
parentBehaviorNode | null
typeNodeType
namestring

Returns ​

BehaviorNode


createKey() ​

ts
createKey(name: string): BlackboardKey;

Defined in: behaviors.ts:206

Allocates a mod-defined blackboard key and returns its slot.

Parameters ​

ParameterType
namestring

Returns ​

BlackboardKey


register() ​

ts
register(name: string, replace?: bool): void;

Defined in: behaviors.ts:212

Parameters ​

ParameterTypeDefault value
namestringundefined
replaceboolfalse

Returns ​

void