Hello
My NPS starts conversation, then it can be interrupted. I save subtitle.dialogueEntry.id for continue conversation later.
When the NPC can continue the story, he must first say a random phrase. For example, "Where did I stop, oh yes ..."
and then continue conversation from saved entry id.
How can I do it?
How to combine bark (random phrase) with conversation?
Re: How to combine bark (random phrase) with conversation?
There are a few ways you could do this. Since it sounds like you're already using a little scripting to save the dialogue entry ID, I'll suggest a scripting solution.
First make sure you're also saving the conversation ID. Let's say they're saved in variables named savedConversationID and savedEntryID.
Write a conversation like this that says a random phrase and then goes to a group node:
In this example, I named the conversation "As I Was Saying". Make a note of the group node's conversation ID and dialogue entry ID. Let's say it's conversation ID 7, entry ID 5. We'll refer to this node as the Resume node.
On the Dialogue Manager GameObject, tick Other Settings > Instantiate Database. This way you can make changes to the database at runtime without permanently changing the database asset file.
When you want to continue the story, set the Resume node's outgoingLinks to point to the saved dialogue entry:
First make sure you're also saving the conversation ID. Let's say they're saved in variables named savedConversationID and savedEntryID.
Write a conversation like this that says a random phrase and then goes to a group node:
In this example, I named the conversation "As I Was Saying". Make a note of the group node's conversation ID and dialogue entry ID. Let's say it's conversation ID 7, entry ID 5. We'll refer to this node as the Resume node.
On the Dialogue Manager GameObject, tick Other Settings > Instantiate Database. This way you can make changes to the database at runtime without permanently changing the database asset file.
When you want to continue the story, set the Resume node's outgoingLinks to point to the saved dialogue entry:
Code: Select all
var resumeNode = DialogueManager.masterDatabase.GetDialogueEntry(7, 5);
resumeNode.outgoingLinks.Clear();
resumeNode.outgoingLinks.Add(new Link(resumeNode.conversationID, resumeNode.id, savedConversationID, savedEntryID));
DialogueManager.StartConversation("As I Was Saying", player.transform, npc.transform);
Re: How to combine bark (random phrase) with conversation?
Thanks for the fast reply. It is really helpful. It worked for me