Thank you for creating Dialogue System. It's a thoughtful and well-designed plugin!
I've searched through the forums but couldn't find a solution that fits my case. I'm trying to create a dialogue system similar to what you see in games like Story of Seasons or Stardew Valley. I currently have about 20 NPCs, each with multiple types of dialogue: daily, quests, gifting, events, etc. I'm using the naming convention you suggested in another thread (e.g., Daily/npcName) to organize conversations. By default, I assign Daily/npcName to the Dialogue System Trigger component on each NPC's child GameObject.
However, I want to switch the conversation at runtime when the player interacts with an NPC. For example, showing a quest-related conversation if a relevant quest is active. I tried the following logic inside my TalkToNPC() method, which also handles friendship points:
Code: Select all
if (QuestLog.GetQuestState("questName") == QuestState.Active) {
DialogueManager.StartConversation("Quest/npcName");
}
"Dialogue System: Another conversation is already active."
I also tried removing the default conversation from the Dialogue System Trigger. In that case, no dialogue starts at all when the player talks to the NPC.
My goal is:
- If a quest conversation that related to the NPC is activated, show that.
- After the quest dialogue is finished, return to using the daily conversation.
- Keep dialogues in separate assets for easier management, rather than combining them all into one conversation.
Is there a recommended way to dynamically switch conversations via code when the player talks to an NPC? Thank you.