Discuss Scratch

tylertheguy298
Scratcher
8 posts

How to create a proper save and load system?

I want to create a system where after you beat the game a variable named “GameBeaten” gets set to one, but I don't know how to make it so if you leave the tab then return you still have your progress. I'm not sure if its impossible but I'd like to make sure
GamingCat12345
Scratcher
500+ posts

How to create a proper save and load system?

To save when you leave and return to the tab, use a cloud variable. Encode the player's username and join it to the rest of the cloud variable. This cloud variable now tracks every single player who beat the game. Just decode it when you start.

HOWEVER
Right now cloud variables are down so this won't work until they are fixed
tylertheguy298
Scratcher
8 posts

How to create a proper save and load system?

Thanks! Ill try to see what i can do with this information
NeonG4
Scratcher
1000+ posts

How to create a proper save and load system?

tylertheguy298 wrote:

Thanks! Ill try to see what i can do with this information
@TimMcCool created a local save code, but it's a little dicey. https://scratch.mit.edu/projects/964600056/fullscreen/
abrakaidabra
Scratcher
500+ posts

How to create a proper save and load system?

NeonG4 wrote:

tylertheguy298 wrote:

Thanks! Ill try to see what i can do with this information
@TimMcCool created a local save code, but it's a little dicey. https://scratch.mit.edu/projects/964600056/fullscreen/
It also doesn’t work right now, bc cloud variables are down, so yea right now your best bet is a save code to save a players data. If cloud variables were up I would definitely recommend TimMcCool’s local storage system, bc cloud variables only have a very limited amount of space. TimMcCool links the cloud variables to python servers so with that you get almost infinite space.

Last edited by abrakaidabra (April 17, 2025 03:06:08)

NMario84
Scratcher
1000+ posts

How to create a proper save and load system?

wait….. LOCAL Storage is possible with Scratch? What about for offline use? :O

Maybe perhaps one day there will be a more “consistent” and more reliable/speedier/faster use for local storage for things like saving data. This could be useful so that we won't always have to rely on some random save code junk. I'd definitely be up for it for what I may use it for.

EDIT: Also, I just tried krokobil's remixed “faster” local storage project, and that was just as great! It seemed to work after i loaded the project from scratch's offline editor. That's pretty neat!

It's great to see some talented coders like this on Scratch to come up with such a concept.

Last edited by NMario84 (April 17, 2025 05:28:26)

NeonG4
Scratcher
1000+ posts

How to create a proper save and load system?

abrakaidabra wrote:

NeonG4 wrote:

tylertheguy298 wrote:

Thanks! Ill try to see what i can do with this information
@TimMcCool created a local save code, but it's a little dicey. https://scratch.mit.edu/projects/964600056/fullscreen/
It also doesn’t work right now, bc cloud variables are down, so yea right now your best bet is a save code to save a players data. If cloud variables were up I would definitely recommend TimMcCool’s local storage system, bc cloud variables only have a very limited amount of space. TimMcCool links the cloud variables to python servers so with that you get almost infinite space.
The project doesn't use cloud variables, it uses a browser cache.
abrakaidabra
Scratcher
500+ posts

How to create a proper save and load system?

NeonG4 wrote:

abrakaidabra wrote:

NeonG4 wrote:

tylertheguy298 wrote:

Thanks! Ill try to see what i can do with this information
@TimMcCool created a local save code, but it's a little dicey. https://scratch.mit.edu/projects/964600056/fullscreen/
It also doesn’t work right now, bc cloud variables are down, so yea right now your best bet is a save code to save a players data. If cloud variables were up I would definitely recommend TimMcCool’s local storage system, bc cloud variables only have a very limited amount of space. TimMcCool links the cloud variables to python servers so with that you get almost infinite space.
The project doesn't use cloud variables, it uses a browser cache.
Oh wow ok
NMario84
Scratcher
1000+ posts

How to create a proper save and load system?

Okay, I tried these projects again, and well……. I've come across a few issues that others probably got as well….. That is that “it doesn't work”.
While it “seemingly” saves “something” to local storage, the information gets deleted over some time. So it's not really “storage” after all.

In all honestly, we really “COULD” use actual local storage variables to help with this matter. I would REALLY like to see evidence of “permanent” local storage of some sort that is NOT save codes.

Powered by DjangoBB