Discuss Scratch

Rocco_67
Scratcher
3 posts

How do I make a save code

What is the code for a save code. (When you press a sprite it does the code) in coding block❓
Cool_Guy4131
Scratcher
4 posts

How do I make a save code

make the code smth like this:

when this sprite clicked
set [ char] to [ ]
set [saved stuff] to [29|05|82|04|9|85]
forever
set [char] to (letter ( index) of [ saved stuff])
change [index] by (1)
if <[char] contains [|]?> then
stop [this script]
end
set [save] to (join (save) (char))
end

Ps: dont mind the wierd block text stuff im new to this discussion post thingy

Last edited by Cool_Guy4131 (April 24, 2026 05:05:12)

-S0dium-
Scratcher
71 posts

How do I make a save code

Cool_Guy4131 wrote:

make the code smth like this:

~snip~

Ps: dont mind the wierd (sic) block text stuff im new to this discussion post thingy
Tip: put a space and then the letter v at the end of stuff in () and to turn it into a dropdown. Example:
stop [this script] // wrong
becomes
stop [this script v] // correct
Woodfur
Scratcher
100+ posts

How do I make a save code

You'll have to think carefully about WHAT details you need to encode. That'll be unique to your project, no generic solution can do it for you.

It could get complicated if you want to save it to the cloud (numbers only), keep the codes as short as possible, or make it hard to figure out what the state is from looking at it.

If you don't care about any of that stuff you can pretty much just take all the important values and mash them together in one long string. They'll be a lot easier to retrieve later if each segment has a consistent length though, and moreso if they're short.

Once you've thought about how you'll actually assign a unique string to each project state, THEN you can start asking questions about how to get there.

Last edited by Woodfur (April 24, 2026 09:08:09)

Cool_Guy4131
Scratcher
4 posts

How do I make a save code

-S0dium- wrote:

Cool_Guy4131 wrote:

make the code smth like this:

~snip~

Ps: dont mind the wierd (sic) block text stuff im new to this discussion post thingy
Tip: put a space and then the letter v at the end of stuff in () and to turn it into a dropdown. Example:
stop [this script] // wrong
becomes
stop [this script v] // correct

Ooooh ty
thebestburger5
Scratcher
32 posts

How do I make a save code

Griffpatch has a tutorial in case you need it

Powered by DjangoBB