Build the tracker in your HUD.
The plugin zip does not include Widget Blueprints. The sample project includes an example HUD. You query the same component from C++. This page is for Standalone PIE. Events fire on this machine.
Get the component
On the local player, get PlayerState, then FindComponentByClass<UQuestComponent>.
Quest tracker
UQuestComponent* QC = PlayerState->FindComponentByClass<UQuestComponent>();
TArray<FQuestRuntimeState> Active = QC->GetQuestsByStatus(EQuestStatus::Active);
if (Active.Num() == 0)
{
return;
}
const FQuestRuntimeState& State = Active[0];
UQuestDefinition* Def = GetGameInstance()
->GetSubsystem<UQuestSubsystem>()
->GetQuestById(State.QuestId);
Walk Def->Phases[State.CurrentPhaseIndex].Objectives.
Before you add a row, call UQuestComponent::ShouldDisplayObjective.
Bind the same delegates with AddDynamic. Then rebuild the widget.
Quest log
Call the same GetQuestsByStatus values. Build your Slate or UMG list from the returned array.
For a history of completions, use TimesCompleted on the runtime state.
Vendor / NPC board
TArray<FQuestRuntimeState> Offered = QC->GetQuestsByStatusForGiver(
EQuestStatus::Available, GiverId);
TArray<UQuestDefinition*> Defs = Subsystem->GetQuestsByVendorId(VendorId);
Icons and sounds
Load UQuestDefinition::Icon, each objective Icon, and each reward Icon in your HUD.
When a quest completes, fails, or an objective completes, load the matching USoundCue from the definition. Then play it in your game.