Discuss Scratch

vydeogamz
Scratcher
67 posts

External Save Data Processing & Saving (Advanced) SMART PERSON HELP NEEDED

So recently i had the idea to make a save system for a game. I looked into ones online and i noticed quickly a very critical flaw in the save system i am planning on to use.

So basically, the lets say the user has 50 coins in game. The user clicks the save button and then the game generates a code based on the amount of coins they have, let's say the code turns out to be “250b” this is just an example but the algrithiom for it would be the users amount of coins *5 and then the first number of the coins being a letter. (eg, 1 = a, 2 = b, 3 = c, etc).

If the user goes inside of the code and finds the algrithiom, they can reverse engineer it to give them tons of coins. For example, they could do “9999999i” and get 333333 coins.

Heres where it gets a bit complicated.

I did a little bit of research into this and the only one that i really liked was having a backend using Glitch, Replit, or even GitHub Pages. Then i would create an API Backend using Flask (pythons framework) to handle the requests, aka when the user tries to save their game, and then it would go to a Save endpoint (eg. /saveGame) that accpets user data (aka coin count).

Heres where the problem is.

Scratch doesn't directly support http requests, so the game would detect the amount of coins, and then tell the user to enter the amount of coins they have to the website, which would then perform the algrithiom there, but that still wouldn't solve the problem because the user could still enter like 999999 into the amount and still get tons of coins. In an ideal world, scratch would support http requests and when the user clicked save game, the game would submit all the game data (coins) into a http request to the website, which the website then process that and uses the algrithiom to create a save string ( eg, griffpatches paper Minecraft) , and then sends an http request back to scratch, which then displays the save string that the user can copy and paste the next time they want to load the game.

But, this is not an ideal world and heres the solution i found.

I could create a scratch extension (Using Javascript) that the user could use that is able to submit and receive http requests. However here is the problem for me. This requires knowledge of Scratch's extension API and some JavaScript coding, which i unfortunately don't have, which is why im here asking for help.

Any help would be gladly appreciated, and if you cant help please tell anyone you know that can help about this post.

Thank You!

SubForums: Help With Scripts, Collaboration, Questions About Scratch, Advanced Topics, Developing Scratch Extensions
blubby4
Scratcher
100+ posts

External Save Data Processing & Saving (Advanced) SMART PERSON HELP NEEDED

You could use cloud variables and scratchattach, maybe (I have no experience with it but it sounds like this is perfect for it)

I think about things. Sometimes I think about things too much, and miss obvious simple things

Powered by DjangoBB