Inform 7 Home Page / Documentation
§8.3. Changing the status line
The status line is the black bar along the top of a story being played, which ordinarily displays the current position; in a story with scoring, it also usually shows the score and number of moves taken. Like the command prompt, it is not fixed but results from values which can be changed: the "left hand status line" and "right hand status line".
The default values are "[the player's surroundings]" for the left hand status line and "[score]/[turn count]" for the right hand status line (if there's scoring; it's blank otherwise). Score and turn count are numbers which vary in play (more about scoring later); "[the player's surroundings]" is a text substitution really intended for just this purpose:
say "[the/-- player's surroundings]"
This text substitution produces a succinct description of where the player is, be this in darkness, in a lighted room or inside an opaque container such as a large packing case. Example:
now the left hand status line is "You: [the player's surroundings]";
These make useful elements to juggle in redesigning the status line, as in the following example:
When play begins:
now the left hand status line is
"[the player's surroundings] / [turn count] / [score]";
now the right hand status line is "Time: [time of day]".
The text in the right hand status line should be kept no more than 14 letters long, including any spaces. The left hand status line has more leeway, but should still be kept brief.
See Awarding points for scoring
Suppose a game with a large map entirely subdivided into regions. We could define:
"Politics as Usual"
When play begins:
now the right hand status line is "[map region of the location]".
Washington is west of Idaho.
Red is a region. Blue is a region. Idaho is in red. Washington is in blue.
Test me with "e / w".
Note that, since regions can be stacked, we technically can be within more than one region at once. In the Port Royal example, for instance, the Tavern region is inside the Inland region. If there is any ambiguity, "the map region of the location" will be construed as "the smallest region that the location belongs to": so we would see "Tavern" rather than "Inland" in the status bar, when the player was in the Feathers or the Feathers Bedroom.
Some extra finesse would be necessary if the names of map regions were very long or if there were some rooms that were not considered to belong to any region at all.
If we want to lay out the status line in some other way than with left-hand and right-hand entries, it is possible to do this as well. Later we will learn about the "rule for constructing the status line", but here is a basic effect using this rule and an Inform extension included as part of the standard distribution, called Basic Screen Effects.
"Centered"
When play begins:
say "After months of boring through the Earth's crust in this metal-jawed vehicle, you break through..."
The Hollow Core is a room. "Truly a magnificent sight: the land curves up away from you in every direction, covered with the cities and fields of the Core People. Molten rock runs in the canals, bringing heat and light to every home.
At the center of the Earth hangs a dense black sun."
Include Basic Screen Effects by Emily Short.
Rule for constructing the status line:
center "[location]" at row 1;
rule succeeds.
Test me with "look".
Basic Screen Effects also provides a mechanism for building complicated status lines of more than one row. To read its documentation, we include the extension, press Go!, and then consult the contents index that results.