Navigation
API > API/Runtime > API/Runtime/AIModule > API/Runtime/AIModule/BehaviorTree
References
| Module | AIModule |
| Header | /Engine/Source/Runtime/AIModule/Classes/BehaviorTree/BehaviorTreeTypes.h |
| Include | #include "BehaviorTree/BehaviorTreeTypes.h" |
Syntax
struct FBehaviorTreeInstance
Remarks
Data required for instance of single subtree
Variables
| Type | Name | Description | |
|---|---|---|---|
| TArray< UBTAuxiliaryNode * > | ActiveAuxNodes | Active auxiliary nodes | |
| UBTNode * | ActiveNode | Active node in template | |
| TEnumAsByte< EBTActiveNode::Type > | ActiveNodeType | Active node type | |
| FBTInstanceDeactivation | DeactivationNotify | Delegate sending a notify when tree instance is removed from active stack | |
| uint8 | InstanceIdIndex | Index of identifier (BehaviorTreeComponent.KnownInstances) | |
| TArray< uint8 > | InstanceMemory | Memory: instance | |
| TArray< FBehaviorTreeParallelTask > | ParallelTasks | Active parallel tasks | |
| UBTCompositeNode * | RootNode | Root node in template |
Constructors
| Type | Name | Description | |
|---|---|---|---|
FBehaviorTreeInstance
(
const FBehaviorTreeInstance& Other |
Copying FBehaviorTreeInstance constructor has been deprecated in favor of move-constructor | ||
FBehaviorTreeInstance
(
FBehaviorTreeInstance&& Other |
|||
FBehaviorTreeInstance
(
int32 MemorySize |
Destructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddToActiveAuxNodes
(
UBTAuxiliaryNode* AuxNode |
Add specified node to the active nodes list | |
| void | AddToParallelTasks
(
FBehaviorTreeParallelTask&& ParallelTask |
Add new parallel task | |
| void | Cleanup
(
UBehaviorTreeComponent& OwnerComp, |
Cleanup node instances | |
| void | CleanupNodes
(
UBehaviorTreeComponent& OwnerComp, |
Worker for updating all nodes | |
| void | DeactivateNodes
(
FBehaviorTreeSearchData& SearchData, |
Deactivate all active aux nodes and remove their requests from SearchData | |
| void | |||
| void | ExecuteOnEachAuxNode
(
TFunctionRef< void(const UBTAuxiliaryNode&)> ExecFunc |
Iterate on auxiliary nodes and call ExecFunc on each of them. | |
| void | ExecuteOnEachParallelTask
(
TFunctionRef< void(const FBehaviorTreeParallelTask&, const int32)> ExecFunc |
Iterate on parallel tasks and call ExecFunc on each of them. | |
| TArrayView< UBTAuxiliaryNode *const > | Get list of all active auxiliary nodes | ||
| uint32 | |||
| TArrayView< const uint8 > | Get instance memory | ||
| TArrayView< const FBehaviorTreeParallelTask > | Get list of all active parallel tasks | ||
| bool | HasActiveNode
(
uint16 TestExecutionIndex |
Check if instance has active node with given execution index | |
| void | |||
| void | Initialize
(
UBehaviorTreeComponent& OwnerComp, |
Initialize memory and create node instances | |
| bool | IsValidParallelTaskIndex
(
const int32 Index |
Indicates if the provided index is a valid parallel task index | |
| void | MarkParallelTaskAsAbortingAt
(
int32 TaskIndex |
Mark parallel task at given index as pending abort | |
| void | RemoveFromActiveAuxNodes
(
UBTAuxiliaryNode* AuxNode |
Remove specified node from the active nodes list | |
| void | RemoveParallelTaskAt
(
int32 TaskIndex |
Remove parallel task at given index | |
| void | Remove all auxiliary nodes from active nodes list | ||
| void | SetInstanceMemory
(
const TArray< uint8 >& Memory |
Set instance memory |
Operators
| Type | Name | Description | |
|---|---|---|---|
| FBehaviorTreeInstance & | operator=
(
FBehaviorTreeInstance&& Other |
Deprecated Functions
| Type | Name | Description | |
|---|---|---|---|
FBehaviorTreeInstance
(
const FBehaviorTreeInstance& Other |
Copying FBehaviorTreeInstance constructor has been deprecated in favor of move-constructor | ||
| FBehaviorTreeInstance & | operator=
(
const FBehaviorTreeInstance& Other |
Copying FBehaviorTreeInstance assignement operator has been deprecated in favor of move assignement operator |