ChoiceScript Saving Plugin (Update: April 2023)

Hmm, that’s weird. I recalled one of my tester responded the exact same error you mentioned, but I can’t reproduce it, so I assumed it’s because I’d recently updated my game.

Maybe because the *ifs? It could be one of these:

  1. The condition for the option itself to appear. Try removing the *if line and see if it works.
    If it is, you can put the *if at the same line with the #option instead, like a *selectable_if, to keep the condition.
  2. The *if reread = false. I know it’s a fake choice, but try adding *goto in case the condition isn’t met. See if that works.
1 Like

Good guess:

But unfortunately, occurs again (same checking process as above, delete, save, load all same page), and you’ll see the error message now includes the choice at the end.

Uncaught Error: chapter_01_the_carpenter__ria line 35: invalid line; this line should have a scene name followed by an error message: *if ((reread = false) or ((c_m_z#jump_to_page_minus_one) = 0)) #Turn the page.

Trying 2/

This doesn’t appear to have an effect either (another good guess though, thank you.)

Hm, I have no idea then, I’m afraid.
Btw, does hash icon # can be used inside variables like that? Do you have other instances of it running fine?

1 Like

Thank you for your time anyway!

Re the hastag in the variable - that is picking out a number from a number string. It works in playtesting, with quicktest and with randomtest.

But something clearly isn’t working when I use this plugin - I’m just hoping there’s a fix for me : )

1 Like

Oh, I remember about the hast. Neat trick!
But yeah, I don’t think I can help you further on this. Maybe the others can figure out what’s the cause.

1 Like

Anyone with insight into this issue?

@Charles_Parkes would you mind PMing me a .zip of a (ideally, minimal) reproducer?

1 Like

Sure. Out of time now, but will do asap. Thank you very much for your reply.

2 Likes

Just popping in to ask if anyone knows if the plugins are working with the latest version of Choicescript! I’ve properly installed everything (at least I think so, I followed one of the posts here in this thread and I’ve done it before), but I keep either getting errors saying I haven’t installed smPlugin (which I have, it’s in the web folder and I’ve modded index.html in mygame) or that *sm_init is a non-existent command.

Have I done something wrong or is it broken? :dizzy_face: I generally rely on local saves to help test things out, so any help would be appreciated!

I’d imagine, if it’s not recognising the command, you’ve probably not included the script file correctly. Hard to say without seeing your code. You can also try opening the browser console and checking for errors (this is F12 for most of them).

1 Like

The script in my index.html looks like this:

index

The smPlugin and smPluginMenuAddon have both been included in my web+mygame folder (the latter of which fixed it not recognizing the *sm_init command), but now I’m getting an “Error: Bad Slot - Has smPlugin been included?” problem. I feel like I had this problem last time and I don’t remember what I did to fix it.

I don’t have errors pertaining to those when I do F12, but I do get this an error with the version.js as well, even though I just updated ChoiceScript earlier today. No idea if it’s related in any way, shape, or form.

Thank you for your help and patience! :smiling_face_with_three_hearts::purple_heart:

Move save .js files one level higher to web folder.

1 Like

They’re also in my web folder, but just having them in the web folder alone, it wasn’t recognizing my *sm_init command. Hence why I copy+pasted them to mygame, and now it’s recognizing *sm_init but I’m having the aforementioned problems. Thank you for trying, though! :slight_smile:

Interesting. Just for the sake of it - what will happen if you change script path to

in both file cases?

1 Like

Oh no, it seems like CoG blocked whatever your suggestion was! :frowning:

1 Like

Goddamit, web reply, you were supposed to be the chosen one! shakes fist

Sorry about that. Try with …/ part removed before both scripts in index. If your files are in mygame folder, that should be the working path.

1 Like

I tried that now, too, but it didn’t work. Also tried downloading smPlugin again and replacing it in case something broke during the download, but alas. Everything’s still busted. :pensive: Thank you for your help/ideas!

Same thing in other browsers? Have you tried an alternative like chrome?

1 Like

I’ve tried chrome a couple different times throughout the process, and once again right before I replied to you. :frowning: Unfortunately, I get the same error each time.