Discuss Scratch

pelmenguy
Scratcher
40 posts

How do i make a save/load system?

This has been a big question of Scratch: how do i make a save/load system? How DO I make one? I want it for my simcity-based game.
deck26
Scratcher
1000+ posts

How do i make a save/load system?

You have to start by deciding exactly what needs to be saved. It can be useful to know the range for each value - eg if you're saving points it might be limited to 5 digits.

Once you know what to save you need to decide how. You can save the values with separators so for example 1:23;45 is three values or use fixed numbers of digits so you know 12345 is 12, 3 and 45 and not 1, 23 and 45 or something else. Note that using a separator is not really an option if saving to the cloud though so that assumes a local code to cut and paste.

Finally you can decide whether you need to disguise the values to prevent cheating. But whatever you do can be worked out by looking inside so will never be totally secure.
pelmenguy
Scratcher
40 posts

How do i make a save/load system?

deck26 wrote:

You have to start by deciding exactly what needs to be saved. It can be useful to know the range for each value - eg if you're saving points it might be limited to 5 digits.

Once you know what to save you need to decide how. You can save the values with separators so for example 1:23;45 is three values or use fixed numbers of digits so you know 12345 is 12, 3 and 45 and not 1, 23 and 45 or something else. Note that using a separator is not really an option if saving to the cloud though so that assumes a local code to cut and paste.

Finally you can decide whether you need to disguise the values to prevent cheating. But whatever you do can be worked out by looking inside so will never be totally secure.
how bout money and progress?
deck26
Scratcher
1000+ posts

How do i make a save/load system?

pelmenguy wrote:

how bout money and progress?
I don't know what you need to save so why ask? If that's all you need move on to what I said next - how many digits or use a separator? But I'm not expecting you to come back to report on each stage. Once you know what to save and how you plan to do it you can work out how to reload the data from a saved code.
minecraftbauer
Scratcher
52 posts

How do i make a save/load system?

What is it your trying to save exactly?

Powered by DjangoBB