Save Data

Announcements, support questions, and discussion for Quest Machine.
Post Reply
claudius_I
Posts: 33
Joined: Tue Aug 08, 2017 4:06 pm

Save Data

Post by claudius_I »

Hi Tony

My project use Save Game Pro and i done my save system.
I only want to get all data to save related to Quest Machine. There is a method to get that? or what is the info i need to saved?

Thank Tony
User avatar
Tony Li
Posts: 22099
Joined: Thu Jul 18, 2013 1:27 pm

Re: Save Data

Post by Tony Li »

Hi,

Set up Quest Machine's save system components: Add SaveSystem, JsonDataSerializer, and PlayerPrefsSavedGameDataStorer to the Quest Machine GameObject. The PlayerPrefsSavedGameDataStorer won't be used; it just silences a warning about no saved game data storer.

To get Quest Machine's data as a string:

Code: Select all

using PixelCrushers;
...
string s = SaveSystem.Serialize(SaveSystem.RecordSavedGameData());
Then you can save that string using Save Game Pro.

To reapply a string to Quest Machine:

Code: Select all

SaveSystem.ApplySavedGameData(SaveSystem.Deserialize<SavedGameData>(s));
claudius_I
Posts: 33
Joined: Tue Aug 08, 2017 4:06 pm

Re: Save Data

Post by claudius_I »

thanks Tony

it worked :)
User avatar
Tony Li
Posts: 22099
Joined: Thu Jul 18, 2013 1:27 pm

Re: Save Data

Post by Tony Li »

Great! Glad to help.
Post Reply