Discuss Scratch

YouErrahaliCoded
Scratcher
3 posts

Save/Load System

Hello, I am developing a project but I need a save/load system.
I have used a list with a saving code but the loading system will not work.
If you need further explanation just ask. ;)


My browser / operating system: Windows NT 10.0, Chrome 56.0.2924.87, Flash 25.0 (release 0)
deck26
Scratcher
1000+ posts

Save/Load System

Share what you have and it will be easier to help.
footsocktoe
Scratcher
1000+ posts

Save/Load System

YouErrahaliCoded wrote:

Hello, I am developing a project but I need a save/load system.
I have used a list with a saving code but the loading system will not work.
If you need further explanation just ask. ;)


My browser / operating system: Windows NT 10.0, Chrome 56.0.2924.87, Flash 25.0 (release 0)

If the save code is created by the project, it won't work, because all variables reset when the project is closed and reopened. So if the project makes a list, it might persist while you click the green flag (which only restarts the project, not resets the project), but when you close for good (exit Scratch), then the list vanishes.

The solution is cloud variables, but that's a whole other topic.
YouErrahaliCoded
Scratcher
3 posts

Save/Load System

deck26 wrote:

Share what you have and it will be easier to help.
As I have shared it, here is the link
https://scratch.mit.edu/projects/150507478/
YouErrahaliCoded
Scratcher
3 posts

Save/Load System

footsocktoe wrote:

YouErrahaliCoded wrote:

Hello, I am developing a project but I need a save/load system.
I have used a list with a saving code but the loading system will not work.
If you need further explanation just ask. ;)


My browser / operating system: Windows NT 10.0, Chrome 56.0.2924.87, Flash 25.0 (release 0)

If the save code is created by the project, it won't work, because all variables reset when the project is closed and reopened. So if the project makes a list, it might persist while you click the green flag (which only restarts the project, not resets the project), but when you close for good (exit Scratch), then the list vanishes.

The solution is cloud variables, but that's a whole other topic.

So the save/load system is possible, but with only cloud variables?
If so, can you link a tutorial/forum link or anything that can help?
Thanks!

Also, Link to the project: https://scratch.mit.edu/projects/150507478/
InfectionOffical
Scratcher
45 posts

Save/Load System

Recently I just developed a save and reload system for my newest project, Realm Trails.

The way I suggest (and had used) is to use save codes. Basically, you want to store every variable dependent on saving in a string of numbers. So, your hunger, health, ect. The hardest thing to do with save codes is to store strings (like items). You would have to define each item with their own numerical id (water = 1, stone = 2, bread = 3, ect.) and store it that way. If you are going to do this, have a variable list of every item and use that string's id in the save code. However, if you are storing numerical values above 9, make sure this doesn't break the code. I will demonstrate what I mean below.

setito0repeatuntilitemiofitemlist=itemchangeiby1setcodetojoin(code)(i)

However, with this, you are probably going to go past numerical values of nine. To fix so, do this instead of just setting the value:
if9<ithenif99<ithensetcodetojoincodeielsesetcodetojoincodejoin0ielsesetcodetojoincodejoin00i

This is good for converting a string to a numerical value, in which It can hold from 0 to 999.

If you are clueless to what I'm saying, visit Realm Trails and look into the Save and Load sprites. They use code to make and decrypt save codes. I can help you further after that for specific uses.

Last edited by InfectionOffical (March 19, 2017 02:37:23)

DunnoWho
Scratcher
66 posts

Save/Load System

I am using a
changeeffectby25
for color. I don't know how to save and load for color though.
P.S. Follow DunnoWho.
-Snipet-
Scratcher
500+ posts

Save/Load System

If you would want to make the saving on the cloud, I recommend using a cloud list engine. Here’s an example one I made: https://scratch.mit.edu/projects/287510236/

Hope this helps!
Starstriker3000
Scratcher
1000+ posts

Save/Load System

You can use what I have in my Warriors games (which I got from @Wildflight, so credit her, not me). It saves variable data and loads data into variables, but you can do a variable for the color. You just have to use a variable in place of the color blocks, and add a
foreversetcoloreffecttocolor
or a
repeatuntilsetcoloreffecttocolorwaituntilrepeatuntilsetcoloreffecttocolorwaituntilrepeatuntilsetcoloreffecttocolor
depending on what you want to do. No cloud variables needed whatsoever!

Then you can save that variable in the code. Oh yeah, here's my second Warriors game. It has both the code loader (in the sprite named “Code Analyzer”) and the code saver (in the sprite named “Code Generator”). Hope this helps you!

Last edited by Starstriker3000 (March 5, 2019 16:52:35)

deck26
Scratcher
1000+ posts

Save/Load System

Starstriker3000 wrote:

You can use what I have in my Warriors games (which I got from @Wildflight, so credit her, not me). It saves variable data and loads data into variables, but you can do a variable for the color. You just have to use a variable in place of the color blocks, and add a
foreversetcoloreffecttocolor
or a
repeatuntilsetcoloreffecttocolorwaituntilrepeatuntilsetcoloreffecttocolorwaituntilrepeatuntilsetcoloreffecttocolor
depending on what you want to do. No cloud variables needed whatsoever!

Then you can save that variable in the code. Oh yeah, here's my second Warriors game. It has both the code loader (in the sprite named “Code Analyzer”) and the code saver (in the sprite named “Code Generator”). Hope this helps you!
No data is saved if you reload the project unless you save it to the cloud (or you're the owner and save data in the editor).
Starstriker3000
Scratcher
1000+ posts

Save/Load System

deck26 wrote:

Starstriker3000 wrote:

You can use what I have in my Warriors games (which I got from @Wildflight, so credit her, not me). It saves variable data and loads data into variables, but you can do a variable for the color. You just have to use a variable in place of the color blocks, and add a
foreversetcoloreffecttocolor
or a
repeatuntilsetcoloreffecttocolorwaituntilrepeatuntilsetcoloreffecttocolorwaituntilrepeatuntilsetcoloreffecttocolor
depending on what you want to do. No cloud variables needed whatsoever!

Then you can save that variable in the code. Oh yeah, here's my second Warriors game. It has both the code loader (in the sprite named “Code Analyzer”) and the code saver (in the sprite named “Code Generator”). Hope this helps you!
No data is saved if you reload the project unless you save it to the cloud (or you're the owner and save data in the editor).

You just have to remind everyone to copy their code before exiting the project. If they do that and save it on their computer, they have it for when they need it again.
ss5doomguy
Scratcher
5 posts

Save/Load System

define
deck26
Scratcher
1000+ posts

Save/Load System

ss5doomguy wrote:

define
Please don't spam or necropost
mcnedj468
Scratcher
30 posts

Save/Load System

whenclicked
mcnedj468
Scratcher
30 posts

Save/Load System


when key s pressed and playing game = true then save data

xMystic416
Scratcher
100+ posts

Save/Load System

mcnedj468 wrote:

whenclicked

mcnedj468 wrote:

when key s pressed and playing game = true then save data

Please don't necropost. This topic is 3 years old. Thanks!
mcnedj468
Scratcher
30 posts

Save/Load System

how about making a code look complicated but actually simple by using a join? that way the code would look hard and people would not abuse the load system
mcnedj468
Scratcher
30 posts

Save/Load System

Things2doHelpmcnedj468getmorenoticed

yep its true i am barely noticed at all also i wish these blocks existed:

savedata

and

loaddata

Last edited by mcnedj468 (April 24, 2020 12:58:01)

PkmnQ
Scratcher
1000+ posts

Save/Load System

I know this post is old, but I think everyone got the wrong idea.
He wanted a save and load system. Not just a save system.
Too bad I'm too late.
blobablobbag
Scratcher
3 posts

Save/Load System

DunnoWho wrote:

I am using a
changeeffectby25
for color. I don't know how to save and load for color though.
P.S. Follow DunnoWho.
You can use:
changecoloreffectby25changecolorby25NOTE: This is a variable block!

Powered by DjangoBB