Jumping to a Particular Line in Conversation through C#

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
johnnemann
Posts: 12
Joined: Tue Oct 06, 2015 2:00 pm

Jumping to a Particular Line in Conversation through C#

Post by johnnemann »

Hi,

Is there an easy way to jump to a particular line in the current conversation? My explorations show ways to dig a DialogueEntry out of a database, provided you know the conversation ID and line ID, and then I guess you can feed that through to get a DialogueState, and then use GotoState(), but it's a very very convoluted path and I don't have access to all the information to get there. It seems like there should be an easy way to just trigger a particular line.

Thank you!
Johnnemann
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Jumping to a Particular Line in Conversation through C#

Post by Tony Li »

Hi,

The preferred way is to have a link in your dialogue tree.

Other than that, you can stop the conversation and restart it at a specific dialogue entry ID using the version of DialogueManager.StartConversation() that accepts a dialogue entry ID:

Code: Select all

DialogueManager.StartConversation("My Conversation", actorTransform, conversantTransform, jumpToThisID);
Or, to stay within the same conversation, use that DialogueManager.ConversationModel and ConversationController:

Code: Select all

var state = DialogueManager.ConversationModel.GetState(jumpToThisDialogueEntry);
DialogueManager.ConversationController.GotoState(state);
johnnemann
Posts: 12
Joined: Tue Oct 06, 2015 2:00 pm

Re: Jumping to a Particular Line in Conversation through C#

Post by johnnemann »

Great, thanks for the info!

Yeah, I think what I actually want is a link and a conditional. Thank you!
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Jumping to a Particular Line in Conversation through C#

Post by Tony Li »

My pleasure!
Post Reply