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
              { <room> | 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.

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.>
}

- see also place and out

northeast

see north

northwest

see north

out <[ prefix; ] room> [ script ]

Specifies what happens when the player types "exit" or "out". As for place, if some script is specified here, the player will not go to the specified room automatically. If a prefix is specified, that is printed in the "You can go out to ..." line in the room description.

Examples:

out <the; street>

out <the; corridor> {
	if ( %strength% < 20 ) then msg <You are too feeble to try to force your way past the guard.>
	else goto <corridor> }

The first example adds the line "You can go out to the street" to the room description, and when the player types OUT or clicks the "out" button, they go to the room with the name "street" - the word "the" is the prefix for the description.

The second example executes some script which lets the player go out to the room "corridor" only if they have sufficient strength.

- see also north and place

place <[ prefix; ] place name> [ script ]

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

An optional prefix can be specified, followed by a semi-colon. For example, an accessible place could be called "supermarket", but this would display the rather unlovely "You can go to supermarket" in the room description - by using "place <the; supermarket>", "You can go to the supermarket" would be displayed, which looks nicer. The player is able to type either "GO TO SUPERMARKET" or "GO TO THE SUPERMARKET" to access this place in any case. Other prefixes you might want to use could be "the local", "your", etc. These make the text displayed to the player much more natural and readable.

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 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. Use the goto command to move the player if necessary. You can use this facility to implement things such as locked doors.

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 <the; 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.

- see also north and out

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

use <object> script

Executes the specified script when the object specified is used in this room. The player must have the object for the script to be executed.

 

< Back