Using C# script to go to a specific conversation line

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
zeroxpy
Posts: 12
Joined: Tue Oct 20, 2020 10:50 pm

Using C# script to go to a specific conversation line

Post by zeroxpy »

In my conversation, I have a scene event (in C# script) which (if triggered) should fast forward the conversation by several lines. I am wondering about the best way to achieve this, preferably also in C# script. Thank you! :D
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using C# script to go to a specific conversation line

Post by Tony Li »

Hi,

Do you know which dialogue entry you want to fast forward to? If so, you can jump to that dialogue entry:

Code: Select all

// Look up the dialogue entry that you want to jump to:
var entry = DialogueManager.masterDatabase.GetDialogueEntry(conversationID, entryID);
// Jump the conversation model to that entry and get the conversation state:
var state = DialogueManager.conversationModel.GetState(entry);
// Show the state:
DialogueManager.conversationController.GotoState(state);
API References:
Post Reply