ThePix / QuestJS

A major re-write of Quest that is written in JavaScript and will run in the browser.
MIT License
66 stars 12 forks source link

Q5 to QJS Convertor: Cannot Find Player Object #92

Closed Zanderkat closed 1 year ago

Zanderkat commented 1 year ago

After conversion, the following error occurs:

_io.js:5 ERROR: No player object found. This is probably due to an error in the data file where the player object is defined, but could be because you have not set one.

printError @ _io.js:5 errormsg @ _io.js:376 init @ _world.js:216 scriptOnLoad @ _settings.js:211 load (async)
scriptOnLoad @ _settings.js:221 load (async)
scriptOnLoad @ _settings.js:221 load (async)
scriptOnLoad @ _settings.js:221 load (async)
scriptOnLoad @ _settings.js:221 load (async)
scriptOnLoad @ _settings.js:221 load (async)
scriptOnLoad @ _settings.js:221 load (async)
scriptOnLoad @ _settings.js:221 load (async)
scriptOnLoad @ _settings.js:221 load (async)
scriptOnLoad @ _settings.js:221 load (async)
scriptOnLoad @ _settings.js:221 load (async)
scriptOnLoad @ _settings.js:221 load (async)
scriptOnLoad @ _settings.js:221 load (async)
scriptOnLoad @ _settings.js:221 load (async)
scriptOnLoad @ _settings.js:221 loadScript @ _settings.js:190 writeScript @ _settings.js:241 myScript.onload @ index.html:27 load (async)
(anonymous) @ index.html:26

Along with the following:

_io.js:12 Look through the trace below to find the offending code. The first entry in the list may be "errormsg" in the file "_io.js", which is me so can be ignored. The next will the code that detected the error and called the "errormsg" message. You may need to look further down to find the root cause, especially for a text process issue. _io.js:14 Error: error state caught by QuestJS runtime at errormsg (_io.js:376:17) at Object.init (_world.js:216:7) at HTMLScriptElement.scriptOnLoad (_settings.js:211:13)

I checked my data.js file and the player object is the first one created. I even replaced mine with the example from the wiki and the error still occurs.

ThePix commented 1 year ago

I would guess there is an error in the data file that stops any of it being run, and hence there is no player object. That said, none of the errors you report mention data.js. Kind of clutching at straws here, but is it possible there are more errors if you scroll up in the developer console?

Zanderkat commented 1 year ago

This issue actually resolves when I delete all other code from this file (except the player object), so you are right in that it's an issue with another bug in the data file.