Built-in String Variables

Quest has several built-in strings which can be accessed in the same way as normal strings. These strings are listed below.

quest.command

Returns the command that the player typed in, after synonyms have been processed. Use quest.originalcommand to access the original form of the command. For example, if "read" is specified as a synonym of "examine", and quest.originalcommand contains "read the book", then quest.command will contain "examine the book".

quest.currentroom

Returns a string containing the "real" name (i.e. proper code name) of the current room. quest.formatroom returns the displayed version of the room name.

quest.doorways

Returns a formatted list of exits that can be used, eg. "north, west".

quest.formatobjects

Returns a text-formatted list of objects in the current room.

quest.formatroom

Similar to quest.currentroom, but returns the displayed name of the room - so if an alias has been used, this will return the alias, and if a prefix has been used, a prefix is included.

quest.lastobject

Returns the (real) name of the last object that the player referred to in a command.

quest.lookdesc

Returns the current room's description as specified by its look tag.

quest.objects

Returns a list of objects in the current room.

quest.originalcommand

Returns the command the user just typed (converted to lower case). quest.command returns the command after processing for synonyms.

 

For example:

if ( #quest.currentroom# = library) then msg <You are in the library>

will print "You are in the library", if you’re in the library.

The string variables above are especially useful when customising room descriptions - they give access to information such as the doorways present, things in the room, etc. which can be printed on the screen. See How to Customise Room Descriptions for more information.

 

< Back