First time writing with choicescript. Scripting error

I got started with choicescript yesterday, and after spending some time I have got a very small “Demo” together. But when I try to open it in Index, I get an error saying scripting error. Here’s the code. I can’t spot where the error seems the be:

*Create Strenght
*Create Creativity
*Create Year
*Create Survival Skills
*Create Wilderness Knowledge
*Set Wilderness Knowledge 0
*Set Survival Skills 10
*Set Year 0
*Set Sanity 100
*Set Engineering 10
*Set Strenght 10
*Set Creativity 10

Ah summmer! The time for vacation. When you got on the plane to Athens this morning you just wish you weren’t going alone.
You were first reluctant to go without her, but she didn’t think you’d have any fun alone in your apartement by yourself, so she said you go a week in advance.
But once you got on the plane, you saw that she’d ordered a nice first-class ticket for you. Maybe things wasn’t all that bad after all?
You can survive a week without your girlfriend.

In boredom you take out your ticket. What name is written on it?
# John
*Set name “John”
*Goto Occupation
# Daniel
*Set name “Daniel”
*Goto Occupation
# Donald
*Set name “Donald”
*Goto Occupation
#None of these are written on the ticket
Oh! What name is then?

	\*input_text name

*Label Occupation
Not exactly the name you would’ve chosen for yourself, but your mother was always a quirky one. Now that you’ve already opened your wallet you decide to
double check that you have your other cards with you. Ah! Your from work. What was your occupation again?
*Set Occupation “Painter”
*Set Creativity %+40
*Goto PainterHobby
#Navy Seals Soldier
*Set Occupation “Soldier”
*Set Strenght %+30
*Set Survival Skills %+30
*Goto SoldierHobby
*Set Occupation “Carpenter”
*Set Creativity %+15
*Set Engineering %+30
*Goto CarpenterHobby
#Video game Designer
*Set Occupation “Video game Designer”
*Set Creativity %+15
*Set Survival Skills %+15
*Set Engineering %+15
*Goto GameHobby

Thank you for any help.

Don’t use Capital Letters on any commands, label names or variable names, e.g.

it should be
*label occupation
*Label Occupation

Ah thank you so much

Removed all of the capital letters. Still getting Script Error. My Internet Explorer doesn’t work so I can’t figure out exactly what’s wrong.

Some other basic guidelines:

-no spaces allowed in label names or variable names, so use either:


-generally best to avoid *create and instead define your variables in mygame.js file. If you look in the example provided you’ll see the required layout–just replace those with your own, remembering not to use capitals or spaces in the names. You can define as many different variables as you need (and will then always have the full list there to refer to).

Without being able to use IE (the only browser properly displaying error messages) it’s pretty much impossible to develop a CS game.

Okay. Finally after much googling got IE to work. Fixed all of the above. Now I get an error that says: “Cannot get the value for setStartingStatsClone: Object is zero or undefined”

I just don’t get it Thank you for helping :slight_smile:

@dno256, in the code you posted, in addition to what @Vendetta has already pointed out, you needed to create variables for sanity, engineering, name, and occupation. If you don’t have those declared in your mygame.js file or in *create commands, then you’ll get a script error from that. Not sure what that “setStartingStatsClone” problem is, but it sounds like it might have something to do with your stats variable in mygame.js. If you have any error in the mygame.js file, your browser will not recognize any of the code in it as valid, which could cause all sorts of problems in the base CS interpreter code that is expecting it to be there. Maybe you could post your mygame.js code as well.

So I got this same error, the error popped on the first variable which had no problem, turned out I forgot to set a variable. I just claimed it like ,strength: and left it there, so check to make sure you set all your variables to something, even if its 0 or “”

Oops. Didn’t note the huge time difference between the original post and Atlaloire’s. Atlaloire, you may have been better starting a new topic.