Error Messages

I tried testing my CoG file, but when I went to the web page (Multiple Choice Example Game. Not sure how to change the name yet, but I will handle that later), a message popped up reading “Invalid Character”. I closed that, but another one came up: Unable to get value of the property ‘setStartingStatsClone’: object is unknown or undefined. I havn’t changed anything except the JS mygame file. And then only slightly. Please help!

Here is my current JS file:
// Specify the list of scenes here, separated by commas, with no final comma

nav = new SceneNavigator([
“startup”
,“animal”
,“variables”
,“gosub”
,“ending”
,“death”

]);

// Specify the default starting stats here

stats = {
smarts: 50
,strength: 50
,politics: 50
,business: 50
};

// Specify the stats to use in debug mode

debugStats = {
leadership: 50
,strength: 50
};

// or just use defaults
// debugStats = stats

What have you changed?

First, rewrite the debugStats section to:
debugStats = stats

You should delete:
debugStats = {
leadership: 50
Strength: 50
};

Also run your game in Internet Explorer if you can - it gives better error messages including the line number for the error.

Well, it worked for a few seconds, but when I clicked on “Stats”, it said something about “leadership non-existent”. When I refreshed the web page, the same “error” messages appeared. Here is the JS file I am using:
// Specify the list of scenes here, separated by commas, with no final comma

nav = new SceneNavigator([
“startup”
,“animal”
,“variables”
,“gosub”
,“ending”
,“death”

]);

// Specify the default starting stats here

stats = {
smarts: 50
,strength: 50
,politics: 50
,business: 50
};

// Specify the stats to use in debug mode

// or just use defaults
// debugStats = stats

If you are using leadership in your game, you should add it to the list of stats. If you don’t want to use it, you need to delete it from the scene file where it’s listed.

Also I guess I wasn’t clear about the debug stats fully - delete the // before debugStats = stats

Hmm. I deleted all the mentions of “leadership” (i.e. temp create), and deleted the // before debugStats=stats, but nothing changed. (BTW, thanks for all the help so far. It might just be my computer).

Okay, best thing to do is post your code here. Also, when you get the error message, note the line number mentioned. You should be able to tell which file it’s in from where the error occurs.

It didn’t mention a number, but here is the JS code:

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

nav = new SceneNavigator([
“startup”
,“animal”
,“variables”
,“gosub”
,“ending”
,“death”

]);

// Specify the default starting stats here

stats = {
smarts: 50
,strength: 50
,politics: 50
,business: 50
};

// Specify the stats to use in debug mode

// or just use defaults
debugStats = stats

Here is the file marked “choicescript_stats” (After deleting the “leadership”)
This is a stats screen!

*stat_chart
The only other changes I made was to the “variables” file, where there is nothing but the “*comment” messages.

Okay, choicescript works by calling up text files (.txt) in a specific order. These are indexed in the .js file and are the first thing listed.
Every time you mention a permanent variable (temp variables work differently) in a .txt file you have to also mention it and give it a value in the .js file.

At the moment, your .txt files in use are:
startup.txt
animal.txt
variables.txt
gosub.txt
ending.txt
death.txt

Without checking, I’m pretty sure these are the demo files included when you download choicescript. If you don’t need them, I suggest you delete them from your .js file. If you do need them, check each one (open each text file) and see what variables are included. For example, if gosub.txt references the leadership variable and you want to use it, you will need to add it to the .js list of variables again. If gosub.txt is just a demo file that you don’t need in your game then delete the line ,“gosub” from your .js file.

I hope that makes sense and helps you sort it out. Let me know how you get on.

You’re instructions were clear, but it didn’t work with me. I’m going to start from scratch (I was just trying to see if the program would work, so I didn’t actually write anything). But I tried this program before and the same errors happened, so I will try your instructions again if it has the same errors.