UBTDecorator_BlueprintBase

Base class for blueprint based decorator nodes.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

AIModule

Header

/Engine/Source/Runtime/AIModule/Classes/BehaviorTree/Decorators/BTDecorator_BlueprintBase.h

Include

#include "BehaviorTree/Decorators/BTDecorator_BlueprintBase.h"

Syntax

class UBTDecorator_BlueprintBase : public UBTDecorator

Remarks

Base class for blueprint based decorator nodes. Do NOT use it for creating native c++ classes!

Unlike task and services, decorator have two execution chains: ExecutionStart-ExecutionFinish and ObserverActivated-ObserverDeactivated which makes automatic latent action cleanup impossible. Keep in mind, that you HAVE TO verify is given chain is still active after resuming from any latent action (like Delay, Timelines, etc).

Helper functions:

  • IsDecoratorExecutionActive (true after ExecutionStart, until ExecutionFinish)

  • IsDecoratorObserverActive (true after ObserverActivated, until ObserverDeactivated)

Variables

Name Description

Protected variable

AActor *

 

ActorOwner

Cached AIController owner of BehaviorTreeComponent.

Protected variable

AAIController &...

 

AIOwner

Cached AIController owner of BehaviorTreeComponent.

Protected variable

uint32: 1

 

bCheckConditionOnlyBlackBoardChanges

Applies only if Decorator has any FBlackboardKeySelector property and if decorator is set to abort BT flow.

Protected variable

uint32: 1

 

bIsObservingBB

Gets set to true if decorator declared BB keys it can potentially observe

Protected variable

uint32: 1

 

bShowPropertyDetails

Show detailed information about properties

Protected variable

FString

 

CustomDescription

Protected variable

TArray< FName >

 

ObservedKeyNames

Blackboard key names that should be observed

Protected variable

uint32: 2

 

PerformConditionCheckImplementations

Set if ReceiveConditionCheck is implemented by blueprint

Protected variable

TArray< FProper...

 

PropertyData

Properties with runtime values, stored only in class default object

Protected variable

uint32: 2

 

ReceiveExecutionFinishImplementations

Set if ReceiveExecutionFinish is implemented by blueprint

Protected variable

uint32: 2

 

ReceiveExecutionStartImplementations

Set if ReceiveExecutionStart is implemented by blueprint

Protected variable

uint32: 2

 

ReceiveObserverActivatedImplementations

Set if ReceiveObserverActivated is implemented by blueprint

Protected variable

uint32: 2

 

ReceiveObserverDeactivatedImplementations

Set if ReceiveObserverDeactivated is implemented by blueprint

Protected variable

uint32: 2

 

ReceiveTickImplementations

Set if ReceiveTick is implemented by blueprint

Constructors

Name Description

Public function

UBTDecorator_BlueprintBase

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Protected function Const

bool

 

CalculateRawConditionValueImpl

(
    UBehaviorTreeComponent& OwnerComp
)

Protected function Const

bool

 

GetNeedsTickForConditionChecking()

Public function Const

bool

 

GetShouldAbort

(
    UBehaviorTreeComponent& OwnerComp
)

Return if this decorator should abort in current circumstances

Public function

void

 

InitializeProperties()

Initialize data about blueprint defined properties

Protected function Const

bool

 

IsDecoratorExecutionActive()

Check if decorator is part of currently active branch

Protected function Const

bool

 

IsDecoratorObserverActive()

Check if decorator's observer is currently active

Public function

EBlackboardN...

 

OnBlackboardKeyValueChange

(
    const UBlackboardComponent& Blackb...,
    FBlackboard::FKey ChangedKeyID
)

Notify about changes in blackboard

Protected function

bool

 

PerformConditionCheck

(
    AActor* OwnerActor
)

Called when testing if underlying node can be executed, must call FinishConditionCheck that if both generic and AI event versions are implemented only the more suitable one will be called, meaning the AI version if called for AI, generic one otherwise

Protected function

bool

 

PerformConditionCheckAI

(
    AAIController* OwnerController,
    APawn* ControlledPawn
)

Alternative AI version of ReceiveConditionCheck

Protected function

void

 

ReceiveExecutionFinish

(
    AActor* OwnerActor,
    enum EBTNodeResult::Type NodeResult
)

Called when execution of underlying node is finished that if both generic and AI event versions are implemented only the more suitable one will be called, meaning the AI version if called for AI, generic one otherwise

Protected function

void

 

ReceiveExecutionFinishAI

(
    AAIController* OwnerController,
    APawn* ControlledPawn,
    enum EBTNodeResult::Type NodeResult
)

Alternative AI version of ReceiveExecutionFinish

Protected function

void

 

ReceiveExecutionStart

(
    AActor* OwnerActor
)

Called on execution of underlying node that if both generic and AI event versions are implemented only the more suitable one will be called, meaning the AI version if called for AI, generic one otherwise

Protected function

void

 

ReceiveExecutionStartAI

(
    AAIController* OwnerController,
    APawn* ControlledPawn
)

Alternative AI version of ReceiveExecutionStart

Protected function

void

 

ReceiveObserverActivated

(
    AActor* OwnerActor
)

Called when observer is activated (flow controller) that if both generic and AI event versions are implemented only the more suitable one will be called, meaning the AI version if called for AI, generic one otherwise

Protected function

void

 

ReceiveObserverActivatedAI

(
    AAIController* OwnerController,
    APawn* ControlledPawn
)

Alternative AI version of ReceiveObserverActivated

Protected function

void

 

ReceiveObserverDeactivated

(
    AActor* OwnerActor
)

Called when observer is deactivated (flow controller) that if both generic and AI event versions are implemented only the more suitable one will be called, meaning the AI version if called for AI, generic one otherwise

Protected function

void

 

ReceiveObserverDeactivatedAI

(
    AAIController* OwnerController,
    APawn* ControlledPawn
)

Alternative AI version of ReceiveObserverDeactivated

Protected function

void

 

ReceiveTick

(
    AActor* OwnerActor,
    float DeltaSeconds
)

Tick function that if both generic and AI event versions are implemented only the more suitable one will be called, meaning the AI version if called for AI, generic one otherwise

Protected function

void

 

ReceiveTickAI

(
    AAIController* OwnerController,
    APawn* ControlledPawn,
    float DeltaSeconds
)

Alternative AI version of ReceiveTick

Overridden from UBTDecorator

Name Description

Public function Virtual Const

bool

 

CalculateRawConditionValue

(
    UBehaviorTreeComponent& OwnerComp,
    uint8* NodeMemory
)

Calculates raw, core value of decorator's condition. Should not include calling IsInversed

Protected function Virtual

void

 

OnNodeActivation

(
    FBehaviorTreeSearchData& SearchDat...
)

Called when underlying node is activated this function should be considered as const (don't modify state of object) if node is not instanced!

Protected function Virtual

void

 

OnNodeDeactivation

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

Called when underlying node has finished this function should be considered as const (don't modify state of object) if node is not instanced!

Overridden from UBTAuxiliaryNode

Name Description

Protected function Virtual

void

 

OnBecomeRelevant

(
    UBehaviorTreeComponent& OwnerComp,
    uint8* NodeMemory
)

Called when auxiliary node becomes active this function should be considered as const (don't modify state of object) if node is not instanced!

Protected function Virtual

void

 

OnCeaseRelevant

(
    UBehaviorTreeComponent& OwnerComp,
    uint8* NodeMemory
)

Called when auxiliary node becomes inactive this function should be considered as const (don't modify state of object) if node is not instanced!

Protected function Virtual

void

 

TickNode

(
    UBehaviorTreeComponent& OwnerComp,
    uint8* NodeMemory,
    float DeltaSeconds
)

Tick function this function should be considered as const (don't modify state of object) if node is not instanced!

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

FName

 

GetNodeIconName()

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

Public function Virtual Const

FString

 

GetStaticDescription()

Public function Virtual

void

 

InitializeFromAsset

(
    UBehaviorTree& Asset
)

Initialize any asset related data

Public function Virtual

void

 

OnInstanceDestroyed

(
    UBehaviorTreeComponent& OwnerComp
)

Called when node instance is removed from tree

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 UObject

Name Description

Public function Virtual

void

 

PostInitProperties()

Setup node name

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

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