Page 1 of 1

save and load quest status

Posted: Wed Oct 05, 2022 10:24 am
by polygonya
Hi,

I need a little hint
I use dialogue system for unity and the integrated quest system. My problem is loading the dialogue and quest status....
save works so far (with the Easy Save integration):

save = PersistentDataManager.GetSaveData();

The save file also creates it correctly with the correct parameters but the loading doesn't want to work yet.
I have a button that runs the script to load:
PersistentDataManager.ApplySaveData(save);

But when I load it like this I get a result: null

what am i missing? or what am i doing wrong?

thank you!

Re: save and load quest status

Posted: Wed Oct 05, 2022 10:33 am
by Tony Li
Hi,

When you call PersistentDataManager.ApplySaveData(save), are you sure your 'save' string variable contains valid save data? It should be the same data that was returned by PersistentDataManager.GetSaveData().

Re: save and load quest status

Posted: Wed Oct 05, 2022 11:25 am
by polygonya
As always an incredibly good suport! Thanks

Ok then I guess I know what the problem is... that before I run the PersistentDataManager.ApplySaveData(save);
I have to refill the string with the data... it is empty again when I restart the game.

How can I reload the data from the save location and add it to the string?

save and load the string with easy save or is there a direct way with the PixelCrushers.DialogueSystem.PersistentDataManager?

Re: save and load quest status

Posted: Wed Oct 05, 2022 1:23 pm
by Tony Li
Hi,

I assume you're not using the Dialogue System's save system, and that you're manually calling PersistentDataManager.GetSaveData() in your own script. In this case, you should save the string using Easy Save.

When you want to restore the saved state, get the string from Easy Save first. Then pass it to PersistentDataManager.ApplySaveData().

Re: save and load quest status

Posted: Wed Oct 05, 2022 1:35 pm
by polygonya
yes, this is how I have implemented it now and it works well!
Thank you Tony!

Re: save and load quest status

Posted: Wed Oct 05, 2022 1:42 pm
by Tony Li
Glad to help!