# How do I make checkpoint/save?

**URL:** <https://forum.choiceofgames.com/t/how-do-i-make-checkpoint-save/2583>\
**Category:** ChoiceScript Help\
**Created:** [July 21, 2014, 2:23am UTC](https://forum.choiceofgames.com/t/how-do-i-make-checkpoint-save/2583 "2014-07-21T02:23:31Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![that1german](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@that1german](https://forum.choiceofgames.com/u/that1german)\
**Post date:** [July 21, 2014, 2:23am UTC](https://forum.choiceofgames.com/t/how-do-i-make-checkpoint-save/2583/1 "2014-07-21T02:23:31Z")

</div>

Yeah title is pretty self explanatory. I don’t have a clue how to and would like to learn. Thanks

---

<div class="post-metadata">

**Author:** ![gkkiller](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/gkkiller/32/18994_2.png) [@gkkiller](https://forum.choiceofgames.com/u/gkkiller)\
**Post date:** [July 21, 2014, 4:34am UTC](https://forum.choiceofgames.com/t/how-do-i-make-checkpoint-save/2583/2 "2014-07-21T04:34:55Z")

</div>

> **[ChoiceScript Saving Plugin (Update: Sept. 2019)](https://forum.choiceofgames.com/t/-/983/116)**
>
> Looking for something that allows players to save ‘on the fly’ (like save.js) but with multiple slots? Try the smPluginMenuAddon.js Release - smPlugin.js The new ‘framework’ save system is done. ...

  
That should help.

---

<div class="post-metadata">

**Author:** ![that1german](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@that1german](https://forum.choiceofgames.com/u/that1german)\
**Post date:** [July 21, 2014, 8:44pm UTC](https://forum.choiceofgames.com/t/how-do-i-make-checkpoint-save/2583/3 "2014-07-21T20:44:52Z")

</div>

I went and downloaded the save.js file but after I edited the index.html and the null in save.js, I get this

TypeError: window.nav is undefined

and I tried to open the game after deleting it, I get Script Error. Did I just break my game?

---

<div class="post-metadata">

**Author:** ![fantom](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fantom/32/8537_2.png) [@fantom](https://forum.choiceofgames.com/u/fantom)\
**Post date:** [July 21, 2014, 9:53pm UTC](https://forum.choiceofgames.com/t/how-do-i-make-checkpoint-save/2583/4 "2014-07-21T21:53:30Z")

</div>

@that1german You’d have to ask @CJW, but that save system of his may now work anymore with the latest version of CS. I know of another way of doing it, it just wouldn’t persist if the browser is closed.

---

<div class="post-metadata">

**Author:** ![fantom](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fantom/32/8537_2.png) [@fantom](https://forum.choiceofgames.com/u/fantom)\
**Post date:** [July 21, 2014, 10:27pm UTC](https://forum.choiceofgames.com/t/how-do-i-make-checkpoint-save/2583/5 "2014-07-21T22:27:12Z")

</div>

At the beginning of startup.txt, for every \*create command you do at the beginning, you create a duplicate for every save slot you want to create. For Example:

\<pre \*create health "0" \*create health1 "0" \*create health2 "0" \*create strength "0" \*create strength1 "0" \*create strength2 "0" ``` Then, in another scene file, I'm going to call it "extras", do something like this: ``` \*label saveslot1 \*set health health1 \*set strength strength1 \*return \*label saveslot2 \*set health health2 \*set strength strength2 \*return ``` When you create a checkpoint, you do this ``` \*set health1 health \*set strength1 strength ``` Now whenever you want to load up a save point you use *gosub_scene to reset your stats, like ``` \*gosub\_scene extras saveslot1 ``` And then you use another \*gosub\_scene or \*goto (whichever is applicable) to go to the part of the game you want to go to.

---

<div class="post-metadata">

**Author:** ![BlazedStorm](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/blazedstorm/32/1137_2.png) [@BlazedStorm](https://forum.choiceofgames.com/u/BlazedStorm)\
**Post date:** [July 22, 2014, 12:33am UTC](https://forum.choiceofgames.com/t/how-do-i-make-checkpoint-save/2583/6 "2014-07-22T00:33:45Z")

</div>

I can assure you that CJW’s system does work with the latest version of Choisecript. There is a tiny thing that needs altering however, but I’ll have to look through my files later on to check

---

<div class="post-metadata">

**Author:** ![fantom](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fantom/32/8537_2.png) [@fantom](https://forum.choiceofgames.com/u/fantom)\
**Post date:** [July 22, 2014, 5:19am UTC](https://forum.choiceofgames.com/t/how-do-i-make-checkpoint-save/2583/7 "2014-07-22T05:19:45Z")

</div>

I suppose a better question would be if a game is publishable with @CJW’s system? It’s probably good for testing (the reason most people use it, obviously) but what about once you’re ready for release?

---

<div class="post-metadata">

**Author:** ![that1german](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@that1german](https://forum.choiceofgames.com/u/that1german)\
**Post date:** [July 22, 2014, 5:36am UTC](https://forum.choiceofgames.com/t/how-do-i-make-checkpoint-save/2583/8 "2014-07-22T05:36:07Z")

</div>

@BlazedStorm weird I did exactly what it told me to do in the link that @gkkiller gave. Unless I’m suppose to copy/paste the save.js with that new framework system that CJW posted later on in the thread?

---

<div class="post-metadata">

**Author:** ![gkkiller](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/gkkiller/32/18994_2.png) [@gkkiller](https://forum.choiceofgames.com/u/gkkiller)\
**Post date:** [July 22, 2014, 7:41am UTC](https://forum.choiceofgames.com/t/how-do-i-make-checkpoint-save/2583/9 "2014-07-22T07:41:18Z")

</div>

Try downloading a fresh copy of the latest CS, and putting your scene files and mygame.js in that to see if they work.

Also, you should be using sm\_Plugin.js. save.js is outdated.

---

<div class="post-metadata">

**Author:** ![BlazedStorm](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/blazedstorm/32/1137_2.png) [@BlazedStorm](https://forum.choiceofgames.com/u/BlazedStorm)\
**Post date:** [July 22, 2014, 8:26am UTC](https://forum.choiceofgames.com/t/how-do-i-make-checkpoint-save/2583/10 "2014-07-22T08:26:13Z")

</div>

What @gkkiller said. To be honest, I thought you meant the sm version in that post, so I misread it. Most people still use the plugin as it allows you to create a series of save files without the need of extra on screen buttons that save.js has. It also has a flashy green success box, because like aesthetics for the win

However I am not sure if the post still contains what needs to be altered in the default files for sm\_Plugin to work. Was it deleted? I haven’t checked

---

<div class="post-metadata">

**Author:** ![CJW](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/cjw/32/111787_2.png) [@CJW](https://forum.choiceofgames.com/u/CJW)\
**Post date:** [July 22, 2014, 4:25pm UTC](https://forum.choiceofgames.com/t/how-do-i-make-checkpoint-save/2583/11 "2014-07-22T16:25:43Z")

</div>

smPlugin definitely works with the latest version of CS, I can’t comment on save.js but I’ll try and have a look tomorrow.

@fantom  
Arguably it would work, but I work on the premise that I doubt COG would allow it, although in fairness they don’t really need to, the state persistence on the mobile apps is pretty good.

@that1german  
save.js and smPlugin.js shouldn’t ever be used in conjunction (use one or the other, not both). I can only think that the error is caused by a typo in your included code and/or including it before all the other .js files (it needs to come after them).

@BlazedStorm  
You need to edit save.js manually but with smPlugin you don’t, you just use the \*sm\_init command to set up all the stuff you’d need to set manually with save.js 🙂

---

<div class="post-metadata">

**Author:** ![that1german](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@that1german](https://forum.choiceofgames.com/u/that1german)\
**Post date:** [July 23, 2014, 9:39pm UTC](https://forum.choiceofgames.com/t/how-do-i-make-checkpoint-save/2583/12 "2014-07-23T21:39:11Z")

</div>

yeah I must have screwed up when I was editing the index part with the save.js cause it works now when i put it into a practice game
