I am currently working on a system where I want to pause my currently active conversation and resume it at a later point. I know the DialogueManager class has a Pause function, but I believe I won't be able to use that. This is because it is possible that I have to run a short, different conversation while the main one is interrupted.
So the flow I want to achieve is this:
- Start conversation A
- Stop conversation A and fully hide the DSFU UI. Remember the current state (dialogue entry id). Some other UI is shown in the mean time, I have my own scripts to handle this
- Start conversation B and run through it fully
- Restart conversation A from the entry following the one where it was interrupted
I feel like I nearly have it solved, but I'm missing something and I may be overlooking a better way to do this. This is what I do currently:
- DialogueManager.StartConversation() to start conversation A
- Save DialogueManager.lastConversationID and DialogueManager.currentConversationState in two variables when interrupting
- DialogueManager.StartConversation() to start conversation B
- DialogueManager.StartConversation() to start conversation A again, with the previously saved conversation id as a parameter.
Below is the test conversation I'm using. Entry 11 is the one that should interrupt the conversation (note the script on it), in the final version it wouldn't have any dialogue text. Entry 12 is where the conversation should resume (pink = PC, grey = NPC).
Code snippet for stopping conversation (this is triggered from the Lua script in entry 11):
Code: Select all
//save conversation state
_lastConversationState = DialogueManager.currentConversationState;
_lastConversationStarted = DialogueManager.lastConversationStarted;
DialogueManager.StopConversation();
Code: Select all
DialogueManager.StartConversation( _lastConversationStarted, null, null, _lastConversationState.PCAutoResponse.destinationEntry.id );
Sorry for the long post, I've tried to describe the issue in as much detail as possible.