Talk To Objective
Overview
TalkToObjective tracks whether the player has spoken to a specific NPC. It listens to QuestEventType.NPCTalkedTo events published via the QuestEventBus and sets a completion flag when an event with a matching NPC ID arrives.
It supports two targeting modes:
General — completes when the player talks to the NPC at all, regardless of which dialogue is triggered
Specific dialogue — completes only when a particular dialogue ID is started with the NPC, allowing objectives to require a specific conversation rather than any interaction
TalkToObjective is a binary objective — it is either done or not done, with no count. It is added as an objective entry on a Quest ScriptableObject. It is not a component. The event that satisfies it is fired by the dialogue system via QuestEventReporter.Instance.ReportNPCTalkedTo(npcId, dialogueId).
Fields
Talk To Objective Settings
NPC ID
string
The NPC identifier this objective listens for. Must match the npcId passed to QuestEventReporter.ReportNPCTalkedTo() when dialogue with this NPC begins.
Specific Dialogue ID
string
Optional. When set, the objective only completes if the reported dialogueId also matches this value. Leave empty to complete on any conversation with the NPC.
Inherited Fields (from QuestObjective)
QuestObjective)Objective ID
string
Auto-generated GUID uniquely identifying this objective within its quest.
Description
string
Text shown to the player in the Quest Journal and HUD tracker.
Is Optional
bool
When true, this objective does not need to be completed for the quest to complete.
How It Works
Matching
When an NPCTalkedToEventData event arrives, QuestManager sets progress flags:
Both flags are always written when a dialogue ID is present — the specific flag and the general flag are set simultaneously.
Completion Check
Since QuestManager sets both flags when a dialogue ID is provided, an objective with specificDialogueId set will only complete when that exact dialogue fires — but an objective without specificDialogueId will complete regardless of which dialogue is triggered with that NPC.
Event Subscription Lifecycle
When the parent quest starts, QuestManager calls SubscribeToEvents(eventBus), subscribing this objective to QuestEventType.NPCTalkedTo. When the quest ends, UnsubscribeFromEvents(eventBus) removes the subscription.
Firing the Event
TalkToObjective does not poll for NPC proximity. Something in the scene must call:
Common integration points:
A Dialogue Graph Start node or Dialogue Graph completion callback — wired to call
ReportNPCTalkedTowhen a conversation begins or endsA Malbers Event fired from within a dialogue node, connected to
QuestEventReporter.ReportNPCTalkedToA
QuestTriggercomponent on the NPC withActivation Method: OnInteract, performing aStartQuestorCompleteObjectiveaction
Connecting to the Scene
The npcId set on the objective must exactly match the string passed to ReportNPCTalkedTo from the dialogue system. There is no dedicated QuestTalkable component — the NPC's dialogue setup is responsible for firing the event at the appropriate point in the conversation.
npcId = "ElderMaren"
Dialogue fires ReportNPCTalkedTo("ElderMaren")
specificDialogueId = "quest_intro"
Dialogue fires ReportNPCTalkedTo("ElderMaren", "quest_intro")
Example Configurations
"Speak to Elder Maren" — any conversation
"Hear the Elder's warning" — specific dialogue required
Only completes when the dialogue system reports "elder_warning_dialogue" specifically — other conversations with Elder Maren do not count.
"Report back to the Captain" — turn-in conversation
Other Notes
npcIdandspecificDialogueIdmatching is exact and case-sensitive.The
talked_to_{npcId}general flag is always set when any conversation with the NPC is reported, even when aspecificDialogueIdis also provided. This means a generalTalkToObjective(no specific dialogue) will complete even if a more targeted conversation fires the event.TalkToObjectiveis a one-way flag — once set totrue, it cannot be unset during an active quest session. If the quest is reset viaResetProgress(), the flag is cleared and the objective can be completed again.If two active quests both have a
TalkToObjectivewith the samenpcId, a single conversation satisfies both simultaneously.The
specificDialogueIdfield enables multi-step NPC interactions within the same quest — for example, requiring the player to first trigger a "quest given" dialogue, then later a separate "quest complete" dialogue, each tracked by a differentTalkToObjective.
Last updated