Page 1 of 1

SaveSystem - Quest State loading but variables not

Posted: Tue Dec 03, 2024 10:25 am
by walczak
Hello,

I am working on saving Dialogue System with Easy Save 3. I am using "Alternate Setup" from this documentation page:
https://www.pixelcrushers.com/dialogue_ ... _save.html

This is the code chunk for saving:

Code: Select all

ES3.Save("DialogueSystem", SaveSystem.Serialize(SaveSystem.RecordSavedGameData()), saveFileName);
And this for loading:

Code: Select all

SaveSystem.ApplySavedGameData(SaveSystem.Deserialize<SavedGameData>(ES3.Load<string>("DialogueSystem", savePath)));
While Quest states work like a charm, this seem not to load variables. I can see variables with correct values recorded in the save file though.

I tried using this for save:

Code: Select all

PersistentDataManager.ApplySaveData(ES3.Load<string>("DialogueSystemVariables", savePath));
And this for load:

Code: Select all

ES3.Save("DialogueSystemVariables", PersistentDataManager.GetSaveData(), saveFileName)
But no luck.
How can I make this variables work?

Thanks in advance :)

Re: SaveSystem - Quest State loading but variables not

Posted: Tue Dec 03, 2024 11:36 am
by Tony Li
Hi,

Hmm, variables and quests should be saved in the same data string. Did you add a DialogueSystemSaver component to the Dialogue Manager and set a unique key value?

Re: SaveSystem - Quest State loading but variables not

Posted: Tue Dec 03, 2024 11:53 am
by walczak
Yes I have DialogueSystemSaver with unique id added to Dialogue Manager.

Variables in the string saved in the save file have correct values. They just not being loaded. (Quest state is loaded though).

Re: SaveSystem - Quest State loading but variables not

Posted: Tue Dec 03, 2024 12:04 pm
by walczak
I am also using multiple databases, if that makes any difference.

Re: SaveSystem - Quest State loading but variables not

Posted: Tue Dec 03, 2024 4:00 pm
by Tony Li
Is it possible that something else is resetting the variable values after you load a saved game?

Re: SaveSystem - Quest State loading but variables not

Posted: Tue Dec 03, 2024 4:21 pm
by walczak
Is it possible to make database reset with some Component? Maybe there is something attached to Dialogue Manager?

I was indeed using:

Code: Select all

DialogueManager.ResetDatabase(DatabaseResetOptions.RevertToDefault);
on my start screen scene. However removing it did not help.

Re: SaveSystem - Quest State loading but variables not

Posted: Tue Dec 03, 2024 4:51 pm
by walczak
is it possible that DialogueSystemSaver Component does reset the Database?
What options have to be checked for "Alternate Setup" to work?

Re: SaveSystem - Quest State loading but variables not

Posted: Tue Dec 03, 2024 11:49 pm
by Tony Li
DialogueSystemSaver does reset the database and then uses the values in the save string. If the Dialogue Manager's Persistent Data Settings > Initialize New Variables checkbox is ticked, it then creates new variables (using their Initial Values) for any variables that were added since the game was saved.

Would it be possible for you to send a reproduction project to tony (at) pixelcrushers.com?