Exit Lister by Eric Eve

Version 11

A status line exit-lister and an EXITS command, with optional colouring of unvisited exits. Selected rooms and doors can be optionally be excluded from the list of exits.


Chapter 1: Basic Overview
   
Section 1.1: What's New
   
Section 1.2: Status Line Exit Lister
   
Section 1.3: Alternative Status Lines
   
Section 1.4: Listing Exits Programmatically - A Smart Cant Go

Chapter 2: Showing Unvisited Rooms
   
Section 2.1: The Standard Behaviour
   
Section 2.2: Customization

Chapter 3: Hiding or Showing Exits
   
Section 3.1: Apparent or Not Apparent
   
Section 3.2: Listing or Hiding Exits in the Dark

Chapter 4: Customizing No Exit Messages

Examples
   
A — A Walk in the Woods
   
B — Exploring the Dark


Chapter 1: Basic Overview

Section 1.1: What's New

Version 10 of Exit Lister suppresses the listing of exits that lead from one dark room to another, although this behaviour can be changed by setting the global variable.dark-exits-invisible to false. For further details see the section on Listing or Hiding Exits in the Dark below.

Section 1.2: Status Line Exit Lister

This extension implements a status line exit lister similar to that provided as standard in TADS 3. The player can turn it on and off with the EXITS ON and EXITS OFF command. Its presence or absence may also be controlled programmatically by setting Exit Listing to enabled or disabled.

The extension also provides an EXITS command that lists the available exits, together with their destinations if these have been visited. The first time the EXITS command is used, the EXITS ON and EXITS OFF commands are explained.

Any room may optionally be given a destination name property. If we defined a destination room property for a room, it will be used in place of the printed name property when the room is shown as the destination of an exit in response to an EXITS command. This can result in better looking output, e.g.:

The obvious exits are north to the garden and east to the path.

Instead of:

The obvious exits are north to Garden and east to Path.

Section 1.3: Alternative Status Lines

The table used to construct the status line when exit listing is on is held in the global variable status exit table. This allows us to use the exit lister with a different status line layout if we wish. For example, we might define:

Table of New Exit Status
left     central     right
" [left hand status line]"     ""     "[right hand status line]"
" Explored: [number of visited rooms]/[number of rooms]"     ""     "Turn count:[turn count]"
" [exit list]"     ""     ""

And we could then use this table instead of the one defined in this extension by using the command:

now status exit table is Table of New Exit Status.

Section 1.4: Listing Exits Programmatically - A Smart Cant Go

The available exits can be listed using the command:

list the exits

This could be used to provide a "smart cant go" response, such as:

Instead of going nowhere:
say "You can't go that way. ";
list the exits.

You can also use "[list the exits]" as a to say phrase, for example:

Instead of going nowhere:
say "You can't go that way. [list the exits]";


Chapter 2: Showing Unvisited Rooms

Section 2.1: The Standard Behaviour

In a Z-Code game, exits leading to an unvisited room can be indicated in a different colour. In a Glulx game they can be shown in capitals. In both Z-Code and Glulx games, they can be shown preceded and followed by a marker character (either =, -, + or *). By default, unvisited exits are shown in red in a Z-Code game and in capitals in a Glulx game.

The command EXIT COLOUR or EXIT COLOR is provided to allow players to cycle through the options to find the one that best suits their interpreter and their preferences. In a Z-Code game the colours of unvisited exits will cycle between red, yellow, blue, green and none (i.e. the default colour, usually white). In a Glulx game unvisited exits will toggle between upper and lower case.

In both Z-Code and Glulx games the command EXIT SYMBOL can be used to cycle the symbols between =, -, *, + and none. This may be useful for a player using a Z-Code interpreter (such as Gargolye) that doesn't have the capability to change colours.

Section 2.2: Customization

By default this marking of unvisited exits is enabled at the start of a Z-Code game. If you do not want this you can disable it when play begins:

When play begins:
     now indicate-unvisited is dont-show-unvisited;

Conversely, you can enable this feature under programatic control with the command:

now indicate-unvisited is show-unvisited;

You can also change the colour (in Z-Code) by changing the value of the exit-colour-num variable according to the following table:

Table
exit-colour-num     Z-Code Colour
1     red
2     yellow
3     blue
4     green

Finally, you can change the marker symbol to anything you like by changing the exit-marker variable; e.g.:

now exit-marker is "?".

Of course, unless you disable the EXIT SYMBOL command, the player will still be able to change your choice of symbol.

You can also extend the range of symbols on offer by continuing the Table of Exit Symbols, e.g.

Table of Exit Symbols (continued)
exit-symbol
"!"
"~"
"[unicode 166]"
"%"


Chapter 3: Hiding or Showing Exits

Section 3.1: Apparent or Not Apparent

Doors can be apparent or not apparent. In some cases you may not want an exit shown in the exit lister because the player is not yet meant to know that an exit exists in that direction (for example, if a bookcase is in fact a secret door). In such a case you can declare the door through which the secret exit leads as not apparent. Once the player has discovered the secret exit you can make the door apparent, and then the exit will show up in the lister.

Rooms can also be apparent on not apparent. By default every room is apparent, but if for some reason we do not want the exits leading to a room to show up in the exit lister, we can make that room not apparent. If we want the same room to be apparent from some locations but not others, then we need to create some mechanism to switch the room between apparent and not apparent depending on the location of the player or other circumstances, perhaps in a before going or every turn rule, e.g.:

Every turn:
     if the location is the Short Path, now the Sunken Garden is apparent;
     otherwise now the Sunken Garden is not apparent.

Section 3.2: Listing or Hiding Exits in the Dark

If the player character is in a dark room we may not want the player to see any of the exits leading to other unlit rooms: the Exit Lister could potentially give too much information away in cases where the game text is telling us "It is pitch darkness and you can't see a thing" but the Status Line Exit Lister (and the EXITS commands) nevertheless lists all the exits leading from this pitch dark location. By default Exit Lister therefore suppresses the listing of directions that would lead to unlit locations when the player character is in a darkness. In this context "unlit" means a room that is not only dark itself but also contains no visible light source.

To change this behaviour we can simply set the value of the truth state variable dark-exits-invisible to false. When dark-exits-invisible is false all exits are listed (provided they are apparent) regardless of the state of the lighting. This is illustrated further in Example B.

We might also want to prevent travel to an unlit room from a dark location on the grounds that the player character can't see where he's going. To do this we can take advantage of the fact that Exit Lister defines the adjective darkness-occluded to refer to unlit rooms adjacent to a room where the player character is in darkness. To prevent dark-to-dark travel without giving anything away we could thus use something like:

Instead of going nowhere when in darkness: say can't see way in dark.
Instead of going to a darkness-occluded room: say can't see way in dark.
To say can't see way in dark: say "It's too dark to see where you're going."

This is also illustrated in Example B below.


Chapter 4: Customizing No Exit Messages

We can also customize what is displayed when there are no exits from a particular location. By default the status line exit lister will show "None" and the exits listed in response to an EXIT command will say "There are no obvious exits." We can change these if we like by providing our own definition of the phrases:

To say no-exits:
To say no-obvious-exits:

For example:

A room can be mapworthy or not mapworthy. A room is usually mapworthy.

To say no-exits:
if the location is mapworthy, say "None";
otherwise say "Unclear";

To say no-obvious-exits:
if the location is mapworthy, say "There are no obvious exits.";
otherwise say "It's unclear where the exits are."


A
 Example A Walk in the Woods

A brief exit lister example


B
 Example Exploring the Dark

Hiding and Showing Dark Exits