It looks like the save system can be used to make information persist between scenes.
Does it depend on access to the file system? I'm making a WebGL game to be posted on itch.io, so that would be a problem.
Save System vs WebGL
Re: Save System vs WebGL
Hi,
It can save in WebGL builds.
The save system consists of three modular parts:
It can save in WebGL builds.
The save system consists of three modular parts:
- Saver scripts: Records states (e.g., GameObjects' positions, enemies' health, etc.) to strings, and restores states from strings.
- Serializer: Puts the cumulative output of saver scripts in a format that can be saved. The default module serializes to JSON, but you can swap it out with others such as a binary serializer.
- Storer: Stores serialized data to persistent storage. The default module stores data in PlayerPrefs, which works with WebGL. You can swap it out with others such as a local disk file storer, cloud storer, etc.
-
- Posts: 37
- Joined: Tue May 17, 2022 3:49 pm
Re: Save System vs WebGL
Neat -- I'll have to try that out!
Re: Save System vs WebGL
Sounds good! Just set it as described on the Save System page, and change scenes using any of these techniques.
-
- Posts: 37
- Joined: Tue May 17, 2022 3:49 pm
Re: Save System vs WebGL
We're (currently) only saving information between scenes, which looks even easier. According to
https://www.pixelcrushers.com/dialogue_ ... ystem.html
"When changing scenes, the process is the same except the Saved Game Data Storer is not used. The Save System simply holds the save data in memory and applies it to the newly-loaded scene."
https://www.pixelcrushers.com/dialogue_ ... ystem.html
"When changing scenes, the process is the same except the Saved Game Data Storer is not used. The Save System simply holds the save data in memory and applies it to the newly-loaded scene."
-
- Posts: 37
- Joined: Tue May 17, 2022 3:49 pm
Re: Save System vs WebGL
What's the best way to change scenes when using Dialogue System and TopDown Engine?
The DS Save System docs say:
The DS Save System docs say:
I've currently got a GameObject with a MoreMountains FinishLevel component attached to it. Should I be replacing this? Adding to it? I'm concerned that TDE may be expecting some things to happen when changing scenes, or that (say) attaching a ScenePortal script to the existing GameObject might cause the new scene to be loaded twice.To change scenes, use one of these techniques:
LoadLevel() sequencer command
Scene Portal component attached to a GameObject with a trigger collider.
Add a Save System Methods component. Connect a UnityEvent to SaveSystemMethods.LoadScene.
Or in C# call PixelCrushers.SaveSystem.LoadScene("scene") or LoadScene("scene@spawnpoint");
Re: Save System vs WebGL
Sorry, I forgot you're using TDE. Please see: How To: Use Corgi / TopDown Engine MMSceneLoadingManager
-
- Posts: 37
- Joined: Tue May 17, 2022 3:49 pm
Re: Save System vs WebGL
Okay. I have some further questions, but I'll add them over in that other thread.