Discuss Scratch

MarkRoberFan708
Scratcher
18 posts

Simple Save code engine (so easy to use you won't believe it)

This is an in depth explanation of this project I made which is a simple save code engine: https://scratch.mit.edu/projects/1384170627/
So basically save codes for this project consist of two parts: raw data and formatting. The first ten digits of any save code are formatting. formatting tells the save engine how to read the raw data. A digit of formatting will always be a 1 2 or 3.
It represents how many digits long each value being stored in the raw data is. Raw data is a string of values of variables. But lets scale it down a little to make it easier to understand. If we are saving three variables called A B and C, if A is 12 B is 356 and C is 7, the raw data would be 123567. since the value of A consists of 2 digits, B of 3 digits, and 1 of 1, the formatting would read 231 So we have the formatting, 231 and the raw data, 123567, put next to each other with spaces that's 231 123567 but they don't have spaces, so the code would be 231123567 so the engine knows to read the first two digits of the raw data for the value of A, the next three for B, then the next one for C. By doing so it knows that A is 12, B is 356, and C is 7. Now that we've broken it down, lets scale it up to size. A real save code has ten values hence the ten formatting digits. we will call them Variable 1 with a value of 14, Variable 2 with 5, Variable 3 with 7, Variable 4 with 79, Variable 5 with 564, variable 6 with 14, Variable 7 with 222, Variable 8 with 30, Variable 9 with 16, And variable 10 with 1. For the formatting it would be 2 1 1 2 3 2 3 2 2 and 1, so 2112323221, and the raw data would be 1457795641422230161, so the two parts of the code would be 2112323221 and 1457795641422230161, so the code would be 21123232211457795641422230161. The engine can create save codes that store values up to 3 digits long for up to 10 variables, these variables are built in. It is really easy to use. FIrst, just add the sprite called Code Maker to your backpack then from there add it to the project you are going to use it in. If you are making a new project using this just rename the variables to what you need them to be called and use them accordingly, if you are adding it to an existing project it could be harder depending on the size of your project because you will have to delete the existing versions of the variables you are including in the save and replace every use of them with the variables built into the engine. Now, you just need to add a trigger for generating and accepting codes. just go to the code labeled generate and accept and add an event like receiving a message to the top. Here is a simple project I used it in as an example if you need one: https://scratch.mit.edu/projects/1382300679/.

Here is what adding the trigger for accepting the code would look like

It looks like this by default

ask [Enter Save Code] and wait
broadcast [Code Entered v]

Make it look like this:
when I receive [(Your message name) v]
ask [Enter Save Code] and wait
broadcast [Code Entered v]

Last edited by MarkRoberFan708 (Sept. 24, 2026 18:44:18)

Powered by DjangoBB