Chapter 6: Descriptions
6.7. Adjacent rooms and routes through the map

Another useful adjective built into Inform is "adjacent". Two rooms are said to be adjacent if there is a map connection between them which does not pass through some barrier such as a door. This is easily tested:

if the Hallway is adjacent to the Study ...

We usually want to know about the places adjacent to the current scene of the action, so that is what the adjective "adjacent" means when applied to rooms. For instance:

if somebody is in an adjacent room, ...

As with the case of "visible", the adjective is a cut-down version of the more general relationship. This often happens: "worn" and "carried", for instance, imply "by the player" unless something else is specified.

If we want to ask a more direct question, we can obtain specific map connections like so:

say "You look north into [the room north from the Garden]."

since "the room D from A" produces the room which lies in direction D from room A. We need to be a little careful here. What if there is no map connection this way? In that case, "the room ... from ..." produces the special value "nothing". Thus:

if the room north from the Garden is nothing, say "The grass leads nowhere."

While on the subject of navigating the map, the phrase "the best route from A to B" gives a direction to take in order to get from A to B by the shortest number of movements between rooms - if there is any way through at all. For example, here is a lure:

The description of the brass compass is "The dial points quiveringly to [best route from the location to the Lodestone Room]."

Best routes are ordinarily forbidden to go through doors, but if the suffix "using doors" is added as an option then any open or openable and unlocked door may be used on the way; and if "using even locked doors" is given, then any door at all will do. Since magnetism is no respecter of property, that seems right here:

The description of the brass compass is "The dial points quiveringly to [best route from the location to the Lodestone Room, using even locked doors]."

The phrase "the best route from A to B" gives the direction to take next, if we are at A and want to end up at B. Suppose this is east. We can find out where we go next by looking up "the room east from A": similarly for any other direction, of course. (This can see through any doors, locked or not.)

We can also stipulate that only certain rooms may be used for the journey, as in the following example:

best route from the Drawbridge to the Keep through visited rooms

The condition - in this case, that "visited rooms" must be used - also applies to both ends of the journey. (Also, saying something like "...through containers" would mean there is never a route, since it is only rooms which appear on the map.)

Lastly, we can find out how long the journey would be:

The description of the proximity gadget is "You are now [number of moves from the location to the Sundial] moves from the Sundial.";

This number is, of course, 0 if the location is already the Sundial. If there is no way at all to get to the Sundial, the number is -1.


70
* Example  Mistress of Animals
A person who moves randomly between rooms of the map.

RB
71
* Example  All Roads Lead to Mars
Layout where the player is allowed to wander any direction he likes, and the map will arrange itself in order so that he finds the correct "next" location.

RB
72
** Example  Hotel Stechelberg
Signposts such as those provided on hiking paths in the Swiss Alps, which show the correct direction and hiking time to all other locations.

RB

The following rule appends a paragraph to every room description. We need not worry about doors (despite the pass in the Bernese Oberland known figuratively as the "Little Door").

After looking:
    say "Yellow arms on the signpost point:-[line break]";
    repeat with destination running through rooms begin;
        let the way be the best route from the location to the destination;
        if the way is a direction, say " [way] for [the destination]: [number of moves from the location to the destination] Std.";
    end repeat.

The result might be:

Hotel Stechelberg
The wooden hiking inn at the end of the road, with flowerboxes, canton flags, outdoor tables and a triangular paddock for the cows contesting the annual Miss Stechelberg competition. Otto and Marianne do cheerful innkeeper things, while the sun blazes from a gentian-blue sky.

Yellow arms on the signpost point:-
    north for Lauterbrunnen: 2 Std.
    west for Sefinental: 2 Std.
    west for Schilthorn: 6 Std.
    southeast for Trachsellauenen: 1 Std.
    southeast for Oberhornsee: 3 Std.

73
*** Example  A View of Green Hills
A LOOK [direction] command which allows the player to see descriptions of the nearby landscape.

RB


PreviousContentsNext