UFlowPilotTask
UFlowPilotTask : UObject
Description
![UFlowPilotTask Schema](/_astro/uflowpilottask_executionflow.pZFKwrJg_Z1xUijG.webp)
UFlowPilotTask
is the base class for all Tasks that can run in FlowPilot.
The schema above shows succintely how it works.
Each Tasks starts its execution by calling their Enter()
methods. They can either succeed or fail at this stage.
Upon failing, the task ends. If succeeded, Tick
is then called and we check the Task Result ( InProgress, Succeeded, Failed, Error ).
If the Task returns Succeeded
the Exit()
method is called.
Tasks can also be cancelled, and end directly.
Each class that can be implemented need to override a couple of virtual methods exposed by this task, either in Cpp or implementing the Blueprint versions when creating a UFlowPilotTask
via blueprint.
Interface
// UFlowPilotTask// Setups Tasks. Called once per FlowPilotExecution, even after restarts.virtual void Setup(FFlowContext* InContext);// Called when starting this Task. Returns true on successvirtual bool Enter();// Called on Tick. Will success automatically if not implemented by Child classesvirtual EFPTaskResult Tick(float DeltaTime);// Called when Tick returns Succeedsvirtual void Exit();// Resets all Tasks into their Setup Statesvirtual void Reset();
#if WITH_EDITOR // Returns true if valid. Child Tasks should implement their Validations virtual bool IsTaskDataValid(FDataValidationContext& InContext) { return true; }#endif
#if !UE_BUILD_SHIPPING && !UE_BUILD_TEST // Gathers information to display to debug view about Task. virtual void GetRuntimeDescription(TArray<FString>& OutLines) const {};#endif //~UFlowPilotTask