save and load quest status

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
polygonya
Posts: 11
Joined: Tue Jul 27, 2021 2:08 pm

save and load quest status

Post 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!
User avatar
Tony Li
Posts: 21965
Joined: Thu Jul 18, 2013 1:27 pm

Re: save and load quest status

Post 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().
polygonya
Posts: 11
Joined: Tue Jul 27, 2021 2:08 pm

Re: save and load quest status

Post 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?
User avatar
Tony Li
Posts: 21965
Joined: Thu Jul 18, 2013 1:27 pm

Re: save and load quest status

Post 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().
polygonya
Posts: 11
Joined: Tue Jul 27, 2021 2:08 pm

Re: save and load quest status

Post by polygonya »

yes, this is how I have implemented it now and it works well!
Thank you Tony!
User avatar
Tony Li
Posts: 21965
Joined: Thu Jul 18, 2013 1:27 pm

Re: save and load quest status

Post by Tony Li »

Glad to help!
Post Reply