Page 1 of 1

A quick question about saves

Posted: Wed May 29, 2024 8:59 pm
by Yubaba
Hi Tony,
I really appreciate being able to lean on DS's save slot system but I have my own scene loader. I just wanted to check that this process is okay and I'm not missing anything, it seems to be working great, but I've only just implemented it -

Saving is called by

Code: Select all

PixelCrushers.SaveSystem.SaveToSlot(_slot);
In the main menu I'm clearing all data -

Code: Select all

DialogueManager.instance.ResetDatabase();
DialogueSystemInkIntegration.instance.ResetStories();
and then Loading is

Code: Select all

var _loadData = PixelCrushers.SaveSystem.storer.RetrieveSavedGameData(_slot);
PixelCrushers.SaveSystem.ApplySavedGameData(_loadData);
var _sceneToLoad = DialogueLua.GetVariable(SceneToLoad).asString;
MyCustomSceneLoader(_sceneToLoad);
thanks so much for all your hard work,

Pete.

Re: A quick question about saves

Posted: Wed May 29, 2024 9:22 pm
by Tony Li
Hi Pete,

For saving and loading, untick the Save System component's Save Current Scene checkbox. Then use PixelCrushers.SaveSystem.SaveToSlot(_slot) as you're already doing, PixelCrushers.SaveSystem.LoadFromSlot(_slot) to load and apply saved game data, and PixelCrushers.SaveSystem.ResetGameState() to clear all data in the main menu. If you add an InkSaver component to your Dialogue Manager, you don't need to call DialogueSystemInkIntegration.instance.ResetStories().

For scene changes using your own scene loader, I recommend the method shown in code at the bottom of How To: Change Scenes With Save System.

Re: A quick question about saves

Posted: Sun Jun 02, 2024 7:05 pm
by Yubaba
Done! Thank you!

Re: A quick question about saves

Posted: Sun Jun 02, 2024 9:29 pm
by Tony Li
Glad to help!