If you’re hosting on Dashingdon with a game that isn’t compiled, I think all you have to do is include the command:
*sm_init mygame | 3
at the beginning of your first scene file. Then check the little box on the Dashingdon ‘edit game assets’ page to enable the save slot system. I have my first scene file in a different .txt file to startup.txt, so I put the *sm_init command at the top of that first scene.
There are instructions on the Dashingdon ‘edit your game assets’ page, too. And then you’ll be good to go with save slots!
Will that suit, or do you need it to work in a compiled game? Or did you want to have specific save points? If so, you can also have a look at this post.
For sure! @dashingdon’s support for the save system in the hosting service has made using the plug-in even more convenient and accessible, which is great.
I usually comment out the *sm_init line when I’m writing and coding, since the autotests don’t get on with it, and then enable it again when I’m ready to upload the new material.
I’ve made a tiny change to smPluginMenuAddon.js that should fix a bug where the menuAddon would always initialise with 3 slots, regardless of the *sm_init parameter, outlined here:
If you’re happily using 3 slots, there’s no rush to update, but there’s no harm in it either! Just download the file via the same link and replace @dashingdon
I can’t seem to get the saving system plugin to work with the very latest version of ChoiceScript. When I try to run the game in Firefox, it gives me the error: ‘Non-existent command ‘sm_init’’.
Hi, I hope I’m not causing an issue by posting in this thread. I’m running into a bit of an issue. I’ve read through everything in here, top to bottom. I can’t seem to get this working.
What I’ve done:
Download both files (“smPlugin.js”, “smPluginMenuAddon.js”).
Place both files into the “web” folder, where “ui.js” already exists.
Go into “mygame” folder. Open “index.html”.
Add the following lines (in exact order) to the “index.html” file, making sure that they come after the other “.js” files in.
Go into the “scenes” folder. Open “startup.txt” (or first file).
Place “*sm_init” between the variables created and the start of the story text.
*create control_world false
*sm_init
Chapter One: A Sloppy Beginning
Save and close file. Return to the “mygame” folder.
Right-click “index.html” and open with IE, Edge, or Firefox.
Problem:
For some reason, it won’t work. Did I miss any steps?
For step 4, I tried setting the two added scripts above the “mygame.js” script, and once above the “navigator.js” script.
For step 7, I’ve tried “*sm_init”, “*sm_init mygame | 3”, and “*sm_init The_Necromancer | 3”.
Errors:
A popup window: “Unspecified error.”. I press OK.
The drop down menu displays, but all three slots say “Error: Bad Slot - Has smPlugin been included?”
None of the story text is displayed at this point. Not sure if it is relevant.
Yes, it’ll work in a browser as long as you’re using your copy of CS with the modified files in index.html.
The ‘game code’ is essentially a unique identifier for your game. So, if your game were called Endless Fountain and you wanted three save slots, the *sm_init line might look like: