Not loading to correct scene with es3

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
otango
Posts: 4
Joined: Tue Apr 12, 2022 6:57 am

Not loading to correct scene with es3

Post by otango »

Stupide Question:
I use ES3 to save and load all the data and scene.
when I load my game in scene 1, it won't jump to scene2 where i actually saved my game.

here is my save code:
string s = PixelCrushers.SaveSystem.Serialize(PixelCrushers.SaveSystem.RecordSavedGameData());
ES3.Save("DialogData", s, "SaveFile/saver.es3");

and here is my load code:
PixelCrushers.SaveSystem.ApplySavedGameData(PixelCrushers.SaveSystem.Deserialize<PixelCrushers.SavedGameData>(ES3.Load<string>("DialogData", "SaveFile/saver.es3")));

I don't quite know where i go wrong since i 've read many the topic contains "es3" and "load"/"scene".etc.
User avatar
Tony Li
Posts: 21980
Joined: Thu Jul 18, 2013 1:27 pm

Re: Not loading to correct scene with es3

Post by Tony Li »

Hi,

Are there any errors or warnings in the Console window?

On your Save System component, is "Save Current Scene" ticked?
otango
Posts: 4
Joined: Tue Apr 12, 2022 6:57 am

Re: Not loading to correct scene with es3

Post by otango »

Hi
There is no error waring and SaveCurrentScene is ticked.
that's why i m confused
otango
Posts: 4
Joined: Tue Apr 12, 2022 6:57 am

Re: Not loading to correct scene with es3

Post by otango »

And I m sure that the scene data is saved:
"DialogData" : {
"__type" : "string",
"value" : "{\"m_sceneName\":\"Scene0.1_bus\",\"m_list\":[{\"key\":\"SaveSystem\",\"sceneIndex\":-1,\"data\":\"…………
User avatar
Tony Li
Posts: 21980
Joined: Thu Jul 18, 2013 1:27 pm

Re: Not loading to correct scene with es3

Post by Tony Li »

Hi,

I misread your first post. Instead of SaveSystem.ApplySavedGameData, use SaveSystem.LoadGame:

Code: Select all

PixelCrushers.SaveSystem.LoadGame(PixelCrushers.SaveSystem.Deserialize<PixelCrushers.SavedGameData>(ES3.Load<string>("DialogData", "SaveFile/saver.es3")));
This will load the scene in addition to applying saved data to the savers in the scene.
otango
Posts: 4
Joined: Tue Apr 12, 2022 6:57 am

Re: Not loading to correct scene with es3

Post by otango »

It worked ,thans for your help!
:D
User avatar
Tony Li
Posts: 21980
Joined: Thu Jul 18, 2013 1:27 pm

Re: Not loading to correct scene with es3

Post by Tony Li »

Glad to help!
Post Reply