So I just played around with the save mod - which is long overdue:
I have a strange case with having the *sm_init as the first line of code. It seems to display anything below the code even if it is a command.
Here in my build I’m in the second txt file after I finish a first chapter and I wanted to assign an autosave. This is the topmost bit of the txt:
*sm_init fcasaves | 5
*set para1 xx
*set para2 xx
..
..
..
The first page of this chapter would display the *set para1 xx in the narrative. It showed up like
*set para1 xx
The first sentence of the narrative goes here..... like it normally would
When I moved the *sm_init away from line 1 and put it somewhere in between my dozens of lines of variable setup (before the first narrative is displayed to the screen), it fixed the stray printout. The *set para1 xx would stay off screen.
As sidenote, I added alertify.min.js and its css to the directory and linked them to index.html manually - I’m still using the CS engine I downloaded before the whole alert pop-up thing was deployed, but I’m not convinced that’s the problem source. The autosave itself seemed to work just fine with *sm_save 0 | false | Autosave which displays nicely after a radio button as “Autosave” when the slot menu is brought up.
@CJW From what I can tell, yeah.
So like, as with anything that’s system/backend-related, I thought it’s best to stick these kinds of commands up top before the rest of the code? A command line showing up along the story is definitely something new for me.
The save works fine (…so far, only half an hour in ), I use a portion of your example txt to present a Load-Delete menu at the beginning of the first scene file - I call it ‘chapter’ in my narrative. The progress is saved right where the *sm_save is placed in the second scene file, and it loads back without problem.
It’s on Firefox 21, if it helps.
Edit: Would you happen to know if there is any character-type limitation for the slot name? Alphanumeric only, can’t use special signs { }, stuff like that? I think Javascript is usually not very forgiving on that.
So I poked around and as @Nocturnal_Stillness said, you simply need to use it after any *create, *title or *scene_list commands - I can’t really change that, it’s just how CS’s interpreter has been coded, it’ll throw an error if you use any command before those initiation ones.
@FcA@Kurisu
That should solve both your problems, but let me know if it doesn’t.
FcA you should be able to use most typical characters as the data is stored as a string.
Just starting to notice a few other bits and pieces wrong with the save system actually, so if you use the plugin please check back for an (advisable) update in the near future.
I might just rewrite the entire thing actually, so if anyone has any feature/ease of use requests - now would be the time!
I just updated smPlugin.js and would advise anyone using it to overwrite their old one with this version. You shouldn’t notice a functional difference, but everything is tidier and the inbuilt errors should finally work as intended - making future bug fixing a lot easier.
Arguably it should also support older browsers that can only utilize cookies now, but I was having trouble proving this (as I can’t seem to get a proper copy of IE7 installed on my machine).
I have another minor issue that came up though, I don’t seem to be able to assign a name to the hidden auto-saves I make for the player at the end of every chapter.
Example:
*sm_save 0 | false | End of Prologue
Still gives me the default auto-save name with the date and time. Making it not hidden works as intended, though. Any ideas?
@CJW Thanks so much for going the extra mile fixing that! I’ll be trying out the updated version in a bit; gonna take a while to come back here with a feature request, if any.
@Kurisu I place an autosave at the beginning of the next chapter instead, if it helps. The custom name I assign for the target slot works okay.
Pardon me for being so late to the proverbial party, but can you summarize what I’d need to do to get save slots for my game? I’d read through the 4 pages here, but my attention span just isn’t there…sorry.
The code for that can be found here, and should work out of the box, once you’ve included smPlugin.js.
Just remember to edit index.html and add the following line at the top, beneath the similar lines for scene.js ui.js etc: <script src="../smPlugin.js"></script>
And of course, to actually download and put smPlugin.js in your ‘web’ folder along with ui.js and scene.js etc.
I’ve a quick question to anyone who uses this, is thinking of using it, or even just plays a game that uses it. It’s related to a thought I had the other day.
Would you prefer the save fields/options to be completely incorporated into the CS interface, or are you quite happy with them in the alert/pop up box format?
The following screens will hopefully illustrate the idea:
They don’t need to add it, in published apps their propriety save works just fine, better even, as the apps save state and saves can be uploaded/downloaded to various devices. The only downside (in my opinion) is the lack of deletion - which I’m sure they’re looking into.