I am a novice Quest adventure editor. I did extensive editing to my game, saved, then quit Quest last night. I come back to this message when I attempt to Edit:
Failed to load game due to the following errors:
Error: Unrecognised tag 'displayverbs' outside object definition
I just work with what the program gives me. I did not make any edits in code-view during last night's session. When I attempt to Play the game, I get this error (not exactly what I see in error message, but what it outputs when I use the "Copy error details to clipboard" button):
System.ArgumentNullException: Value cannot be null.
Parameter name: value
at Microsoft.Win32.RegistryKey.SetValue(String name, Object value, RegistryValueKind valueKind)
at Microsoft.Win32.RegistryKey.SetValue(String name, Object value)
at GameBrowser.RecentItems.SaveRecentList()
at GameBrowser.RecentItems.AddToRecent(String filename, String name)
at TextAdventures.Quest.Main.ctlPlayer_AddToRecent(String filename, String name)
at TextAdventures.Quest.Player.AddToRecentList()
at TextAdventures.Quest.Player.SetGameName(String name)
at TextAdventures.Quest.Player._Closure$__179-0._Lambda$__0()
I can open the file in a separate text editor. What should I be looking for to troubleshoot this problem? Why won't this open in the editor for me to fix this problem?
From the error, I'd quess that there is a bit that looks like:
<displayverbs type="stringlist">
<value>Look at</value>
<value>Take</value>
</displayverbs>
that isn't between a <object
and the corresponding </object>
.
If you can open it in a text editor, I'd suggest searching for <displayverbs
and see if you can find one that doesn't come between <object
and </object>
. Either delete the displayverbs block, or move it into an object.
I'm not sure how that can happen in the editor, but Quest is more than a little flaky when it comes to loading files that aren't structured exactly as it expects.
Thank you, mrangel! That helped me identify the problem.
I had to resort to deleting them one-by-one through trial and error because I was having difficulty determining what was different about the 'displayverb' occurrences, starting with my most recent objects. I isolated it to an ingame object (the deletion of which let me open the editor just fine) but I wanted to understand what the problem was so I started deleting individual codes of lines. Oddly, the 'displayverbs' code on this object looked fine, but by removing the 'displayverbs' code, I changed my error message:
Object reference not set to an instance of an object
I looked at other lines which might be causing this issue in this particular object. After a little more trial and error, here was the problematic code:
<game type="int">0</game>
The object in question is a video game console, so I set an attribute called "game" to an integer output that would go up every time the player Used it. In practice, each integer value would correspond to a new scene to play out. What I didn't realize was that I changed the nature of the gaming console with this attribute. In fact, I didn't even end up using this mechanic, so I forgot about it after finishing my round of edits last night. This was all done entirely through the editor. Oops!
nice find of the cause of the error!
as now know, be careful of using the built-in/reserved/special words, as you know well that it causes problems/issues (over-riding/over-writing the built-in functionality and/or confusing the quest parser/compiler/translator/etc), lol
as 'game' is used as a special/reserved/built-in for a special and required Object, the 'game' Game-Wide Settings/Controls And Publishing Info Object):
http://docs.textadventures.co.uk/quest/asl_requirements.html
http://docs.textadventures.co.uk/quest/aslx.html
http://docs.textadventures.co.uk/quest/elements/game.html
<game name="NAME_OF_YOUR_GAME">
<attr name="gameid" type="string">RANDOMLY_GENERATED_HASH_STRING_FOR_ONLINE_QUEST_WEBSERVER</attr>
<attr name="version" type="string">YOUR_VERSION_HISTORY_DOUBLE_(DECIMAL/FLOAT/FLOATING_POINT)_NUMBER</attr>
<attr name="description" type="string">THIS_IS_SEEN_ON_THE_WEBSERVER_FOR_PEOPLE_TO_LOOK_AT_ABOUT_YOUR_GAME_IN_DECIDING_WHETHER_TO_PLAY_YOUR_GAME_OR_NOT</attr>
<attr name="category" type="string">CATEGORY_OF_YOUR_GAME_AND_SEEN_ON_WEBSERVER</attr>
<attr name="author" type="string">YOU</attr>
<!-- ETC Attributes -->
</game>
Just to clarify as I don’t understand code all that well...
Could the problem have been the attribute named “game”? I know there are certain names you want to avoid using because it interferes with Quest’s language.
Just curious...
Yes! I am new to the software, so it was a big oversight to use "game" as the name of my attribute. In my case, Quest did as Quest does and read the attribute as I wrote it. In the end, I didn't understand clearly what I wrote, leading to this problem. Be careful with your code, inside or outside code-view!
Lesson learned, right? I never name anything too simply. I almost always throw a number or some yoda-like phrase that there is no way in heck Quest will read and interpret in some codey fashion!
I’ve done that MANY times. 😮
This is why Quest should save those names as <attr name="game" type="int">
; so that when loading it, it knows it's supposed to be an attribute. Because when it sees <game>
, it doesn't know if it's an attribute named game
, or an actual game object. Other names that could cause a similar problem include script
, object
, exit
, template
, attr
, and function
.
I vaguely recall suggesting some edits to the Quest core a while back that could solve this problem; but not sure if those changes will be incorporated.