ChoiceScript Saving Plugin (Update: April 2023)

Is there a way to have the auto save as normal but have the option to save whenether ie slot 1 would be auto save then slot 2 would be a player save?

1 Like

Of course, what I mean is… User interface wise, how would be best to display the slots? A pop up box, additional buttons, drop down menus?

I’ve actually got them as *choice options in Terminal, but that required a little bit more work in terms of configuration. Is it a worthy trade-off?

1 Like

double post/bad net.

Working on a little something now, rather than making a pre-made system, I’m thinking ‘framework’.

You’ll include the .js file as you currently do, but it won’t do anything except provide a load of new commands, which you’ll have to implement into the game yourself.

It’s more powerful and more flexible, though perhaps a little bit trickier setup, certainly more time consuming anyway.



*label load
*choice
 #Load Slot 1
  *load 1
 #Load Slot 2
  *load 2
 #Load Slot 3
  *load 2
 #Load Auto Save
  *load 0

*label save
*choice
 #Save Slot 1
  *save 1
 #Save Slot 2
  *save 2
 #Save Slot 3
  *save 3

-----------------
*label top_of_page
*autosave

Fred went on a walk...


How does that look/sound?

And are there any specific requirements any of you would like it to meet, or certain commands you want to be able to use?

@CJW

I’ll try it, and let you know if a coding noob can get the hang of it!

EDIT: sorry misread the post it isn’t actually done yet *do’h* but that still sounds simple enough to use.

Not quite, no ^^ - It’s getting there though.
I’ve rewrote everything from scratch, it’s a brand new system.

Am I heading in the right direction?

… Holy Moly! You can now name your saves and load them later?

@Happy Your saves should always persist across browser sessions, even in the current version of this mod.

But now you’ll be able to have more than one and rename them amongst other things! :slight_smile:

The new system you’re making looks wonderful so far; I wasn’t planning on using the other (autosaving) system, but I’ll be using the new one (as I don’t want the player to be able to save/load at every page, but only at certain points) :slight_smile:

A question would be, would implementing/removing this new system you’re making be as easier as the autosaving one?

1 Like

@AlexCosarca Hey man, good to see you!
To answer your question; You’ll install this by including the script file but you’ll need to use a new set of choicescript commands and choice commands to tailor your own saves.

It won’t work “out of the box” but it doesn’t require
any j/s edits, so ‘installation’ remains relatively simple! :slight_smile:

I’m trying to keep it within a careful balance of simplicity and flexibility.

1 Like

@CJW that’d be awesome and very useful!

1 Like

Glad to hear it!

Currently the setup is like so:

*save 0 | false | ACT V: Hall of the Dead

The command has three arguments (or parameters), but the last one is optional.

  1. The save slot: Takes any integer value

  2. Hidden/Shown Save: Takes only ‘true’ or ‘false’

true = player will be notified of the save/load and given the option to rename and/or cancel it.

false = the player will not be notified of the save/load, nor given the option to rename or cancel it (good for autosaving/checkpoints!).

  1. Default Save Name (optional): Takes a text string.

If the player is prompted to rename the save, this will be the ‘suggested’ or default value. If this argument is emitted, "Save " + the slot number will be the default. e.g. Save 4.

If it’s a hidden save and this argument is given, the save will be named as the value passed for this argument, if this argument is emitted the save will be called ‘Autosave’ and include the time and date of the save (according to the player’s local computer clock).

Some examples:



*save 1 | false | Jack's Diner - Chapter 3
*comment this is a hidden save in slot one and it will be called 'Jack's Diner - Chapter 3'

*save 0 | true
*comment this is a shown save in slot zero and it will be called (by default) 'Save 0' - though the player will be prompted to rename it.

*save 3 | false
*comment this is a hidden save in slot 3, it will be called something like:
"Autosave on 22/12/2012, at 19:03"

*save 3 | false | "This is an autosave Mum!"
*comment this is a hidden save in slot 3 that will be named "This is an autosave Mum!"


I hope that gives you an idea of how easy and yet flexible this new iteration will be in comparison to the old one… Please let me know ASAP if there are any additional parameters or commands you think would be of benefit!

1 Like

I’ve actually removed the option for a default name for the ‘shown’ saves as it’s rather redundant. Passed parameters for such will be ignored.

It looks good enough on my side (and good for my game as well) :slight_smile:

1 Like

Sounds great @CJW - looking forward to having a look at it :slight_smile:
Will also be brilliant from testing (as well as playing) point of view since i’ll be able to have multiple saves for the branching storylines in my WIP game.

1 Like

Progress is good! Great, even. I’m really liking how it’s turning out.

Something to note is that I’m utilizing the new alertify.js library included in the latest versions of choicescript, so if you haven’t already I suggest you update your games.

It’s a simple matter of downloading the latest copy of cs and copying your scene files and mygame.js over.

Older versions of choicescript will not be compatible with this saving system!

1 Like

Right… Initial coding phase over.
Now I need some Guinea Pigs, any volunteers?

1 Like

@CJW

I’ll test it if you want?

@Nocturnal_Stillness I’ll PM you the file link and instructions within a couple of hours :slight_smile:

Make sure your CoG version is the newest in the meantime!

@CJW

Thanks, quick question is the latest update the one that added the restart button or is there an even newer one? I ask because I couldn’t find alertify.js in my folders

EDIT: just found the file on the site, it was only added 7 days ago so I’ll redownload choicescript.

EDIT2: Just for the record I’m in the UK so I might be asleep when you send the file. (It’s 9:33pm where I am)