Room Definition Blocks

A room definition block defines a room. This may contain one or more object definition blocks within it.

A room definition block starts with the line:

define room <room name>

and ends with the line:

end define

A room definition block may contain the following lines:

action <action name> script

Sets up the action specified. Many of these tags may exist within one room definition block. See the object action tag for more details.

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

alias <name>

Defines an alternative name for a room. Use this for place names like "the street" which may appear more than once in a game. Give each place a unique name like "street1" but with an alias of "the street".

afterturn [ override ] script

Executes the specified script every turn that the player is in this room, after what the player typed has been evaluated. If override is specified, any afterturn script in the game definition block will not be executed.

- see also beforeturn

beforeturn [ override ] script

Executes the specified script right after the player types in a command – in this room; before it is evaluated (i.e. as soon as the player hits the Enter key). If override is specified, any beforeturn script in the game definition block will not be executed. 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> script

Executes the specified script when the user-defined command is typed in while the player is in this room. 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.

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

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

description { script | <description text> }

As for "description" in the "define game" block, this overrides Quest's own room description printing with code or a message you specify. This will apply to the particular room rather than the entire game, however.

As an alternative to automatic room descriptions, you can adopt a more "classical" adventure game style by using the "description" tag in place of a "look" tag in your rooms. If you do this, the only text a player will see when they enter the room will be the description you specify, rather than a full list of all objects in the room and available directions.

For example:

description do <autodescription-procedure>

or

description <You are standing in a freezing alleyway. You can hear a voice in the _
	distance behind you. You can travel north or south.>

- see also How to Customise Room Descriptions, indescription, look

down

see north

east

see north

indescription <text to put in description>

The default "You are in ..." for room descriptions is over-ridden when this tag appears in a room definition. For example, "indescription <You are standing on:>" in a "define room <platform>" will make Quest display "You are standing on a platform" in the room description (if the room has a prefix of "a"). The colon (":") makes Quest return the room name; if you do not include the colon, the room name is not printed (the above would display "You are standing on" on its own). For example, in a room called "top of tower block", you might use:

indescription <You are looking down on the busy road several hundred feet below.>

look <room description>

Enter this room's description in this line. E.g.:

look <A very big, impressive concert hall, full of people.>

- see also description

north
south
east
west
northeast
northwest
southeast
southwest
up
down
out
              [ locked ] { <room [; lock message] > | script }

These specify what happens when the player travels in a given direction - they will either go to a specified room, or some specified script will execute - if script is specified, the player will not automatically be moved anywhere.

You can make an exit initially locked by specifying locked. You can specify an optional message to print when the player tries to go in that direction by entering it in the parameter (after the destination room name if this is not a script exit). You can lock and unlock exits during the game using the lock and unlock script commands.

Examples:

north <garage>

west {
	if got <key> then {
		msg <You unlock the door and step into the hallway.>
		goto <hallway> }
	else msg <The door is locked.>
}

east locked <bakery>

south locked <supermarket; The Supermarket is shut.>

down locked <You can't go downstairs until you find your shoes.> do <someproc>

- see also place

northeast

see north

northwest

see north

place [ locked ] <place name [ ; lock message ]> [ script ]

Specifies a possible place that the player can go to from this room, by typing "GO TO ...".

If a script is not specified, the destination room must exist, and the player will automatically go to that room when they use this exit. Quest will use the destination room's alias name and prefix if it exists.

If a script is specified, the player will not automatically go to the place specified, and indeed, the room name referred to doesn't have to exist at all.

You can use the fact that a room doesn't have to exist if you use a script to make a custom name for an exit. If the room you want to exit to is called room004, with an alias of torture chamber, but you want the exit to appear as an exit to the kitchen, then:

place <room004>

will display "You can go to the torture chamber". Not very good for a trap! Even though no kitchen room exists, you can use:

place <the kitchen> goto <room004>

This will display "You can go to the kitchen", and the player can type GO TO KITCHEN, but they will end up in the torture chamber instead.

You can use the locked parameter and specify a lock message in the same way as you can for directional exits.

- see also north

prefix <prefix>

Defines the prefix for this room, e.g. "the". This prefix is used in the room description and is printed before the name of the room.

properties <property or property list>

Sets properties for this room. You can specify multiple properties separated by semicolons. See the object properties tag for more details.

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

south

see north

southeast

see north

southwest

see north

script script

Executes the specified script when the person enters the room. Could be used for a nasty trap, for example, or to play a sound or to show a picture.

type <type name>

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

- see also properties, action

up

see north

west

see north

 

< Back