Choicescript help pllz

it not the scenes in scenenavigator it says “scenenavigator” undefined Microsoft jscript runtime error line:1 char:1

is your mygame.js sceneNavigator written exactly the same as it was provided from CoG? Also, did you edit any other CS JavaScript files? (that end in .js)

no didnt change it it just doesnt work dont know why

Re-download choicescript and replace all the .js files from the web folder with the ones you downloaded. Then, make sure mygame.js’s structure is the same with the one you downloaded…

thanks and how to fix non-exsitent varible

perhaps you made a variable in mygame.js like this:
----,Strength: 10
Instead of “Strength”, write “strength” (always use lowercase letters).
And, check the name of that variable in mygame.js and then the name of that variable you use on the line the error is; make sure they match.


Here, you can find more info on that specific error (the 3rd one on the list) ^^

i am good at almost everything else but stats. I am doing everthing that it says but
when i go to the stats screen it says line 5: non exsitent varible (I dont know where the
line is!) please help.

Line 5 is most likley in one of your scenes. What it is telling you is you have not defined a varible. Does the error message say which varible does not exisit? If so just create the varible, other wise you need to look for it in the scenes. It should be line 5 usaly something you are trying to set. That’s what I have run into, hope this helps.

if the error shows when you enter the stat page, check line 5 in the “choicescript_stats.txt” file. That’s where a variable is called that doesn’t exist.

*input_text name
says line 36: non-exstient varible “name”

*input_text var

Where var is the variable (defined in mygame.js) that you wish to store the input information in.

That error means you have not defined a variable in mygame. js called ‘name’ - note that variables are case sensitive. Name is not the same as name.

So I put it text_name
strength: 50
,leadership: 50

how do i put first_name (input_text) into mygame.js

Any new variables required (numeric, string or boolean) should just be added to the bottom of the list of default starting variables (mygame.js calls these stats), so in your case that particular section of mygame.js might then look like this:

strength: 50
,leadership: 50
,first_name: “none”

This would define first_name with a starting value of “none”, enclosed in “quote marks” because you want it to be a string variable (i.e. one that holds text; those first two are numeric variables because they contain just a number). You can now use this string variable with such as:

*input_text first_name

And it will replace the first_name string value (“none”) with whatever the player enters. If you then use:

${first_name}

in your scripting or Stats screen, it will display the actual text currently stored as first_name.

More info on the three data types: http://choicescriptdev.wikia.com/wiki/Data_types

More info on mygame.js: http://choicescriptdev.wikia.com/wiki/Mygame.js

thank you @Vendetta now name is up and running

*choice
#kickboxing
*set strength 70
*set speed 40
#brazilian ju-juitsu
*set speed 70
*set strength 40
*finish

tried doing *set one space the error is
line 37:expected choice body

That particular error comes from not laying out the *choice #options in the normal (i.e. “expected”) fashion. Hard to say for sure what it might be without knowing which is your actual line 37 or seeing the indentation you’ve used, but the first of your two #options does not finish in the prescribed manner – they should both have a *goto, *finish or similar after those *set commands.

I’d recommend reading about the proper requirements for *choice:

As well as brushing up on the basic rules of correct Indentation:

help with error please line 277: ,invalid indent,expected at least one line in if true block

Your error is because of doing the indentation wrong; you need to add a line (i.e. space, tab, more spaces; whatever you use as default indentation) on the line after the *if command:


*if kickboxing
    *set speed 40

At least, this is what I think causes your error. Also, as @Vendetta said…


the link above should be helpful if you encounter these errors often.

I still cant figure out the *if and else commands im willing to pm the text to someone
because for the life of me I cant figure out what the problem is but you have to promise
to not publish the game or show anybody.

What’s your issue exactly? Have you tried looking at the wiki?

Or COG’s tutorial?