# New ChoiceScript: \*create has changed, mygame.js is optional

**URL:** <https://forum.choiceofgames.com/t/new-choicescript-create-has-changed-mygame-js-is-optional/1291>\
**Category:** Announcements\
**Created:** [April 26, 2013, 3:48am UTC](https://forum.choiceofgames.com/t/new-choicescript-create-has-changed-mygame-js-is-optional/1291 "2013-04-26T03:48:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dfabulich](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/dfabulich/32/198373_2.png) [@dfabulich](https://forum.choiceofgames.com/u/dfabulich)\
**Post date:** [April 26, 2013, 3:48am UTC](https://forum.choiceofgames.com/t/new-choicescript-create-has-changed-mygame-js-is-optional/1291/1 "2013-04-26T03:48:00Z")

</div>

In the latest version of ChoiceScript, available on Github, the \*create command has changed; this could break your existing game.

IF YOU HAVE A WORKING MYGAME.JS FILE: You should be able to just delete all of your \*create lines (they’re redundant with mygame.js) and be fully compatible with the latest version of ChoiceScript.

OTHERWISE: You’ll need to make sure your first scene file is called “startup.txt” and that all of your \*create commands appear at the very beginning of that file.

Furthermore, whereas before you’d just use the command “\*create leadership” to define a leadership variable, now \*create requires you to specify a starting value for each variable you create, e.g. “\*create leadership 50”.

In addition to changing \*create, the new version of ChoiceScript introduces two new commands: \*title and \*scene\_list. The \*title command changes the on-screen title of the game, like this:

\*title Choice of the Dragon

The \*scene\_list command allows you to declare the list of scenes in order, which you used to have to change in mygame.js

\*scene\_list  
startup  
animal  
variables  
gosub  
ending

The \*title, \*scene\_list, and \*create commands may only be used at the very beginning of startup.txt. Here’s the example we provide with ChoiceScript: [https://github.com/dfabulich/choicescript/blob/master/web/mygame/scenes/startup.txt](https://github.com/dfabulich/choicescript/blob/master/web/mygame/scenes/startup.txt)

Please feel free to post to the ChoiceScript help forum if you have questions about these changes.

---

<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:** [April 26, 2013, 6:16am UTC](https://forum.choiceofgames.com/t/new-choicescript-create-has-changed-mygame-js-is-optional/1291/2 "2013-04-26T06:16:19Z")

</div>

That certainly makes things more non-coder friendly. I imagine the idea is that people shouldn’t have to edit anything (index.html, mygame.js etc) but the text/choicescript files?

One suggestion I’d make in regards to that is a command to change the the text on the stats button, just the front side - so people can write “Stats” or “Inventory” or “Quest Log” or whatever suits their fancy (“Return to Game” can stay the same).  
I’d also enquire as to whether it’s worth \*temp requiring (or at least allowing) an initial value setting.

Other than that, good job - I think these will be very beneficial changes, and I look forward to more in the future (\*goto\_sceneref – pretty please?!).

EDIT: Thanks for the IE \*input\_number fix! Whenever that was done 🙂

---

<div class="post-metadata">

**Author:** ![Caddmuss](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/caddmuss/32/424_2.png) [@Caddmuss](https://forum.choiceofgames.com/u/Caddmuss)\
**Post date:** [April 26, 2013, 6:17am UTC](https://forum.choiceofgames.com/t/new-choicescript-create-has-changed-mygame-js-is-optional/1291/3 "2013-04-26T06:17:48Z")

</div>

Will you change \*temp as well?

EDIT.  
Ninja’d, but whatever. Consider this a “is interested as well” to CJW’s comment.

---

<div class="post-metadata">

**Author:** ![chibz](https://avatars.discourse-cdn.com/v4/letter/c/59ef9b/32.png) [@chibz](https://forum.choiceofgames.com/u/chibz)\
**Post date:** [April 26, 2013, 9:31am UTC](https://forum.choiceofgames.com/t/new-choicescript-create-has-changed-mygame-js-is-optional/1291/4 "2013-04-26T09:31:07Z")

</div>

I tried extracting the jzip, but was unable to. Kept getting an error message. ☹ My download went OK though.

---

<div class="post-metadata">

**Author:** ![chibz](https://avatars.discourse-cdn.com/v4/letter/c/59ef9b/32.png) [@chibz](https://forum.choiceofgames.com/u/chibz)\
**Post date:** [April 26, 2013, 12:58pm UTC](https://forum.choiceofgames.com/t/new-choicescript-create-has-changed-mygame-js-is-optional/1291/5 "2013-04-26T12:58:04Z")

</div>

Ugh, disregard previous post. Not sure why I got the error message, but tried extracting it to my desktop this time and it worked OK.

---

<div class="post-metadata">

**Author:** ![dfabulich](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/dfabulich/32/198373_2.png) [@dfabulich](https://forum.choiceofgames.com/u/dfabulich)\
**Post date:** [April 26, 2013, 2:28pm UTC](https://forum.choiceofgames.com/t/new-choicescript-create-has-changed-mygame-js-is-optional/1291/6 "2013-04-26T14:28:45Z")

</div>

Yes, \*temp has also been updated to allow (but not require) a value. You don’t have to change anything, but if you’d like, you can now write “\*temp winner true”.

---

<div class="post-metadata">

**Author:** ![dfabulich](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/dfabulich/32/198373_2.png) [@dfabulich](https://forum.choiceofgames.com/u/dfabulich)\
**Post date:** [April 26, 2013, 2:37pm UTC](https://forum.choiceofgames.com/t/new-choicescript-create-has-changed-mygame-js-is-optional/1291/7 "2013-04-26T14:37:47Z")

</div>

Changing the stat button name is on my list; it’s a little tricky to integrate with our other platforms.

I have a plan for the “ref” commands: instead of having separate ref commands, you’d use quoted strings.

\*goto “${friend}”  
\*goto\_scene “${previous}”  
\*gosub “${weapon}”  
\*set “${weapon}\_ammo” +5

One major gotcha with using references like this is that quicktest can’t guarantee the correctness of your code, but perhaps that’s worth it. A related idea is to be able to hint to quicktest that a variable can only take certain enumerated values (“alice” “bob” “carol”), and that a percentile stat must be numeric.

Well, back to work. 🙂

---

<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:** [April 26, 2013, 3:42pm UTC](https://forum.choiceofgames.com/t/new-choicescript-create-has-changed-mygame-js-is-optional/1291/8 "2013-04-26T15:42:02Z")

</div>

^That would be marvellous! 😃  
And thanks for the clarification about \*temp.

---

<div class="post-metadata">

**Author:** ![lordirishdas](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/lordirishdas/32/381_2.png) [@lordirishdas](https://forum.choiceofgames.com/u/lordirishdas)\
**Post date:** [April 26, 2013, 10:36pm UTC](https://forum.choiceofgames.com/t/new-choicescript-create-has-changed-mygame-js-is-optional/1291/9 "2013-04-26T22:36:57Z")

</div>

I really like the update to the temp thanks it will make coding even simpler in this regard for me.

---

<div class="post-metadata">

**Author:** ![2Ton](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/2ton/32/786_2.png) [@2Ton](https://forum.choiceofgames.com/u/2Ton)\
**Post date:** [April 26, 2013, 10:46pm UTC](https://forum.choiceofgames.com/t/new-choicescript-create-has-changed-mygame-js-is-optional/1291/10 "2013-04-26T22:46:15Z")

</div>

@lordirishdas it definitely does XD

---

<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:** [April 28, 2013, 11:48am UTC](https://forum.choiceofgames.com/t/new-choicescript-create-has-changed-mygame-js-is-optional/1291/11 "2013-04-28T11:48:03Z")

</div>

@StanTheMan If you plan to Publish your game through CoG, you should always keep your game up to date.

---

<div class="post-metadata">

**Author:** ![StanTheMan](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@StanTheMan](https://forum.choiceofgames.com/u/StanTheMan)\
**Post date:** [April 28, 2013, 11:39am UTC](https://forum.choiceofgames.com/t/new-choicescript-create-has-changed-mygame-js-is-optional/1291/12 "2013-04-28T11:39:49Z")

</div>

Quick question - if we have a working mygame.js and no \*create commands do we NEED to update…I imagine the answer is yes, it’s just, I’ve come so far…

---

<div class="post-metadata">

**Author:** ![StanTheMan](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@StanTheMan](https://forum.choiceofgames.com/u/StanTheMan)\
**Post date:** [April 28, 2013, 12:02pm UTC](https://forum.choiceofgames.com/t/new-choicescript-create-has-changed-mygame-js-is-optional/1291/13 "2013-04-28T12:02:27Z")

</div>

Righto!

---

<div class="post-metadata">

**Author:** ![Nocturnal\_Stillness](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/nocturnal_stillness/32/100414_2.png) [@Nocturnal\_Stillness](https://forum.choiceofgames.com/u/Nocturnal_Stillness)\
**Post date:** [April 29, 2013, 3:59pm UTC](https://forum.choiceofgames.com/t/new-choicescript-create-has-changed-mygame-js-is-optional/1291/14 "2013-04-29T15:59:05Z")

</div>

With the new revised \*create command how do you do booleans?

I’ve tried

\*create var false

but I get an error about there not being a var variable?

---

<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:** [April 29, 2013, 4:29pm UTC](https://forum.choiceofgames.com/t/new-choicescript-create-has-changed-mygame-js-is-optional/1291/15 "2013-04-29T16:29:19Z")

</div>

@Nocturnal_Stillness I updated the testers with the new version and they’re working fine with \*create var false and \*create var true:  
[https://dl.dropboxusercontent.com/u/7840892/CJW/choicescript/tools/online-cs-tester/mygame/input.html](https://dl.dropboxusercontent.com/u/7840892/CJW/choicescript/tools/online-cs-tester/mygame/input.html)

---

<div class="post-metadata">

**Author:** ![Nocturnal\_Stillness](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/nocturnal_stillness/32/100414_2.png) [@Nocturnal\_Stillness](https://forum.choiceofgames.com/u/Nocturnal_Stillness)\
**Post date:** [April 29, 2013, 4:32pm UTC](https://forum.choiceofgames.com/t/new-choicescript-create-has-changed-mygame-js-is-optional/1291/16 "2013-04-29T16:32:09Z")

</div>

@CJW

strange because I was getting a variable error. I’ll check it again

edit: no still getting errors, now saying scene\_list is not a valid command. Getting a bit late now. So I’ll try again tomorrow.

---

<div class="post-metadata">

**Author:** ![initdoby5](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/initdoby5/32/33433_2.png) [@initdoby5](https://forum.choiceofgames.com/u/initdoby5)\
**Post date:** [April 30, 2013, 9:41pm UTC](https://forum.choiceofgames.com/t/new-choicescript-create-has-changed-mygame-js-is-optional/1291/17 "2013-04-30T21:41:51Z")

</div>

Is there a way to still have a descriptive line below the name of the variable for a percentage stat?

---

<div class="post-metadata">

**Author:** ![chrysoula](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/chrysoula/32/930_2.png) [@chrysoula](https://forum.choiceofgames.com/u/chrysoula)\
**Post date:** [May 1, 2013, 2:10am UTC](https://forum.choiceofgames.com/t/new-choicescript-create-has-changed-mygame-js-is-optional/1291/18 "2013-05-01T02:10:39Z")

</div>

Is \*title supposed to change the title of the game on the starting screen? Because it changes it on the browser border but the starting screen is still My First ChoiceScript Game.

---

<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:** [May 1, 2013, 8:13am UTC](https://forum.choiceofgames.com/t/new-choicescript-create-has-changed-mygame-js-is-optional/1291/19 "2013-05-01T08:13:20Z")

</div>

@Chrysoula - It should change both, you can see that with that link in my last post.

---

<div class="post-metadata">

**Author:** ![chrysoula](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/chrysoula/32/930_2.png) [@chrysoula](https://forum.choiceofgames.com/u/chrysoula)\
**Post date:** [May 1, 2013, 3:34pm UTC](https://forum.choiceofgames.com/t/new-choicescript-create-has-changed-mygame-js-is-optional/1291/20 "2013-05-01T15:34:08Z")

</div>

Hm, I wonder why it didn’t work for me. Will test further, assume it’s something in how I upgraded.

[Next page](https://forum.choiceofgames.com/t/new-choicescript-create-has-changed-mygame-js-is-optional/1291.md?page=2)
