Chapter 6: Commands
6.8. Waiting, Sleeping

The standard WAIT command makes time pass at the same rate that it would anyway - one minute per turn. In a game where events happen at specific times of day, though, we might want to give the player more control. Nine AM Appointment shows how to give the player a WAIT 10 MINUTES command, while Delayed Gratification lets him WAIT UNTIL a specific time of day.

Ordinarily, Inform also refuses to allow the player to SLEEP and WAKE UP: the commands exist, but have no effect. Change of Basis lets the player put himself into a sleep state in which he cannot do anything. A somewhat more interesting expansion on this idea would be to let the player sleep and have dreams; there are no examples specifically of dream states, but we might consult the examples on scenes about how to disrupt one environment and move the player to another, entirely new one.

* See Scene Changes for ways to move the player to a new environment such as a dream state


333
* Example  Nine AM Appointment
A WAIT [number] MINUTES command which advances through an arbitrary number of turns.

WI

If there's some reason the player needs to be at a specific place and time, we might want to allow him to wait a number of minutes at once.

"Nine AM Appointment"

Waiting more is an action applying to one number.

Understand "wait [number] minutes/turns" or "wait [number]" as waiting more.

Carry out waiting more:
    let duration be the number understood - 1;
    repeat with X running from 1 to duration
    begin;
        follow the turn sequence rules;
    end repeat.

The one nuance here is that after our wait command occurs, the turn sequence rules will occur one more time. So we need to subtract one from the parsed number to make it to the right number of minutes.

Report waiting more:
    say "It is now [time of day + 1 minute]."

And if we want to ensure that the player doesn't (accidentally or intentionally) put the interpreter through a really long loop, we could put an upper limit on his patience:

Check waiting more:
    if the number understood > 59, say "You really haven't got that kind of patience." instead.

The Specialist's Office is a room. The secretary is a woman in the Office. Instead of asking the secretary about "[appointment]", say "'Hang on just five more minutes,' she says, in a distracted manner."

Understand "appointment" or "specialist" or "doctor" as "[appointment]".

At 9:45 AM: say "The secretary glances at you and gives a reassuring smile."

Test me with "ask secretary about appointment / wait five minutes / g / g / wait 60 minutes / wait 30 minutes".

334
** Example  Delayed Gratification
A WAIT UNTIL [time] command which advances until the game clock reaches the correct hour.

WI
47
** Example  Change of Basis
Implementing sleeping and wakeful states.

WI


PreviousContentsNext