Superawesome sent me his code.
First, you should never change _functions.js. I update that frequently and you want to be able to copy the updated one into your game. You should put your functions in _game.js. That's where game-specific stuff goes.
Speaking of which, you've got an old version of _functions.js which doesn't match the version of AC you're using. I'll bet I forgot to update the _functions.js in the tutorials when I last updated it. First copy your function into _game.js, then replace the _functions.js with the one in example rather than tutorial.
Now, to teach you how to fish. Open Internet Explorer (not Firefox or Chrome) and drag _begin.htm into it. Nothing is working, so hit F12. This brings up the debugger that's built in to IE. In the debugger click on the "Script" tab.
On the right side it says: Refresh the page to see messages that may have occurred before the F12 tools were opened.
Refresh the browser and now you'll see something like:
SCRIPT1004: Expected ';'
_game.js, line 31 character 23
SCRIPT5009: 'gameVars' is undefined
_functions.js, line 984 character 9
I copied the function into _game.js, and line 31 is in it.
- Code: Select all
function checkLibCompliment()
{
var libCompliment == readVar("libCompliment");
if (libCompliment = 1)
{
window.location = "lib9e.html";
}
else
{
window.location = "lib9f.html";
}
}
Line 31 is this one.
- Code: Select all
var libCompliment == readVar("libCompliment");
That is supposed to be = not ==. Remember, one equals to set, two to check. Speaking of which, the next line needs two.
- Code: Select all
if (libCompliment = 1)
You need to change these two lines to:
- Code: Select all
var libCompliment = readVar("libCompliment");
if (libCompliment == 1)
The other error is harder to figure out, but in the end, it's because of this line.
- Code: Select all
var gameVars = ["cssSize", "happy", "test", "confidence", "april", "libCompliment = 0"];
You can't have the = 0 in there. Your last variable isn't "libCompliment" it's "libCompliment = 0". Make the line:
- Code: Select all
var gameVars = ["cssSize", "happy", "test", "confidence", "april", "libCompliment"];
Okay, go do those things while I look over the rest of this.
Tlaero