UBTCompositeNode

Inheritance Hierarchy

References

Module

AIModule

Header

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

Include

#include "BehaviorTree/BTCompositeNode.h"

Syntax

class UBTCompositeNode : public UBTNode

Variables

Name Description

Protected variable

uint32: 1

 

bApplyDecoratorScope

If set, all decorators in branch below will be removed when execution flow leaves (decorators on this node are not affected)

Protected variable

uint32: 1

 

bUseChildExecutionNotify

If set, NotifyChildExecution will be called

Protected variable

uint32: 1

 

bUseDecoratorsActivationCheck

If set, CanNotifyDecoratorsOnActivation will be called

Protected variable

uint32: 1

 

bUseDecoratorsDeactivationCheck

If set, CanNotifyDecoratorsOnDeactivation will be called

Protected variable

uint32: 1

 

bUseDecoratorsFailedActivationCheck

If set, CanNotifyDecoratorsOnFailedActivation will be called

Protected variable

uint32: 1

 

bUseNodeActivationNotify

If set, NotifyNodeActivation will be called

Protected variable

uint32: 1

 

bUseNodeDeactivationNotify

If set, NotifyNodeDeactivation will be called

Public variable

TArray< FBTComp...

 

Children

Child nodes

Protected variable

uint16

 

LastExecutionIndex

Execution index of last node in child branches

Public variable

TArray< TObject...

 

Services

Service nodes

Constructors

Name Description

Public function

UBTCompositeNode

(
    const FObjectInitializer& ObjectIn...
)

Destructors

Name Description

Public function

~UBTCompositeNode()

Functions

Name Description

Public function Virtual Const

bool

 

CanAbortLowerPriority()

Public function Virtual Const

bool

 

CanAbortSelf()

Protected function Virtual Const

bool

 

CanNotifyDecoratorsOnActivation

(
    FBehaviorTreeSearchData& SearchDat...,
    int32 ChildIdx
)

Check if NotifyDecoratorsOnActivation is allowed, requires bUseDecoratorsActivationCheck flag bUseDecoratorsActivationCheck must be set to true for this function to be called Calling INIT_COMPOSITE_NODE_NOTIFY_FLAGS in the constructor of the node will set this flag automatically

Protected function Virtual Const

bool

 

CanNotifyDecoratorsOnDeactivation

(
    FBehaviorTreeSearchData& SearchDat...,
    int32 ChildIdx,
    EBTNodeResult::Type& NodeResult
)

Check if NotifyDecoratorsOnDeactivation is allowed, requires bUseDecoratorsDeactivationCheck flag bUseDecoratorsDeactivationCheck must be set to true for this function to be called Calling INIT_COMPOSITE_NODE_NOTIFY_FLAGS in the constructor of the node will set this flag automatically

Protected function Virtual Const

bool

 

CanNotifyDecoratorsOnFailedActivation

(
    FBehaviorTreeSearchData& SearchDat...,
    int32 ChildIdx,
    EBTNodeResult::Type& NodeResult
)

Check if NotifyDecoratorsOnFailedActivation is allowed, requires bUseDecoratorsActivationCheck flag bUseDecoratorsFailedActivationCheck must be set to true for this function to be called Calling INIT_COMPOSITE_NODE_NOTIFY_FLAGS in the constructor of the node will set this flag automatically

Public function Virtual Const

bool

 

CanPushSubtree

(
    UBehaviorTreeComponent& OwnerComp,
    uint8* NodeMemory,
    int32 ChildIdx
)

Check if child node can execute new subtree

Public function Const

void

 

ConditionalNotifyChildExecution

(
    UBehaviorTreeComponent& OwnerComp,
    uint8* NodeMemory,
    const UBTNode& ChildNode,
    EBTNodeResult::Type& NodeResult
)

Notify about task execution start

Public function Const

bool

 

DoDecoratorsAllowExecution

(
    UBehaviorTreeComponent& OwnerComp,
    const int32 InstanceIdx,
    const int32 ChildIdx
)

Is child execution allowed by decorators?

Public function Const

int32

 

FindChildToExecute

(
    FBehaviorTreeSearchData& SearchDat...,
    EBTNodeResult::Type& LastResult
)

Find next child branch to execute

Public function Const

uint16

 

GetBranchExecutionIndex

(
    uint16 NodeInBranchIdx
)

Get first execution index of given branch

Public function Const

uint16

 

GetChildExecutionIndex

(
    int32 Index,
    EBTChildIndex ChildMode
)

Public function Const

int32

 

GetChildIndex

(
    FBehaviorTreeSearchData& SearchDat...,
    const UBTNode& ChildNode
)

Get index of child node (handle subtrees)

Public function Const

int32

 

GetChildIndex

(
    const UBTNode& ChildNode
)

Get index of child node

Public function Const

UBTNode *...

 

GetChildNode

(
    int32 Index
)

Public function Const

int32

 

GetChildrenNum()

Public function Const

uint16

 

GetLastExecutionIndex()

Public function Const

int32

 

GetMatchingChildIndex

(
    int32 ActiveInstanceIdx,
    FBTNodeIndex& NodeIdx
)

Find branch containing specified node index

Protected function Const

int32

 

GetNextChild

(
    FBehaviorTreeSearchData& SearchDat...,
    int32 LastChildIdx,
    EBTNodeResult::Type LastResult
)

Get next child to process and store it in CurrentChild

Protected function Virtual Const

int32

 

GetNextChildHandler

(
    FBehaviorTreeSearchData& SearchDat...,
    int32 PrevChild,
    EBTNodeResult::Type LastResult
)

Public function

void

 

InitializeComposite

(
    uint16 InLastExecutionIndex
)

Fill in data about tree structure

Protected function

void

 

InitNotifyFlags

Public function Const

bool

 

IsApplyingDecoratorScope()

Protected function Virtual Const

void

 

NotifyChildExecution

(
    UBehaviorTreeComponent& OwnerComp,
    uint8* NodeMemory,
    int32 ChildIdx,
    EBTNodeResult::Type& NodeResult
)

Called just after child execution, allows to modify result bUseChildExecutionNotify must be set to true for this function to be called Calling INIT_COMPOSITE_NODE_NOTIFY_FLAGS in the constructor of the node will set this flag automatically

Protected function Const

void

 

NotifyDecoratorsOnActivation

(
    FBehaviorTreeSearchData& SearchDat...,
    int32 ChildIdx
)

Runs through decorators on given child node and notify them about activation

Protected function Const

void

 

NotifyDecoratorsOnDeactivation

(
    FBehaviorTreeSearchData& SearchDat...,
    int32 ChildIdx,
    EBTNodeResult::Type& NodeResult,
    const bool bIsInSameActiveInstance
)

Runs through decorators on given child node and notify them about deactivation

Protected function Const

void

 

NotifyDecoratorsOnFailedActivation

(
    FBehaviorTreeSearchData& SearchDat...,
    int32 ChildIdx,
    EBTNodeResult::Type& NodeResult
)

Runs through decorators on given child node and notify them about failed activation

Protected function Virtual Const

void

 

NotifyNodeActivation

(
    FBehaviorTreeSearchData& SearchDat...
)

Called when start enters this node bUseNodeActivationNotify must be set to true for this function to be called Calling INIT_COMPOSITE_NODE_NOTIFY_FLAGS in the constructor of the node will set this flag automatically

Protected function Virtual Const

void

 

NotifyNodeDeactivation

(
    FBehaviorTreeSearchData& SearchDat...,
    EBTNodeResult::Type& NodeResult
)

Called when start leaves this node bUseNodeDeactivationNotify must be set to true for this function to be called Calling INIT_COMPOSITE_NODE_NOTIFY_FLAGS in the constructor of the node will set this flag automatically

Public function Const

void

 

OnChildActivation

(
    FBehaviorTreeSearchData& SearchDat...,
    int32 ChildIndex
)

Called before passing search to child node

Public function Const

void

 

OnChildActivation

(
    FBehaviorTreeSearchData& SearchDat...,
    const UBTNode& ChildNode
)

Called before passing search to child node

Public function Const

void

 

OnChildDeactivation

(
    FBehaviorTreeSearchData& SearchDat...,
    const UBTNode& ChildNode,
    EBTNodeResult::Type& NodeResult,
    const bool bRequestedFromValidInsta...
)

Notification called after child has finished search

Public function Const

void

 

OnChildDeactivation

(
    FBehaviorTreeSearchData& SearchDat...,
    int32 ChildIndex,
    EBTNodeResult::Type& NodeResult,
    const bool bRequestedFromValidInsta...
)

Notification called after child has finished search

Public function Const

void

 

OnNodeActivation

(
    FBehaviorTreeSearchData& SearchDat...
)

Called when start enters this node

Public function Const

void

 

OnNodeDeactivation

(
    FBehaviorTreeSearchData& SearchDat...,
    EBTNodeResult::Type& NodeResult
)

Called when search leaves this node

Public function Const

void

 

OnNodeRestart

(
    FBehaviorTreeSearchData& SearchDat...
)

Called when search needs to reactivate this node

Protected function Const

void

 

RequestDelayedExecution

(
    UBehaviorTreeComponent& OwnerComp,
    EBTNodeResult::Type LastResult
)

Store delayed execution request

Public function Virtual Const

void

 

SetChildOverride

(
    FBehaviorTreeSearchData& SearchDat...,
    int8 Index
)

Set override for next child index

Overridden from UBTNode

Name Description

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 Virtual Const

uint16

 

GetInstanceMemorySize()

Size of instance memory

Deprecated Functions

Name Description

Public function Const

void

 

OnChildDeactivation

(
    FBehaviorTreeSearchData& SearchDat...,
    int32 ChildIndex,
    EBTNodeResult::Type& NodeResult
)

This function is deprecated. Please use RequestBranchDeactivation instead.

Public function Const

void

 

OnChildDeactivation

(
    FBehaviorTreeSearchData& SearchDat...,
    const UBTNode& ChildNode,
    EBTNodeResult::Type& NodeResult
)

This function is deprecated. Please use RequestBranchDeactivation instead.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Cancel