Game Setup

All ASL files must have one, and only one, game definition block. The first line of the game definition block must be:

define game <game name>

where the name of the game must be entered between the < and the >, e.g.:

define game <Billy's Quest for the Holy Egg>

An example of a full game definition block might be:

define game <Thumper Mission>
	asl-version <400>
	gametype singleplayer
	start <field>
	command <eat cabbage> do <eat-procedure>
	game version <1.0>
	game author <Peter Rabbit>
	game copyright <� 2007 Peter Rabbit Enterprises>

	define variable <cabbages>
		value <5>
		display <You have ! cabbages>
	end define
end define

The following lines may appear in a game definition block:

action <action name> script

Sets up the action specified. Many of these tags may exist within one game definition block. See the object action tag for more details. For the purposes of executing these actions, use the object name "game".

- see also action and doaction script commands, type tag, type definition blocks

afterturn script

Executes the specified script every turn, after what the player typed has been evaluated.

- see also beforeturn

asl-version <version number>

ASL version number. If this number is higher than the ASL version number that the current version of Quest knows it can cope with, a warning message will be shown (and will be output to the file specified in Quest's Options window, under "Log ASL script messages to a file:"). The game will still load and run, however.
- usually asl-version <400>

background <colour>

Specifies the background colour. Valid values for the colour are white, black, red, green, yellow, blue. You can also specify hexadecimal RRGGBB values from 00 to FF. For example, FF0000 is equivalent to red. Players may override this by forcing a game to use Windows default colours, so don't rely on this tag always working.

- see also foreground tag, foreground, background script commands, Text Formatting

beforesave script

Executes the specified script immediately before the player saves the game to a QSG file.

- see also onload

beforeturn script

Executes the specified script right after the player types in a command – before it is evaluated (i.e. as soon as the player hits the Enter key). If the script here runs a dontprocess command, the command that the user typed in will not be processed.

- see also afterturn

command <command string [; command string ... ] > script

Executes the specified script when the user-defined command is typed in during the game. Multiple commands can be catered for with the same script by separating them with semi-colons. See How to Add Your Own Commands to a Game for complete information.

e.g.:

command <read #object#> exec <look at #object#>

- see How to Add Your Own Commands to a Game for full information

default fontname <name of font>

Sets the default font used in the game. This overrides any default font name specified by the player in Quest's options window, though the player can in turn override your attempts to set the default font by selecting the option to override game-set default fonts.

- see also default fontsize, font script command, Text Formatting

default fontsize <font size>

As above for "default fontname", but sets the default font size.

- see also default fontname, font script command, Text Formatting

description { script | <description text> }

Overrides Quest's room descriptions by executing the script you specify here, or writing the text you specify here, rather than print Quest's default room description.

- see also How to Customise Room Descriptions

error <error name; error message string>

Overrides Quest's built-in messages. Some of them are not actually error messages, but default messages for things that frequently happen.

This table shows the valid "error name" strings, and the circumstances in which that message is printed:

Error name Printed when...
alreadyclosed the player tries to close an object which is already closed
alreadyopen the player tries to open an object which is already open
alreadyput the player tries to put an object where it already is
alreadytaken the player tries to take an object which is already in the inventory
badcommand the player types an invalid command
badexamine the player uses "examine" in an unrecognized way
badgo the player uses "go" in an unrecognized way
badgive the player uses "give" and does not specify an object to give to
badplace the player tries to go to a non-existent room using "go to ...".
badpronoun the player uses a pronoun ("IT" etc.) when that pronoun doesn't refer to anything
(the pronoun used is returned in #quest.error.pronoun#)
badput the player uses "put" but does not specify where to put the object
badtake the player tries to take an object which can't be picked up
badthing the player tries to do something to an object that does not exist
baduse the player uses "use" in an unrecognized way
cantdrop the player tries to drop an object that can't be dropped
cantclose the player tries to close an object which can't be closed
cantopen the player tries to open an object which can't be opened
cantput the player tries to put an object somewhere it can't be put
cantremove the player tries to remove an object which can't be removed
defaultclose the player successfully closes an object
defaultdrop the player successfully drops an object
(the article (e.g. "it", "them") is returned in #quest.error.article#)
defaultexamine the player examines something for which there is no examine tag defined
defaultlook the player looks at something for which there is no "look" tag defined
defaultopen the player successfully opens an object
defaultout the player tries to use "out" to exit from a room which has no "out" tag
defaultput the player successfully puts an object in/on another one
defaultremove the player successfully removes an object
defaultspeak the player speaks to an object for whom there is no "speak" tag defined
defaulttake the player picks up an object successfully. e.g. "You pick it up."
defaultuse the player tries to use something on an object where no relevant "use" tag can be found
defaultwait the default text to print for the wait command
itemunwanted an object does not want an object being given to it (i.e., no relevant "give" tag can be found)
locked the player tries to use an exit which is locked
noitem the player tries to use an object they don't have

For example:

	error <noitem; You don't appear to have that, you silly person!>
	error <defaultdrop; You have successfully dropped #quest.error.article#.>

foreground <colour>

Specifies the foreground colour. Valid values for the colour are white, black, red, green, yellow, blue. You can also specify hexadecimal RRGGBB values from 00 to FF. For example, FF0000 is equivalent to red. Players may override this by forcing a game to use Windows default colours, so don't rely on this tag always working.

- see also background tag, foreground, background script commands, Text Formatting

game { author | copyright | version | info } <string>

Provides a space for you to give information about the game - who wrote it, copyright details, version number and other information. These can be called up by the player by using the ABOUT command on the main window, or by selecting the "Help|About This Game" menu.

onload script

Executes the specified script immediately after the player loads a game from a QSG file.

- see also beforesave

properties <property or property list>

Sets properties for this game. You can specify multiple properties separated by semicolons. See the object properties tag for more details. For the purposes of reading these properties, use the object name "game".

- see also type, type definition blocks, property script command

start <room>

Specifies the start room. e.g.:

start <Billy's House>

startscript script

All script specified here will be executed when the game starts, before the start room has been entered. You can use this section to play an intro sequence, for example. If the script you specify here contains a "nointro" line, the introductory text (as specified by "define text <intro>") will not be displayed. You may want to do this if, for example, you are displaying the introductory text manually (using "displaytext <intro>") at some point during the intro sequence.

Note that as of Quest 4.0, this script will only run once, when the game has launched for the first time. If you want to run a script when a player loads a game from a save-game (QSG) file, use onload.

type <type name>

Includes the properties and actions in the specified type definition block.

- see also properties, action

verb <verb [; verb ...] [: property/action name]> script

Verbs provide an easy way to set up commands like an "eat" command. A simple example is this:

verb <eat> msg <You can't eat that!>

This adds an "eat" command to the game. When they player types "EAT THING", Quest first checks to see if the thing referred to exists. If not, an error message is printed. If it does exist, Quest will check to see if the object has an "eat" action or property, and if so will execute the action or print the property. If the object does not have an "eat" action or property, the verb script is run - in this case, it tells the player that they can't eat that object.

You can specify multiple verbs on the same line if they correspond to the same thing. If multiple verbs are specified, Quest will look for an action or property with the name of the first verb on the line. So, if the list is "eat; consume; scoff" then Quest will check for the existence of an "eat" property or action whether the player typed "EAT THING", "CONSUME THING" or "SCOFF THING".

If you want to use a different property or action name, specify it at the end of the line after a colon. The following examples set up verbs which both refer to an "eatproc" property or action:

verb <eat: eatproc> ...
verb <eat; consume; scoff: eatproc> ...

 

< Back