ScratchData LogoScratchData
Back to KIBTM's profile

Save-Code Engine V3.0 remix

KIKIBTM•Created March 6, 2022
Save-Code Engine V3.0 remix
1
1
5 views
View on Scratch

Instructions

Generalized Save-Load Engine used in my Pony Clickers game. Update 10-22-2016: Included code showing how to encode uppercase strings. Update 09-16-2016: Included code showing how to save decimal numbers. Negative Numbers now supported. Shuffled encoding for slightly better security. New engine does not support codes generated with the old engine. Random: Randomly sets the sliders. Save: Generates a save code and displays it. Load: Asks for a save code and sets the sliders. Pro's: Simple way to save game data. Includes anti-cheat mechanism to protect against randomly entered codes. Con's: Save codes can get quite large when saving a lot of variables. Project Instructions If you want to use this engine in your project you will first need to set it up. Setup: Drag the sprite called "Save-Load Engine" to your backpack. Next open your project, and drag the Save-Load Engine from your backpack into the sprites area. Next click the green flag, this will let the engine declare its variables and the save tables. Next stop your project. Save: First clear the SaveTable, next add the variables you want to save to the SaveTable. After that broadcast the SaveGame event. The engine will read the SaveTable, generate the SaveCode, then broadcast the SaveCodeGenerated event. It's up to you when to show/hide the SaveCode table, but I recommend showing it once you receive the SaveCodeGenerated event. Load: First you will need to ask the player for their save code. Next clear the SaveCode table, add the (answer) to it, then broadcast the LoadGame event. The engine will read the SaveCode and try to build the SaveTable. If the engine can build the table the SaveCodeLoaded event is broadcast. You should load your variables in the same order that you saved them. If the engine determines that the save code is invalid, it will broadcast the InvalidLoadCode event. You should not try to read any data from the SaveTable when this happens.

Project Details

Project ID654958830
CreatedMarch 6, 2022
Last ModifiedMarch 6, 2022
SharedMarch 6, 2022
Visibilityvisible
CommentsAllowed

Remix Information

Parent ProjectView Parent
Root ProjectView Root