So, I'm having trouble with playtesting

It keeps telling me that ‘Scene’ is undefined, whenever I try to open it via the index folder.

Here’s the code in my startup file.

*title The Strongest weakling

*stat chart

*create Smarts 0%
*create Strength 0%
*create Agility 0%
*create Leadership 0%
*create Men
*create Women
*create NB
*create MenA
*create WomenA
*create NBA
*create AA

*create Shyness 0%
*create Boldness 0%
*create Suaveness 0%
*create Obliviousness 0%
*create Sarcasm 0%
*create Genuine 0%
*create Wholesome 0%
*create Edgy 0%
*create Bravery 0%
*create Fear 0%

*scene_list
startup
char_creation


This is it. I'm finally here. The London University for Superheroes. I'd never thought I'd 
actually get here. Now, I'm not.....completely....here yet. We're still at the entrance exam.
The written and vocal exam was done before this. All around me are unfamiliar faces, one which 
breathes fire, another that could chomp through metal.....yeah. 


90% of the whole planet has safety nets like these, that the common person would call Powers.
Unfortunately for  me, I'm......sorta in the 10%.

*page_break  Oh, right, me.

I looked right next to me, and saw....

*choice
	#A decent-looking guy.
		*set Men true
	#An okayish-looking gal.
		*set Women true
	#A good-enough looking person.
		*set NB true
*page break

Hey, I may not be the most attractive, but it counts for something, y'know. The name's

(first name)

*input_text name

*page break

(surname)

*input_text sname

*finish And what I look like..... 

Then there’s my character creation:

Starting with my skin, it's

*fake choice 
	#olive.
	#brown.
	#tan.
	#fair.
	#pale.
*page break

*finish

*ending

and my stats screen:

*stat_chart

text name sname
percent Smarts
percent Strength
percent Agility
percent Leadership


opposed_pair Shyness
Boldness

opposed_pair Suaveness
Obliviousness

opposed_pair Sarcasm
Genuine

opposed_pair Wholesome
Edgy

opposed_pair Bravery
Fear

Whenever I try to run this via both index files, it tells me that ‘Scene’ is undefined. Any suggestion?

Put your *scene_list first, before your *create list. Oh, and make sure to indent all the scene names below it (otherwise CS would take the text as normal passage instead of part of the code).

1 Like

What Szaal says plus. I’ve caught a lot of little things that’ll add up, so working through them as they pop up in my debug:

  1. Delete the *stat chart command at the top of your code (the official command is *stat_chart but this is for displaying stats, so you don’t want it here anyway)

  2. Get rid of the % at the end of every variable (the standard for most CS games is to use percentages for stats, but you don’t need to tell your code this–you’ll just use variables between 0-100)

  3. Your variables for Men, Women, NB, WomenA, MenA, NBA, and AA need to have values assigned to them-- a number, string (the quotation marks), or a boolean value (that’s the true/false). Going off the text later on, you want them to be true/false, so you’ll set them to:

*create Men false
*create Women false
*create NB false
*create MenA false
*create WomenA false
*create NBA false
*create AA false
  1. Also on your choicescript_stats page, make sure to indent everything one level in from *stat_chart and the line below each opposed_pair is one level in from that:
*stat_chart
    text sname Name
    percent Smarts
    percent Strength
    percent Agility
    percent Leadership
    opposed_pair Shyness
        Boldness

    opposed_pair Suaveness
        Obliviousness

    opposed_pair Sarcasm
        Genuine

    opposed_pair Wholesome
        Edgy

    opposed_pair Bravery
        Fear
4 Likes

The others covered most of what you need, but I also noticed a few places where the *page_break command (and others) appears with a space, instead of an underscore. Also, you don’t need to use both *finish and *ending. They have different functions. Finish goes to the next scene in the *scene_list. Ending is for ending the whole game.

This page gives a concise look at what the very top of your startup.txt file should look like.

1 Like

Okay, I tried all that you said, and here’s all my new code. Unfortunately, it still keeps giving me the same error of Scene is not defined.`

*title The Strongest weakling

*scene_list

	startup
	char_creation


*create Smarts 0
*create Strength 0
*create Agility 0
*create Leadership 0
*create Men false
*create Women false
*create NB false
*create MenA false
*create WomenA false
*create NBA false
*create AA false

*create Shyness 0
*create Boldness 0
*create Suaveness 0
*create Obliviousness 0
*create Sarcasm 0
*create Genuine 0
*create Wholesome 0
*create Edgy 0
*create Bravery 0
*create Fear 0

This is it. I'm finally here. The London University for Superheroes. I'd never thought I'd 
actually get here. Now, I'm not.....completely....here yet. We're still at the entrance exam.
The written and vocal exam was done before this. All around me are unfamiliar faces, one which 
breathes fire, another that could chomp through metal.....yeah. 


90% of the whole planet has safety nets like these, that the common person would call Powers.
Unfortunately for  me, I'm......sorta in the 10%.

*page_break  Oh, right, me.

I looked right next to me, and saw....

*choice
	#A decent-looking guy.
		*set Men true
	#An okayish-looking gal.
		*set Women true
	#A good-enough looking person.
		*set NB true
*page_break

Hey, I may not be the most attractive, but it counts for something, y'know. The name's

(first name)

*input_text name

*page_break

(surname)

*input_text sname

*finish And what I look like..... 

*goto char_creation
Starting with my skin, it's

*fake_choice 
	#olive.
	#brown.
	#tan.
	#fair.
	#pale.
*page_break

*finish
*stat_chart

	text name sname
	percent Smarts
	percent Strength
	percent Agility
	percent Leadership
	opposed_pair Shyness
		Boldness

	opposed_pair Suaveness
		Obliviousness

	opposed_pair Sarcasm
		Genuine

	opposed_pair Wholesome
		Edgy

	opposed_pair Bravery
		Fear

You say you’re “opening the index folder”. That means you’re trying to run index.html through the browser, right? Have you tried running quicktest? Quicktest usually shows you exactly what line of the code it failed on. This file should also appear in the same folder as your index file. I usually run quicktest through CSIDE, so I’m not up-to-date on its procedures.

Just to check one thing:

Try not having anything that’s not either the scene_list or a *create in your startup file.

Move the actual text and choices into it’s own chapter if that’s not already the case.

Also, make sure that the actual stat_chart code is in the choicescript_stats.txt file.

1 Like

I tried the top snippet of your code and it’s working fine, here. What is the full error report says? Is there any line number indicator? Do you mind taking a snapshot of the error happening?

Imgur
Here’s my error with using the index file.
Imgur
Here’s the error with the quicktest file.

Hmm. I’ve got the feeling that you’re using an outdated version of CS. Grab the latest version from the CoG blog post here or directly from github. Latest version written as 4600ebf, which doesn’t match with your 17e2741.

1 Like

Just note:
There is a small bug with the new version that prevents randomtest from showing the full text. So don’t worry if no text shows there

Or has that been hotfixed?

It worked! Thanks, man, woman, or whatever else! As it turns out, I also needed to run the ‘compile’ file, too.

There’s no need to run compile.html unless you’re planning to compile/export your game somewhere. Oh, and it’s man, boy, rambunctious brat, or whatever preference you want to call me :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.