9.16. Review of Chapter 9: Time

| Chapter 9: Time |

| 9.16. Review of Chapter 9: Time

1. Beginning and ending the game. Every rule has a circumstance attached for when it should take place. Some happen when certain actions are being tried, like taking something. Others happen at special times. The simplest of these are the rules which happen "when play begins", or "when play ends":

> When play begins: say "Welcome to Lanyon Moor!"
> When play ends: say "And so the mists of Lanyon Moor close behind you."

We can force play to end at any point, by using one of the following phrases inside some rule:

> end the story;
> end the story finally;
> end the story saying "Finis";
> end the story finally saying "You have won";

When play ends, we may resume after all, if we wish:

> When play ends: say "Here, try again..."; resume the story.

2. Scoring. Not all works of interactive fiction require a scoring system. If we do not want scoring at all, the sentence

> Use no scoring.

will prevent score commands from being understood. Otherwise, we may bump up (or down) the player's score with phrases such as:

> increase the score by 10 points;
> decrease the score by 5 points;

If we want to associate ranks automatically with different score levels, we may do so by providing a special table:

> Table of Rankings

> Score | Rank
> 0 | "Rank Amateur"
> ...

3. Every turn. We may define instructions to occur once per turn with an every turn rule, like this:

> Every turn, say "The thirteen clocks ominously decline to tick."

> Every turn when the player is in the Kitchen:
> say "The dripping of the faucet continues to annoy you."

These rules may or may not print anything, and can be used to accomplish all sorts of effects, from atmospheric events to independent behavior by other characters.

4. Time of day. By default, Inform keeps track of the time of day, according to a standard 24-hour system, in which time progresses at a rate of one minute per move. (See the Recipe Book for examples of how to change the rate of time, or to abolish 24-hour time and replace it with something else entirely.) Unless we say otherwise, a game is understood to begin at 9:00 AM. If we wish to change this, we may include an assertion such as

> The time of day is 10:00 AM.

Like all assertions, this describes the situation at the start of play: once the game gets going, time will of course roll onward.

We may print out the time of day with such phrases as

> say "[the time of day]";
> say "[the time of day in words]";
> say "[the time of day to the nearest five minutes in words]";

We may also perform calculations and change the current time, as in:

> increase the time of day by 2 hours;
> let N be the minutes part of the time of day;
> say "[10 hours after the time of day]";

> Instead of sleeping:
> say "You doze fitfully, then wake with a start to see daylight.";
> now the time of day is 11:15 AM.

5. Scheduling future events. We have two ways to schedule events. One is to write a rule which takes place at a specific time of day:

> At 4 PM: say "The great bells of the clock tower chime four."

The other is to create a rule starting with "When...", which will not take place until a named event happens:

> At the time when the egg-timer clucks: say "Sqwaaark!"

Here "the egg-timer clucks" is the event. It may never happen: the only way it will occur is if a phrase in some other rule specifies when -

> the egg-timer clucks in four turns from now;

6. Talking about past events. Finally, we are allowed to write conditions about things the player is doing or has done, as in

> if taking a container, ... (currently)
> if we have taken the lantern, ... (ever)

> if the player is in the Hall, ... (currently)
> if the player is in the Hall for the third time, ... (currently, but referring to past trips)
> if the player has been in the hall for 3 turns, ... (continuously)

> if the gate was open, ... (at the start of this action)
> if the gate has been open, ... (at any time)
> if the gate had been open, ... (as of the start of this action)

Previous | Contents | Next