Loading Conversation At Last Stop Point

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
mrklepper
Posts: 11
Joined: Mon Mar 14, 2022 12:07 pm

Loading Conversation At Last Stop Point

Post by mrklepper »

HI

I am wondering if there is an easy way to save the last conversation point when switching conversations back and forth between different characters. Currently they start over fresh. I was thinking to save each conversation point in an array and then to iterate through that quickly, but I am sure there is an easier way.

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

Re: Loading Conversation At Last Stop Point

Post by Tony Li »

Hi,

Before ending a conversation, you can record the conversation's ID and dialogue entry ID. You might also want to record the conversation's actor and conversant:

Code: Select all

int conversationID = DialogueManager.currentConversationState.subtitle.dialogueEntry.conversationID;
int entryID = DialogueManager.currentConversationState.subtitle.dialogueEntry.id;
Transform actor = DialogueManager.currentActor;
Transform conversant = DialogueManager.currentConversant;
DialogueManager.StopConversation();
Then you can use the IDs to resume that conversation:

Code: Select all

Conversation conversation = DialogueManager.masterDatabase.GetConversation(conversationID);
DialogueManager.StartConversation(conversation.Title, actor, conversant, entryID);
mrklepper
Posts: 11
Joined: Mon Mar 14, 2022 12:07 pm

Re: Loading Conversation At Last Stop Point

Post by mrklepper »

Thank you!!

However this loads the last message only.

Any chance to pre-load all the previous messages too? Basically I am looking at the SMS-UI and I'd like the player to be able to back and forth between conversations without losing progress.

I wonder if I can go through the conversation entries and stop whereever I stopped the dialogue before (until specific entry ID), maybe with a for loop. Also how would that take into consideration the choices I made?

Thank you in advance
User avatar
Tony Li
Posts: 22145
Joined: Thu Jul 18, 2013 1:27 pm

Re: Loading Conversation At Last Stop Point

Post by Tony Li »

Hi,

There are two ways you can do that:

1. Adapt the SMSDialogueUI script to your needs.

2. Or log the conversation yourself. See the ConversationLogger.cs script for an example. When you resume the conversation, put the logged info back into the UI.
Post Reply