Saved conversation continues on scene change

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Karvakeiju
Posts: 14
Joined: Tue Apr 04, 2023 6:15 am

Saved conversation continues on scene change

Post by Karvakeiju »

Hey,

I'm doing the final tweaks on our saving/loading and I bumped into an issue that might be really stupid :D When I save during a conversation and just keep on playing normally and reach a point where I change scene, the loaded scene starts immediatly with the conversation I previously saved. This obviously isn't desired behaviour to have an ongoing conversation start on every scene load.

Is there a way to not restore the conversation state on scene load scene but still load the dialogue system variables? Also the conversation state should be restored when actually loading that save slot but not on every scene load.

Thanks for the help in advance!
User avatar
Tony Li
Posts: 23401
Joined: Thu Jul 18, 2013 1:27 pm

Re: Saved conversation continues on scene change

Post by Tony Li »

Hi,

Are you changing scenes using any of the methods that are save system-aware? Please see: How To: Change Scenes With Save System

This will update the save system's memory with the current conversation state (i.e., no conversation currently active) before changing scenes. After changing scenes, the save system will apply its memory to the scene (no conversation active).
Karvakeiju
Posts: 14
Joined: Tue Apr 04, 2023 6:15 am

Re: Saved conversation continues on scene change

Post by Karvakeiju »

Hi,

We indeed are using PixelCrushers.SaveSystem.LoadScene(sceneName) but the saved conversation still resumes from the saved conversation when changing scenes.

When I save the conversation using the savesystem I get this debug log "TextlineDialogueUI.OnRecordPersistentData: Saving current conversation to DialogueEntryRecords". And when I change to the next scene and it is loaded I get this debug log "TextLineDialogueUI.OnApplyPersistentData: Restoring current conversation from DialogueEntryRecords: 1;167..." and "Resuming 'conversationName' at entry 284".

Should the savesystem record the current conversation when starting the scene leave? I also tried to add these to a script and call them with the StandardSceneTransitionManager's OnTransitionStart:
PixelCrushers.SaveSystem.RecordSavedGameData();
PixelCrushers.SaveSystem.BeforeSceneChange();

Am I going to the right direction or is there something really basic that I have missed?
Post Reply