ChoiceScript Saving Plugin (Update: April 2023)

@Malebranche Which *creates are you referring to?

*create strength 50 *create otherstat "" Those ^^ at the beginning of your startup.txt file after the scene list. The *create command is for your global (or constantly used) stats.

So under all my stats and before any exposition, I’ve added *sm_init Song_Of_The_Fallen | 3. Song_Of_The_Fallen is what I’ve put as my game_id in smPlugin.js with a slotCount of 3. But now it’s throwing up this error.

Which is strange since I added both of those to my index file? I added it to the index file in the mygame folder since the one in the web folder doesn’t seem to have anywhere for me to put it. I did the same thing for the original save.js system that began this thread, and that worked fine. I’ve also placed copies of smPlugin.js and smPluginMenuAddon to both the mygame folder and the web folder.

Reading up, specifically looking at what @Flurrywinde11 posted, I get the impression that you’re also supposed to declare *sm_load and sm_save? I’ve also fiddled with the quick-save-menu .zip folder @CJW linked to in another thread, but to no avail.

So you have a copy of each one in the mygame & in the web folder (4 files in total 2 of each)?

Yes, but the error comes up either way. You say you’ve manged to get it working? Is there any chance i could see a snippet of your relevant code?

I only have 1 copy of each, placed within my web folder, like so:

In index.html:

And in startup.txt:

That’s pretty much exactly, what mine is…which index file did you edit?

The one in the mygame folder.

Still throws up the same error, though it also throws up this.

I’m downloaded the lastest version of choicescript from the website and I’m busy updating my firefox, hopefully that’ll have some effect, because as far as I can tell we’re doing exactly the same thing.

If you remove smPluginMenuAddon.js from your index.html for a bit, save index.html, and double click index to open it, does it still throw up the localStorage error?

Yup except now that’s the only error it throws up, and what’s really weird is I managed to get it sort of working on the quick-save-menu.zip folder I mentioned earlier (which I just realised is actually from your Saving “on the fly” topic). So figured I could just move my scene files over that and see what happens, and it threw this up.

I’m starting to think it’s just not meant to be.

Ok, then if it’s still throwing up that particular error, it’s probably your browser (which you said you already updated)… Do you have any settings on your browser such as “do not accept cookies from 3rd party websites” checked?

I’m 100% certain it’s not my browser. I’ve managed to get it working perfectly on that quick-save-menu.zip folder, I’ve done multiple tests and it’s completly functional. I then went through the same steps for my actual game, and it still gives the same errors. I think the issue must have something to do with something in my scene files, which is odd since this is the only time I’ve tried to do anything outside of choicescript to those specific files.

Hmm… well, about the only other thing I can recommend trying, if you haven’t already, is to reset everything, as in copy all your scene files to another folder, re-download CS, then re-download the other files (smPlugin.js etc.).

A bit of a random question, but you do have your game’s name and the amount of save slots assigned to it separated by a pipe ( | ) with a space on either side right? Sorry if it sounds like I’m asking a stupid question, but since I can’t see your files, I don’t know what or what you didn’t do.

Can you zip up and post your entire “web” folder?

@Malebranche I do yes, what’s frustrating is that I was able to get it to work, but when I try following the exact same steps on my actual game it throws up errors.

@Flurrywinde11 Doesn’t seem like I can upload .zip files, but here’s a dropbox link

smPlugin MUST come BEFORE the add-on file in index.html, this almost certainly the problem you’re having.

@CJW I’ve checked and it is before.

I’m able to get it working using an earlier example of yours as a testing base, but whatever I do doesn’t seem to translate.

Your problem was an old (and damaged) version of smPlugin.js - thus it wasn’t loading correctly.

Replace smPlugin.js with the latest one found here.

@CJW Yeah, I’ve since managed to get it working aside from two issues. If I don’t remove *author Left4Bed, the game crashes and when you quicksave it doesn’t change the name of your save file, even though it did save. So it reads as “No Data” even though it has been saved and can be loaded.