Page 1 of 1

Jumping to a Particular Line in Conversation through C#

Posted: Wed Oct 07, 2015 3:59 pm
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

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

Posted: Wed Oct 07, 2015 10:21 pm
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);

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

Posted: Mon Oct 12, 2015 3:30 pm
by johnnemann
Great, thanks for the info!

Yeah, I think what I actually want is a link and a conditional. Thank you!

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

Posted: Mon Oct 12, 2015 4:34 pm
by Tony Li
My pleasure!