Noob in Peril


#1

Hi, first time scripter with no applicable knowledge to put to this. I managed to get a very simple idea of how mygame.js works, and now it has elected to decide otherwise. Could someone maybe help me spot something I’ve missed? I’d appreciate any help. I think I must have misplaced a comma or something but I’ve been looking at it for hours with no joy.

// Specify the list of scenes here, separated by commas, with no final comma

nav = new SceneNavigator([
“startup”
,“newgame”
,“firstyear”
,“gosub”
,“ending”
,“death”

]);

// Specify the default starting stats here

stats = {

name: "unknown"
,gender: "unknown"
,hair_colour: "unknown"
,eye_colour: "unknown"
,body_type: "unknown"
,age: "unknown"
,intelligence: 10
,charisma: 10
,strength: 10
health: 10

};

// Specify the stats to use in debug mode

debugstats = {

name: "unknown"
,gender: "unknown"
,hair_colour: "unknown"
,eye_colour: "unknown"
,body_type: "unknown"
,age: "unknown"
,intelligence: 10
,charisma: 10
,strength: 10
health: 10

};

// or just use defaults
// debugStats = stats


#2

You are missing a comma at the health variable.


#3

You also can’t have a scene called gosub. It is a reserved word.


#4

The clue is usually in the first error message (with IE, anyway) - “Expected }” or something similar. Definitely use IE for testing though. ChoiceScript is the only thing I use it for, but you can’t get very far without it (or at least, it’s much easier to find bugs with it).


#5

Thanks guys, got the problem in the end. Turns out I had left something in choicescript_stats that wasn’t carried over to mygame.js (Not that the other problems weren’t crippling my intentions, thanks for the help). Frankly at this stage those are just test variables that’ll be replaced once some actual plot has been laid down.

Once again, I profusely prostrate myself before ye Paragons of Programming.