| Chapter 17: Activities |

| 17.18. Constructing the status line

1. When it happens. Just before input is accepted from the keyboard, Inform constructs a "status line" at the top of the window which is normally displayed in reverse colours (white on black instead of black on white, say).

2. The default behaviour. Makes the status line up out of two pieces, the "left hand status line" and the "right hand status line". Since these can freely be changed, note that the status line is already very customisable without using rules applied to this activity.

3. Examples. (a) The most useful thing about this activity is that it allows us to vary descriptions in the status line. This is especially helpful to abbreviate unduly long room names, which might not otherwise fit:

> The Temple Of A Thousand Mightily Peeved Deities is a room. Rule for printing the name of the Temple while constructing the status line: say "Temple".

(b) Again, it's usually not necessary to apply activity rules to this, but occasionally amusing effects are possible if we do:

> The blindfold is wearable and initially carried. Rule for constructing the status line while the blindfold is worn: do nothing.

261
| Example Ways Out A status line that lists the available exits from the current location.

262
| Example Guided Tour A status line that lists the available exits from the current location, changing the names of these exits depending on whether the room has been visited or not.

> It may sometimes be helpful to prompt the player with a list of exits printed up in the status line. For instance, here is a status line that will print the names of nearby rooms, as well as all the doors the player can see: "Guided Tour" When play begins: change left hand status line to "Nearby: [if a room is adjacent][the list of adjacent rooms][end if][if a room is adjacent and a door is visible] and [end if][if a door is visible][the list of visible doors][end if]"; change right hand status line to "". Of course, we may not want to tell the player what glories are to be found in locations he hasn't yet explored. Rule for printing the name of an unvisited room (called the target) while constructing the status line: let aim be the best route from the location to the target; say "something [aim]". Even when we have seen a room, we might still want a reminder about how to get there: After printing the name of a visited room (called the target) while constructing the status line: let aim be the best route from the location to the target; say " ([aim])". We may also find that printing out full directions makes the status line unpleasantly crowded. Fortunately, it isn't hard to provide a set of abbreviations to use in this context: Rule for printing the name of a direction (called the aim) while constructing the status line: choose row with a heading of the aim in the Table of Abbreviation; say "[shortcut entry]". Table of Abbreviation
> heading | shortcut
> north | "N"
> northeast | "NE"
> northwest | "NW"
> east | "E"
> southeast | "SE"
> south | "S"
> southwest | "SW"
> west | "W"
> up | "U"
> down | "D"
> inside | "in"
> outside | "out"
Everywhere else, the names of directions will still be printed out in full in the usual way. And now we give it a little map to work with: Dome is a room. North of Dome is North Chapel. South of the Dome is South Chapel. West of the Dome is Western End. Quiet Corner is northwest of the Dome, north of Western End, and west of North Chapel. Loud Corner is east of North Chapel, northeast of Dome, and north of Eastern End. Eastern End is north of Dim Corner and east of Dome. Dim Corner is southeast of Dome and east of South Chapel. Ruined Corner is southwest of Dome, west of South Chapel, and south of Western End. The church door is east of Eastern End and west of the Courtyard. The church door is a door. Test me with "n / w / s". Note that while this looks fine in some places, other locations exceed the limits of what the status-line can hold: if any given room is going to have a large number of exits, this kind of listing will almost certainly not fit. So apply cautiously.

Previous | Contents | Next