game.js. Logcat & JSLint failure reports

PaulR
Some errors in the generated game.js file in the quest to html5 compiler beta.

The resulting view is just a text box - no intro, no pics. Whatever is typed into the textbox is printed out. No commands - North, N, etc work.

Eclipse Logcat:

09-02 11:00:20.767: D/CordovaLog(4703): file:///android_asset/www/game.js: Line 0 : Uncaught RangeError: Maximum call stack size exceeded
09-02 11:00:20.772: E/Web Console(4703): Uncaught RangeError: Maximum call stack size exceeded at file:///android_asset/www/game.js:0
09-02 11:00:20.772: D/Cordova(4703): onPageFinished(file:///android_asset/www/index.html)
09-02 11:00:20.772: D/CordovaActivity(4703): onMessage(onPageFinished,file:///android_asset/www/index.html)
09-02 11:00:22.777: D/CordovaActivity(4703): onMessage(spinner,stop)
09-02 11:00:31.012: D/SoftKeyboardDetect(4703): Ignore this event
09-02 11:00:31.352: D/SoftKeyboardDetect(4703): Ignore this event
09-02 11:00:38.917: D/SoftKeyboardDetect(4703): Ignore this event
09-02 11:00:38.932: D/CordovaLog(4703): file:///android_asset/www/game.js: Line 1 : Uncaught TypeError: Cannot read property 'commandmetadata' of undefined
09-02 11:00:38.932: E/Web Console(4703): Uncaught TypeError: Cannot read property 'commandmetadata' of undefined at file:///android_asset/www/game.js:1

The first error is on load, the second error is when text has been entered into the text box.

I've made no changes to the game.js

JSLint:

line 1 character 37
Weird condition.

line 1 character 39
Expected ';' and instead saw ','.

changing those sends jslint into error meltdown.

game.js: https://dl.dropboxusercontent.com/u/56760890/game.js
---------------------------------
WinXP sp3
---------------------
Eclipse Juno SDK
Version: 4.2.2
Build id: M20130204-1200
---------------------
Latest Cordova.jar and js (jar is 2.9.0)

Alex
Can you attach the source game, and does it work when viewed in a normal web browser?

PaulR
Hi Alex, it's the same result in a web-browser.

The quest file runs fine.

Not sure what you need, so here's the lot.

generated html:
https://dl.dropboxusercontent.com/u/56760890/HTML.rar

quest file:
https://dl.dropboxusercontent.com/u/567 ... ames.quest

aslx file attached

There's no game, just some 'stuff' lol!

PaulR
would the space in 'quest game' throw the compiler out?

**edit**

just tried with no space, made no difference.

Right at the end of the compiler process is this message:

Variable 'open' clashes with object name
Variable 'close' clashes with object name

Don't know if that's in any way relevant?..

Alex
If you turn off the Minify option, you'll get more helpful line numbers in error messages. I can see in this case the error is when the SetBackgroundImage function is called - it immediately calls itself which is why the stack overflows.

I expect this is happening because the Core .aslx files contain a function of this name, which then tries to call a JS function of the same name. I have a feeling I put some workaround code in the compiler for this situation, but probably didn't include these functions as they didn't exist at the time.

You might be able to fix this by not using a background image, or by manually editing the non-minified game.js file. Or I am of course happy to take pull requests :)

PaulR
Removing the background image sort of gets it working.

Are there any known limitations to the compiler with regard to directions, images etc?

For example, I get this output in the html:

You can see a {object:TV1}.
You can go {exit:k3}.

Also, when an item is added to inventory only the built in verbs are shown on the item. Custom verbs aren't there.

Is there an eta for quest6? lol!

Alex
Looks like it's not using the correct function for the text processor. That should work correctly, presuming the game is built and compiled with Quest 5.4.

If you could open an issue and attach the relevant files to it, I'll take a look.

PaulR
Thanks Alex,

I've opened an issue and attached the files at:

https://quest.codeplex.com/workitem/1320

Sorry to be a pain. I've been looking at IF software for 6 months now and, for me, Quest is by far the most intuitive, easy to learn and well documented, If it'll compile to html error free I'll be so happy and never bother you again! :D That's probably a lie..

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums