Page 1 of 1

Loading Conversation At Last Stop Point

Posted: Tue Mar 22, 2022 10:17 am
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,

Re: Loading Conversation At Last Stop Point

Posted: Tue Mar 22, 2022 11:31 am
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);

Re: Loading Conversation At Last Stop Point

Posted: Tue Mar 22, 2022 5:20 pm
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

Re: Loading Conversation At Last Stop Point

Posted: Tue Mar 22, 2022 7:59 pm
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.