Choicescript errors


#1

When I open index.html in IE, it gives me the errors " ‘first_name’ is undefined" and " ‘stats’ is undefined", but when I looked in the mygame.js file, I couldn’t find what I did wrong.
Here it is:


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

nav = new SceneNavigator([
	"intro"
]);

// Specify the default starting stats here

stats = {
	first_name: "Unknown"
	,last_name: "Unknown"
	,full_name: (first_name&" ")&last_name
	,gender: "Unknown"
	,title: "None"
	,greeting: "None"
	,strength: 0
	,wisdom: 0
	,magic: 50
	,physical: 50
};

// Specify the stats to use in debug mode

debugStats = stats;

// or just use defaults
// debugStats = stats

I’ve checked my indenting and all of them are one-tab indents, and the “stats = { };” part is the same as the original mygame.js, which does work. What did I do wrong?


#2

@avierre

,full_name: (first_name&" ")&last_name

It’s falling foul of that line, so resulting in ‘stats’ as a whole being undefined.

In mygame.js set full_name to a default of “Unknown” as well and use the concatenation in your actual story scripting (i.e. *set full_name accordingly immediately after the player has chosen first_name and last_name).


#3

It worked, thanks!