Relative Placement and Direction by Jeff Nyman


You should create a "When play begins:" rule and make sure you have a phrase like this:

The player is facing <direction>.

Here <direction> is a cardinal compass direction.

This extension allows the player to make relative direction references for movement. For example, instead of saying a cardinal direction ("north", "east", etc), the player can say "go forward" or "go backward".

This will move the player in the direction that they are facing.

The player can also turn to face a relative direction by saying "turn left" or "turn right". It's also possible for the player to "turn around".

Directions allowed are "forward" or "f", "back" or "b", "left" or "l", and "right" or "r". There are some new verbs established that allow these relative directions to be used:

"turn left"
"turn right"
"turn around"

When the player moves to a new room, he will face the way he is traveling. So if the player is facing north in a given room but goes east (or left) they will be facing to the left when they get to the new room.

This extension provides a relation about "facing." So something can be set up as "to be facing [a direction]". For example, you could have this:

The statue is facing east.

Let's say this refers to a statue in a room where the player just entered it from the south and is facing north. If the player now examines that statue, the player will be facing west, as if they turned toward the statue to look at it. This is purely optional as no objects (or people) are required to have an orientation set in the story.

As part of the descriptions for objects or rooms, you can use a construct like this:

"[north facing]"

Here "north" can be replaced by any cardinal compass direction. (Or, rather, any of the straight compass directions: north, south, east, west. Currently diagnoal directions do not really work for this.) What this substitution does is produce text that provides a relative direction, such as "to your left", "to your right", "in front of you", or "behind you" depending on the direction the player is facing when the description is produced.

One downside is that, currently, the diagonal directions (northwest, northeast, southwest, southesat) are not fully supported. The directional commands should work in those contexts but a visual facing indicator is not possible in the status line display, as its unclear what symbol to use. So if the player is facing a diagonal direction, the visual indicator will simply be a bullet/point display.

For any rooms that use in / out or enter / exit), this can get tricky but you can allow the player to face a particular way upon leaving or entering. The extension makes sure that each room has a default-facing property and this can be set as such:

The default-facing of Long Water is east.

This will provide a default way for the player to be facing when one of the cardinal or relative directions is not used. If this value isn't specified, the default facing direction is north.

It's important to note that any of the directional information, movement, and orientation references are for the player character. There are no provisions to handle any of this for non-player characters.

Example: * A Relative Stroll Through a Park

"A Relative Stroll Through a Park"

Include Relative Placement and Direction by Jeff Nyman.

Part - Locations

Palace Gate is a room.
Black Lion Gate is a room.
Lancaster Gate is a room.

Broad Walk is a room.
Flower Walk is a room.
Lancaster Walk is a room.

Along Bayswater Road is a room.
Round Pond is a room.
Grassy Area is a room.

Long Water is a room.
Wading is a room.

The default-facing of Wading is east.

Part - Connections

Broad Walk is north of Palace Gate.
Flower Walk is east of Palace Gate.
Lancaster Walk is north of Flower Walk.

Black Lion Gate is north of Broad Walk.
Lancaster Gate is north of Lancaster Walk.

Along Bayswater Road is east of Black Lion Gate and west of Lancaster Gate.
Along Bayswater Road is northeast of Broad Walk and northwest of Lancaster Walk.

Round Pond is east of Broad Walk and west of Lancaster Walk.
Round Pond is southeast of Black Lion Gate and southwest of Lancaster Gate.
Round Pond is south of Along Bayswater Road.

The Grassy Clearing is south of Round Pond, northeast of Palace Gate, and northwest of Flower Walk.
The Grassy Clearing is southeast of Broad Walk and southwest of Lancaster Walk.

Grassy Area is east of Lancaster Walk.
Long Water is east of Grassy Area.

A door called the tent door is down from Long Water and up from Sinkhole.
The tent door is closed and openable.

Wading is inside from Long Water.
Wading is east of Long Water.

Part - Setup of Status Line

When play begins:
     now the player is facing north.

Table of Fancy Status
     left central     right
     "" ""     "[top rose]"
     " [location]" ""     "[middle rose]"
     "" ""     "[bottom rose]"

Rule for constructing the status line:
     fill the status bar with the Table of Fancy Status;
     rule succeeds.