My Game Won't Load!

The Pixie
This is a set of suggestions for what to do if your game will not load in Quest. This is specifically for the off-line editor, for when you try to open your game file and Quest fails, or when you go from Code view back to the GUI. If your game is displayed in the GUI, but will not play, that is a whole different issue that is not addressed here.

As a general rule do not use the Code view from the menu and do not edit your game file with a text editor! Just use the Code view for individual scripts.

That said, if you are creating or modifying a library file, then you have to use a text editor. And if your game will not load at all, you also need to use a text editor. Notepad, the built-in Windows text editor is suitable, but if you do this a lot, Notepad++ is far superior.

To test if this is an issue with a specific library, create a new game, add the suspect library and see if the game will load. If it fails to load, you know the library is the culprit. If you have not edited any library files or have checked all the ones you have modified are not to blame, it is your main game file.

So we now know which file is the problem.

Invalid XML

If the game does not load into the GUI, and you are getting an error that mentions "Invalid XML" it is probably a problem with the XML formatting. Does it give a line number in the error? Open the file in a text editor, go to the line number, and see what looks bad. You could also try changing the file extension of the game file from .aslx to .xml, then opening it in Internet Explorer, and see if that can locate the error. Remember to change it back afterwards.

XML consists of elements, where each element has a start tag, an end tag and some context. This is the basic format:
<elementname>Some content</elementname>

Here is an actual example:
    <object name="lute">
<inherit name="editor_object" />
<inherit name="merchandise" />
<alias>Lute</alias>
<look>When you planned to get a shed load of loot, this was not what you had in mind.</look>
<price type="int">72</price>
<alt type="stringlist">
<value>guitar</value>
<value>banjo</value>
</alt>
</object>

In Quest, they often have a type attribute, telling Quest what sort of thing they are (as in the 6th and 7th lines above), or a name attribute (as in lines 1, 2 and 3). Some elements have no content, and just have a start tag that ends with a slash (as in lines 2 and 3). Lists have more elements nested inside them (lines 7 to 10).

Elements nest (fit wholly within the one above), and must not overlap. That means the "look" element above has to be completely within the "object" element. Quest will fail to load if it cannot find the end tag of the look element before it meets the end tag of the object element. Is that the case in your game?

Something else that Quest can stumble over is a less than symbol. In this line, Quest will see the < symbol as the beginning of an XML tag and get confused.
<open type="script">if (this.pressure < 45) { msg("Do stuff") }</open>

To get around this you need to wrap it as CDATA (and Quest will do this for you if you work in the GUI):
<open type="script"><![CDATA[if (this.pressure < 45) { msg("Do stuff") }]]></open>


Other Errors

If it is not Invalid XML, you will need to read the error message carefully to see what Quest has found or what it has failed to find, and to determine what object (and possibly what attribute) it failed for. Both of these will be given in single quotes, which may make them easier to spot. Search your code for the object (in code view, do [CTRL-F] to open the search). Put the object name in double quotes, as that is how it appears in the XML element (otherwise you will also find every time it gets a mention in a string or script).

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

Support

Forums