Suppose we wanted a game set in a living town, with locations opening and closing at different times of day, and business carrying on as usual. The point might be to force the player to plan his itinerary carefully to hit the right spots at the right times; or we might be writing a more contemplative piece, where part of the enjoyment came from just watching the characters wander around doing their daily business...
"IPA"
When play begins: now the right hand status line is "[time of day]".
The time of day is 9:50 AM.
A shop is a kind of room. A shop has a time called the opening hour. The opening hour of the shop is usually 8 AM. A shop has a time called the closing hour. A shop usually has closing hour 6 PM.
Check going to a shop (called the target):
if the time of day is before the opening hour of the target,
say "[The target] is locked up until [the opening hour of the target]." instead.
Check going to a shop (called the target):
if the time of day is after the closing hour of the target,
say "[The target] has been closed since [the closing hour of the target]." instead.
Every turn when the location is a shop:
let deadline be the closing hour of the location;
if the deadline is before the time of day:
let target be a random adjacent room which is not a shop;
say "You are gently but firmly ushered out, since [the location] is closing.";
move the player to the target.
The Strip-mall Parking Lot is a room. "Dead Christmas trees are heaped outside the bagel shop. Strips of dirty ice survive along the curb, and in the shadows of the lamp-posts. A wet, almost illegible sheet of algebra homework is plastered to the asphalt.
Pinewood Brewing Supply is at the east end of the lot."
Pinewood Brewing Supply is a shop. It is east of Parking Lot. The opening hour of Pinewood Brewing Supply is 10:00 AM. The closing hour of Pinewood Brewing Supply is 3:30 PM. "Shelves and shelves of malt and hops; large glass carboys, and plastic tubing; empty bottles; bottle-caps; bottle-labeling kits; starters for vinegar, sourdough, root beer.
A sweet malty smell hangs in the air."
Instead of going to Brewing Supply when the time of day is before the opening hour of Brewing Supply for the second time:
say "You rattle at the door again. 'Hold your horses, for crying out loud,' yells a voice from within."
Noah's Bagels is a shop. It is north of the Parking Lot. The opening hour of Noah's Bagels is 6:00 AM. The closing hour of Noah's Bagels is 11:00 AM. "The selection has been somewhat picked over, leaving you with your choice of Pumpernickel, Asiago, or Everything."
Test me with "e / e / n / z / s / e / z / e / z / z / e".
Here we allow the player to set the time at which some future event is going to happen, rather than letting the game decide. We'll need to borrow the syntax for defining new actions from a later chapter:
"Hour of the Wren"
When play begins:
say "You more or less stumble across them in Central Park: a disparate group of people, all of different ages, sitting in a circle. They aren't talking to one another -- in fact, they seem to be trying very hard to ignore one another, like people in the waiting room of an especially embarrassing kind of doctor. You are about to go around when a woman in a grey pressed suit comes up to you. Her suit-skirt is trimmed in lavender cord, and she looks as though she might have been extremely sharp-dressed in 1944. She hands you a card."
The Circle in the Grass is a room. "No one is looking at you, except for the secretary, if that is what she is."
The player carries a card. The description of the card is "Typed: 'Active astrology - dislike your fortunes? change your stars! - make an appointment now - hour of the wren STILL AVAILABLE.'".
The time of day is 1:55 PM.
Understand "pick [time]" or "choose [time]" or "make appointment for [time]" or "make an appointment for [time]" as making an appointment for. Making an appointment for is an action applying to one time.
Carry out making an appointment for:
say "Fate cannot be commanded more than once."
Instead of making an appointment for the time understood for the first time:
say "You settle on [the time understood] for your appointment. The woman makes a note of it in an appointment book, which she carries in a brown paper bag. 'Excellent choice, ma'am,' she says in a low, urgent voice. 'You'll be very satisfied.'";
stars shift at the time understood.
Understand "hour of the wren" as 2:00 PM.
At the time when stars shift:
end the story saying "insert cataclysm here".
Test me with "x card / make appointment for hour of the wren / z / z / z / z".
"Air Conditioning is Standard"
Section 1 - The Garage
A person has some text called current occupation. The current occupation of a person is usually "None".
Mood is a kind of value. The moods are bemused, bored, attentive, rapt, and blushing. A person has a mood. A person is usually attentive.
Instead of examining a person:
now every thing is unmentioned;
carry out the writing a paragraph about activity with the noun.
Rule for writing a paragraph about a person (called X):
let the subsequent mention be "Name";
if the current occupation of X is not "None":
say "[current occupation of X]. ";
let the subsequent mention be "He";
if X is female, let the subsequent mention be "She";
if X wears something unmentioned:
if the subsequent mention is "Name", say "[The X] ";
otherwise say "[subsequent mention] ";
say "is wearing [a list of unmentioned things worn by X]";
if X carries something unmentioned, say " and carrying [a list of unmentioned things carried by X]";
say ".";
otherwise:
if X carries something unmentioned:
if the subsequent mention is "Name", say "[The X] ";
otherwise say "[subsequent mention] ";
say " is carrying [a list of unmentioned things carried by X]."
The Garage is a room. "Above the street door is a spectacular art nouveau fanlight, wherein a stained-glass Spirit of Progress bestows the gift of Transportation on mankind.
The sun, gleaming through the hair of Progress, throws amber curls on the macadam floor."
The fanlight is scenery in the Garage. The description is "A semi-circle of stained glass as wide as the garage door, designed by Louis Comfort Tiffany himself. No expense has been spared."
The gift of Transportation is part of the fanlight. The description is "The gift of Transportation is envisioned as a cornucopia disgorging a steam locomotive. And that blue bit of glass might be the Montgolfier balloon."
The Spirit of Progress is part of the fanlight. The description is "It is part of her character to have bare shoulders like that."
The machinist is a bored man. He is in the Garage. He is wearing a grimy pair of overalls. He carries a wrench and a screwdriver. The current occupation of the machinist is "[The machinist] is making some adjustments to [the random thing which is part of the Victorian Car] with his [random thing carried by the machinist]"
The Victorian Car is a device in the Garage. A cast-iron steering wheel, a leather bucket seat, a horn, and a combustion engine are part of the Victorian Car. The seat is an enterable supporter.
Rule for writing a paragraph about a device (called X):
let the subsequent mention be "Name";
if the X is unmentioned:
say "[The X] is here. ";
let the subsequent mention be "It";
if something is part of X:
if the subsequent mention is "Name", say "[The X] ";
otherwise say "[subsequent mention] ";
say "[if a mentioned thing is part of X]also [end if]features[if a mentioned thing is part of X], in addition to [the list of mentioned things which are part of X],[end if] [a list of unmentioned things which are part of X]";
say ".".
Rule for printing the name of the steering wheel while writing a paragraph about a person:
say "steering wheel".
A supporter has some text called position. The position of a supporter is usually "None".
The Office is west of the Garage. The Office contains a desk. The desk has the position "A [desk] with several dozen drawers stands in the center of the room". On the desk are some papers.
After printing the name of a supporter (called X) which supports an unmentioned thing:
now X is unmentioned.
Rule for writing a paragraph about a supporter (called X):
let the subsequent mention be "Name";
if the position of X is not "None":
say "[position of X]. ";
let the subsequent mention be "It";
if a mentioned thing is on X:
say "Besides [the list of mentioned things which are on X], ";
let the subsequent mention be "it";
if the subsequent mention is "Name", say "[The X] ";
otherwise say "[subsequent mention] ";
say "holds [a list of unmentioned things which are on X]."
Section 2 - Schedule
The time of day is 4:38 PM.
At 4:42 PM:
move the machinist to the Office;
say "The machinist wanders into the Office to get some paperwork.";
now every thing carried by the machinist is on the desk;
now the current occupation of the machinist is "[The machinist] rifles through [the papers] on [the desk]".
At 4:43 PM:
move the young lady to the Garage;
if the young lady can be seen by the player,
say "An attractive young lady walks in from the street, and glances around as though she has never been here before."
At 4:45 PM:
if the young lady can be seen by the player,
say "With a not-quite-convincing air of innocence, [the young lady] happens to lean upon [the horn], which bleats loudly.";
otherwise say "There is a honk from the Garage[if the machinist can be seen by the player]. The machinist looks up with a frown[end if].";
now the horn is mentioned.
At 4:46 PM:
move the machinist to the Garage;
say "The machinist strolls from the Office into the Garage to find out what is going on.";
now the current occupation of the machinist is "[The machinist] is chatting with [the young lady]. He seems to be demonstrating the various features of [the car], including [the random thing which is part of the car]";
now the current occupation of the young lady is "[The young lady] is asking [the machinist] a number of questions about [the car]".
At 4:49 PM:
if the young lady can be seen by the player, say "[The machinist] gives [the young lady] his arm to climb into [the seat].";
move the young lady to the seat;
now the young lady is rapt;
now the current occupation of the young lady is "[The young lady] is turning [the steering wheel] from side to side";
now the current occupation of the machinist is "[The machinist] is leaning on the door of [the car], pointing out features to [the young lady]";
move the besotted expression to the machinist;
now the machinist is wearing the besotted expression.
At 4:52 PM:
now the sober grey gown is unbuttoned at the neck;
if the young lady can be seen by the player, say "[The young lady] murmurs something about the wilting heat, and undoes a button or two of her gown. The machinist's expression is comical, or would be, if you weren't annoyed."
Every turn when the player is in the Garage and young lady is on the seat:
say "You are beginning to feel a little unnecessary in this scene."
Every turn when the player is in the Office and the young lady is on the seat:
say "There's no sound at all from the other room, not even conversation."
Before going to the Garage when the young lady is on the seat:
now the sober grey gown is tellingly dishevelled;
move the young lady to the Garage;
now the young lady is blushing;
say "There is a flurry of movement as you enter the room.";
now the current occupation of the young lady is "[The young lady] stands near the door, tapping her foot nervously";
now the besotted expression is nowhere;
now the current occupation of the machinist is "[The machinist] is leaning against [the car], looking smug".
Section 3 - Initially Out of Play
The besotted expression is a wearable thing. The description is "It looks foolish, doesn't it?"
The young lady is a bemused woman. She is wearing a sober grey gown and a pair of black boots. The current occupation of the young lady is "[The young lady] is running a gloved finger along the chassis of [the victorian car]"
Before printing the name of the young lady while writing a paragraph about a person:
say "[mood of the young lady] "
The description of the grey gown is "Something about the perfect row of tiny buttons has the wrong effect -- at any rate, it is natural to wonder how long they take to undo." The gown can be buttoned almost to the chin, unbuttoned at the neck, or tellingly dishevelled.
Rule for printing the name of the gown when writing a paragraph about a person:
say "sober grey gown ([sober grey gown condition])"
Test me with "z / look / look / z / look / west / east / z / look / z / look / z / look / west / east".