StateTree Integration
Table of Contents
Overview
PulseQuest uses Unreal’s StateTree plugin to drive quest and director logic.
Schema Types
| Schema class | Used by | Available context objects |
|---|---|---|
UPulseQuestStateTreeSchema | Quest StateTree assets | Quest, MetaData, QuestData, QuestManager, QuestManagerData |
UPulseQuestDirectorStateTreeSchema | Director StateTree asset | QuestManager, QuestManagerData, QuestDirector |
Context object names and types
Quest schema
| Context name | Type |
|---|---|
Quest | UPulseQuest (the quest definition) |
MetaData | UObject (the MetaData field from UPulseQuest) |
QuestData | UPulseQuestData (runtime replicated data) |
QuestManager | Implements IPulseQuestManagerInterface |
QuestManagerData | UPulseQuestManagerData |
Director schema
| Context name | Type |
|---|---|
QuestManager | Implements IPulseQuestManagerInterface |
QuestManagerData | UPulseQuestManagerData |
QuestDirector | UPulseQuestDirector |
Built-in StateTree Tasks
FPulseStateTreeTask_StartObjective
Starts a single UPulseQuestObjective and waits for it to finish.
| Parameter | Type | Description |
|---|---|---|
ObjectiveClass | TSubclassOf<UPulseQuestObjective> | The objective class to instantiate |
SaveID | FName | Unique identifier within the quest |
NetMode | EPulseObjectiveNetMode | ServerOnly / ServerAndOwner / ServerAndAll |
TaskClass | TSubclassOf<UPulseObjectiveTask> | Optional Gameplay Task |
ViewModelClass | TSubclassOf<UMVVMPulseObjective> | Optional ViewModel |
StartIfCompletedAtSave |
Returns: Succeeded when the objective finishes with Completed, Failed otherwise.
FPulseStateTreeTask_StartObjectives
Starts multiple objectives simultaneously and waits for all of them to finish.
| Parameter | Type | Description |
|---|---|---|
Objectives | TArray<FPulseObjectiveParams> | List of objective configurations |
bFailIfAnyFails | bool | Fail the task if any single objective fails |
Returns: Succeeded when all objectives succeed (or bFailIfAnyFails rule is met).
FPulseStateTreeTask_StartQuest
Starts another quest from inside a quest’s StateTree.
| Parameter | Type | Description |
|---|---|---|
QuestTag | FGameplayTag | Tag of the quest to start |
bWaitForCompletion | bool | If true, task waits until the started quest finishes |
AdditionalFlags | EPulseQuestFlags | Extra flags for the new quest |
FPulseStateTreeTask_WaitForQuestFinish
Waits for an already-running quest to reach a terminal state.
| Parameter | Type | Description |
|---|---|---|
QuestTag | FGameplayTag | Quest to monitor |
Returns: Succeeded when target quest ends with Success; Failed otherwise.