Quests&Objectives

Build the tracker in your HUD.

Owning-client widgets must read replicated state first. Do not wait for the first event. Do not use bool returns.

The plugin zip does not include a HUD. The sample project includes an example tracker, log, and vendor board.

Get the component

On the local player, get PlayerState, then get Quest Component.

Do not use the bool return to update client UI. On Construct, fill the widget from GetQuestsByStatus. When the log opens, refresh. Fail and abandon then appear.

If you show fail or abandon, refresh when the widget becomes visible. Replication can change Active to Available in one update.

Quest tracker

Layout:

  1. On Construct, get the Quest Component from PlayerState.
  2. Call a Refresh function once. The first paint then uses the current state.
  3. Bind OnQuestStarted, OnObjectiveProgress, OnPhaseCompleted, and OnQuestCompleted to Refresh.
  4. In Refresh, call GetQuestsByStatus(Active). Take the first quest, or your pinned quest.
  5. Use FindQuestState plus the definition phases to list objectives for CurrentPhaseIndex.
  6. Skip a row when ShouldDisplayObjective is false.
  7. Show CurrentCount / RequiredCount from ObjectiveProgress and the definition.
  8. Load each objective Icon when you draw the row.
Blueprint: Get Quests By Status (Active) on the Quest Component.

If you want Optional objectives to look different, use the Optional flag on the definition.

Bind OnObjectiveFailTimerStarted. Then poll GetObjectiveFailTimeRemaining.

Quest log

SectionAPI
AvailableGetQuestsByStatus(Available)
ActiveGetQuestsByStatus(Active)
CompletedGetQuestsByStatus(Completed) or Times Completed > 0

Do not use Failed or Abandoned as log tabs. Those statuses are transitions. The quest becomes Available at once.

Resolve Title and Icon with UQuestSubsystem::GetQuestById.

Fill a List View or Scroll Box. Refresh on Available, Started, and Completed. Refresh again when you open the log.

Vendor / NPC board

NeedAPI
Available quests this NPC offersGetQuestsByStatusForGiver(Available, GiverId)
Active quests this NPC acceptsGetQuestsByStatusForTurnIn(Active, TurnInId)
Status list for this vendorGetQuestsByStatusForVendor(Status, VendorId)

If you need definition lists without player state, use subsystem GetQuestsByGiverId, GetQuestsByTurnInId, or GetQuestsByVendorId.

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.