Inform 7 Home Page / Documentation


§3.12. Doors

The map of an interactive fiction is the layout of rooms and the entrances and exits which connect them. So far, these map connections have always run from one room to another, like so:

The Painted Room is north of the Undertomb.

However, we can also interpose doors between rooms, like so:

The heavy iron grating is east of the Orchard and west of the Undertomb. The grating is a door.

The second sentence is needed since otherwise Inform will take "heavy iron grating" to be the name of a third room, whereas what we want is for the grating to be something physically present in both the Orchard and in the Undertomb, and acting as a conduit between them. To this end it needs to be a "door", a kind we have not so far seen. In the absence of any other instruction, a newly created door will be fixed in place, closed and openable.

The grating really does come in between the two rooms: the grating is what lies immediately east of the Orchard, not the Undertomb room. So if we wrote the following:

The Undertomb is east of the Orchard. The heavy iron grating is east of the Orchard and west of the Undertomb. The grating is a door.

then Inform would say that this is a contradiction: we said the Undertomb was east of the Orchard, but then we said that the grating was east of the Orchard.

Inform's "door" kind can be used for all manner of conduits, so the word door need not be taken literally. In Ursula K. Le Guin's beguiling novel "The Tombs of Atuan", from which the above rooms are stolen, it is not a grating which interposes, but:

The red rock stair is east of the Orchard and above the Undertomb. The stair is an open door. The stair is not openable.

In real life, most doors are two-sided, and can be used from either of the rooms which they join, but this is not always convenient for interactive fiction. Here is a one-sided door:

The blue door is a door. It is south of Notting Hill. Through it is the Flat Landing.

(Note the use of "it" here as an optional abbreviation.) This will make a door visible only on the Notting Hill side; no map connection will be made in the reverse direction, unless we ask for one.

So much for creating and describing individual doors. Once we need to write about doors in general, we are likely to want a way to find out where a given door sits in the map. The following phrases reveal this:

front side of (object) ... room

This phrase produces the first of the one or two rooms containing a door - first in the order given in the source text. Example: if

The red rock stair is east of the Orchard and above the Undertomb.

then "front side of the red rock stair" produces the Orchard. For a one-sided door, this produces the only room containing the door.

back side of (object) ... room

This phrase produces the last of the one or two rooms containing a door - last in the order given in the source text. Example: if

The red rock stair is east of the Orchard and above the Undertomb.

then "back side of the red rock stair" produces the Undertomb. A one-sided door has no "back side."

More often, we are dealing with a door and want to know what it leads to, but that depends where we're standing:

other side of (door) from (room) ... object

This phrase produces the room on the other side of the door, as seen from the given vantage point, which needs to be one of its sides. Example: if

The red rock stair is east of the Orchard and above the Undertomb.

then "other side of the red rock stair from the Undertomb" produces the Orchard, and vice versa.

direction of (door) from (room) ... object

This phrase produces the direction in which the door leads, as seen from the given vantage point, which needs to be one of its sides. Example: if

The red rock stair is east of the Orchard and above the Undertomb.

then "direction of the red rock stair from the Undertomb" produces up.


* See Adjacent rooms and routes through the map for more phrases which can look at the current map layout


arrow-up.png Start of Chapter 3: Things
arrow-left.png Back to §3.11. Two descriptions of things
arrow-right.png Onward to §3.13. Locks and keys

*ExampleDisenchantment Bay 5
Disenchantment Bay: adding the door and the deck to our charter boat.

**ExampleEscape
Window that can be climbed through or looked through.

***ExampleGaribaldi 1
Providing a security readout device by which the player can check on the status of all doors in the game.