Save/Load conversation state
Posted: Mon Nov 09, 2020 11:12 am
Hello,
I have a separate save system in my game, which saves game progress to a json file. I want to store conversation state and integrate it into existing save file. To do so I added DialogueSystemSaver component: After that, when saving the game I do:
And finally, after loading and deserializing savefile I do:
But it doesn't change conversation (it stays in default, initial state). Am I missing something? I took a look at my json savefile, and conversation data string is in place and looks perfectly fine. So my guess is that I'm not setting dialogue system state properly.
I have a separate save system in my game, which saves game progress to a json file. I want to store conversation state and integrate it into existing save file. To do so I added DialogueSystemSaver component: After that, when saving the game I do:
Code: Select all
playData.dialogueData = dialogueSystemSaver.RecordData();
Code: Select all
DialogueManager.Instance.StartConversation(scenarioInfo.conversationName);
dialogueSystemSaver.ApplyData(playData.dialogueData);