Creating a save game option within the code

I’m having trouble with figuring out to code a save game so that the save game and load game buttons on dashingdon.com are useable. I tried the old widget recommended on the wiki, and tried the password version of the save game, but neither of those are what I need. My game is pushing 20,000 words as of chapter four, and speedruns are getting increasingly unwieldly with every updated chapter.

If anyone had suggestions, I could be very grateful.

-yours, Tobias

1 Like

Have you enabled this in the details?
image
If you’re unfamiliar with it:

2 Likes

Step 1: Put this code below your *achievement lines at startup.txt (or below *create stats if you don’t have any achievements)

*sm_init FillThisPartWithARandomNameOfYourChoiceLiterally | NumberOfSaveSlots

Step2: Check the checkbox indicated by @N1GHTMAR3 above :point_up_2:t4:
You can do it via the [Game Details] menu.

2 Likes

Ah, thank you very much! Your suggestions were very helpful, and I will absolutely keep this in mind for when I code future games.

2 Likes

quick question when the game is published will an option for it still be available? I noticed games I have tried once they get published seemed to lack this feature.

If what you meant by this save system is @CJW’s saving plugin, then yes, the plugin will be removed post-publishing. This corresponds to CoG’s guidelines that, IIRC, don’t accept any kind of code modification to a published works (javascript modification).

However, when an author writes their own saving system inside their scene.txt, the save system will stay there.

Thanks that’s good to know.

1 Like

The only similar system I can think of is a checkpoint one where you can save at a certain time and then go back to that checkpoint if you die/feel like it.