UBTNode

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

AIModule

Header

/Engine/Source/Runtime/AIModule/Classes/BehaviorTree/BTNode.h

Include

#include "BehaviorTree/BTNode.h"

Syntax

class UBTNode :
    public UObject,
    public IGameplayTaskOwnerInterface

Variables

Name Description

Protected variable

uint8: 1

 

bCreateNodeInstance

If set, node will be instanced instead of using memory block and template shared with all other BT components

Protected variable

uint8: 1

 

bOwnsGameplayTasks

Set to true if task owns any GameplayTasks.

Public variable

FString

 

NodeName

Node name

Constructors

Name Description

Public function

UBTNode

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function Const

void

 

CleanupInSubtree

(
    UBehaviorTreeComponent& OwnerComp,
    uint8* NodeMemory,
    EBTMemoryClear::Type CleanupType
)

Called on removing subtree to cleanup memory

Public function Virtual Const

void

 

CleanupMemory

(
    UBehaviorTreeComponent& OwnerComp,
    uint8* NodeMemory,
    EBTMemoryClear::Type CleanupType
)

Cleanup memory block

Public function Virtual Const

void

 

DescribeRuntimeValues

(
    const UBehaviorTreeComponent& Owne...,
    uint8* NodeMemory,
    EBTDescriptionVerbosity::Type Verbo...,
    TArray< FString >& Values
)

Gathers description of all runtime parameters

Public function

void

 

ForceInstancing

(
    bool bEnable
)

Sets bCreateNodeInstance flag, do NOT call this function on already pushed tree instance!

Public function Const

UBlackboardD...

 

GetBlackboardAsset()

Public function Const

UBehaviorTre...

 

GetBTComponentForTask

(
    UGameplayTask& Task
)

Public function Const

uint16

 

GetExecutionIndex()

Public function Virtual Const

uint16

 

GetInstanceMemorySize()

Size of instance memory

Public function Const

uint16

 

GetMemoryOffset()

Public function Const

UBTNode *...

 

GetNextNode()

Public function Virtual Const

FName

 

GetNodeIconName()

Get the name of the icon used to display this node in the editor

Public function Const

UBTNode *...

 

GetNodeInstance

(
    const UBehaviorTreeComponent& Owne...,
    uint8* NodeMemory
)

Public function Const

UBTNode *...

 

GetNodeInstance

(
    FBehaviorTreeSearchData& SearchDat...
)

Public function Const

const T *...

 

GetNodeMemory

(
    const FBehaviorTreeSearchData& Sea...
)

Public function Const

T *

 

GetNodeMemory

(
    FBehaviorTreeSearchData& SearchDat...
)

Public function Const

T *

 

GetNodeMemory

(
    FBehaviorTreeInstance& BTInstance
)

Public function Const

const T *...

 

GetNodeMemory

(
    const FBehaviorTreeInstance& BTIns...
)

Public function Const

FString

 

GetNodeName()

Public function Const

UBTComposite...

 

GetParentNode()

Public function Const

FString

 

GetRuntimeDescription

(
    const UBehaviorTreeComponent& Owne...,
    uint8* NodeMemory,
    EBTDescriptionVerbosity::Type Verbo...
)

Public function Virtual Const

uint16

 

GetSpecialMemorySize()

Size of special, hidden memory block for internal mechanics

Public function Const

T *

 

GetSpecialNodeMemory

(
    uint8* NodeMemory
)

Get special memory block used for hidden shared data (e.g. node instancing)

Public function Virtual Const

FString

 

GetStaticDescription()

Public function Const

UBehaviorTre...

 

GetTreeAsset()

Public function Const

uint8

 

GetTreeDepth()

Public function Virtual Const

UWorld *

 

GetWorld()

Public function Const

bool

 

HasInstance()

Public function

void

 

InitializeExecutionOrder

(
    UBTNode* NextNode
)

Fill in data about execution order

Public function Virtual

void

 

InitializeFromAsset

(
    UBehaviorTree& Asset
)

Initialize any asset related data

Public function Const

void

 

InitializeInSubtree

(
    UBehaviorTreeComponent& OwnerComp,
    uint8* NodeMemory,
    int32& NextInstancedIndex,
    EBTMemoryInit::Type InitType
)

Called on creating subtree to set up memory and instancing

Public function Virtual Const

void

 

InitializeMemory

(
    UBehaviorTreeComponent& OwnerComp,
    uint8* NodeMemory,
    EBTMemoryInit::Type InitType
)

Initialize memory block

Public function

void

 

InitializeNode

(
    UBTCompositeNode* InParentNode,
    uint16 InExecutionIndex,
    uint16 InMemoryOffset,
    uint8 InTreeDepth
)

Fill in data about tree structure

Public function Const

bool

 

IsInjected()

Public function Const

bool

 

IsInstanced()

Public function

void

 

MarkInjectedNode()

Sets bIsInjected flag, do NOT call this function unless you really know what you are doing!

Public function

T *

 

NewBTAITask

(
    UBehaviorTreeComponent& BTComponen...
)

Public function Virtual

void

 

OnInstanceCreated

(
    UBehaviorTreeComponent& OwnerComp
)

Called when node instance is added to tree

Public function Virtual

void

 

OnInstanceDestroyed

(
    UBehaviorTreeComponent& OwnerComp
)

Called when node instance is removed from tree

Public function Virtual

void

 

OnNodeCreated()

Called after creating new node in behavior tree editor, use for versioning

Public function Virtual

void

 

SetOwner

(
    AActor* ActorOwner
)

Gets called only for instanced nodes(bCreateNodeInstance == true).

Public function Virtual Const

bool

 

UsesBlueprint()

Get whether this node is using a blueprint for its logic

Overridden from IGameplayTaskOwnerInterface

Name Description

Public function Virtual Const

AActor *

 

GetGameplayTaskAvatar

(
    const UGameplayTask* Task
)

Get "body" of task's owner / default, having location in world (e.g. Owner = AIController, Avatar = Pawn)

Public function Virtual Const

uint8

 

GetGameplayTaskDefaultPriority()

Get default priority for running a task

Public function Virtual Const

AActor *

 

GetGameplayTaskOwner

(
    const UGameplayTask* Task
)

Get owner of a task or default one when task is null

Public function Virtual Const

UGameplayTas...

 

GetGameplayTasksComponent

(
    const UGameplayTask& Task
)

Finds tasks component for given GameplayTask, Task.GetGameplayTasksComponent() may not be initialized at this point!

Public function Virtual

void

 

OnGameplayTaskInitialized

(
    UGameplayTask& Task
)

Notify called after GameplayTask finishes initialization (not active yet)

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback