Navigation
API > API/Runtime > API/Runtime/AIModule > API/Runtime/AIModule/BehaviorTree > API/Runtime/AIModule/BehaviorTree/Tasks
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UBTNode
- UBTTaskNode
- UBTTask_GameplayTaskBase
References
| Module | AIModule |
| Header | /Engine/Source/Runtime/AIModule/Classes/BehaviorTree/Tasks/BTTask_GameplayTaskBase.h |
| Include | #include "BehaviorTree/Tasks/BTTask_GameplayTaskBase.h" |
Syntax
class UBTTask_GameplayTaskBase : public UBTTaskNode
Remarks
Base class for managing gameplay tasks Since AITask doesn't have any kind of success/failed results, default implemenation will only return EBTNode::Succeeded
In your ExecuteTask:
- use NewBTAITask() helper to create task
- initialize task with values if needed
- use StartGameplayTask() helper to execute and get node result
Variables
| Type | Name | Description | |
|---|---|---|---|
| uint32: 1 | bWaitForGameplayTask | If set, behavior tree task will wait until gameplay tasks finishes |
Constructors
| Type | Name | Description | |
|---|---|---|---|
UBTTask_GameplayTaskBase
(
const FObjectInitializer& ObjectInitializer |
Functions
| Type | Name | Description | |
|---|---|---|---|
| EBTNodeResult::Type | DetermineGameplayTaskResult
(
UAITask& Task |
Get finish result from task | |
| EBTNodeResult::Type | StartGameplayTask
(
UBehaviorTreeComponent& OwnerComp, |
Start task and initialize FBTGameplayTaskMemory memory block |
Overridden from UBTTaskNode
| Type | Name | Description | |
|---|---|---|---|
| EBTNodeResult::Type | AbortTask
(
UBehaviorTreeComponent& OwnerComp, |
Aborts this task, should return Aborted or InProgress (use FinishLatentAbort() when returning InProgress) this function should be considered as const (don't modify state of object) if node is not instanced! | |
| void | OnTaskFinished
(
UBehaviorTreeComponent& OwnerComp, |
Called when task execution is finished this function should be considered as const (don't modify state of object) if node is not instanced! bNotifyTaskFinished must be set to true for this function to be called Calling INIT_TASK_NODE_NOTIFY_FLAGS in the constructor of the task will set this flag automatically |
Overridden from UBTNode
| Type | Name | Description | |
|---|---|---|---|
| uint16 | Size of instance memory |
Overridden from IGameplayTaskOwnerInterface
| Type | Name | Description | |
|---|---|---|---|
| void | OnGameplayTaskDeactivated
(
UGameplayTask& Task |
Notify called after GameplayTask changes state from Active (finishing or pausing) |