"Weathering"
A cloud pattern is a kind of value. The cloud patterns are cumulus, altocumulus, cumulonimbus, stratus, cirrus, nimbus, nimbostratus.
The Mount Pisgah Station is a room. "The rocky peak of Mt. Pisgah (altitude 872m) is graced only by an automatic weather station. The clouds, close enough almost to touch, are [a random cloud pattern]. Temperature: [a random number from 7 to 17] degrees, barometric pressure: [950 + a random number from 0 to 15] millibars."
Test me with "look / look / look".
"Full Moon"
Wolf Pursuit is a scene. Wolf Pursuit begins when play begins.
Every turn during Wolf Pursuit, say "[one of]A twig snaps behind you![or]The wind howls in your ears.[or]You feel chilly.[at random]".
When play begins:
say "You have lost your spectacles, and the lamp, and can see barely further than the next tree. Roots keep trying to trip you, too..."
The Dark Forest is a room. "You are mostly aware that you are not as alone here as you would like, and that the ground is uneven."
Test me with "z / z / z / z".
Suppose we want to have a sequence of nights and days in our game, with one scene to govern each daylight condition.
"Night and Day"
The sun is a backdrop. It is everywhere. The description is "Currently out of sight."
Night is a recurring scene. Night begins when play begins. Night begins when Dusk ends. Night ends when the time since Night began is 3 minutes.
Notice that our two conditions for the beginning of Night are not in conflict: it will be night-time when the game begins, and then night will also recur every time the Dusk scene ends.
When Night begins:
say "The sun falls below the horizon and the temperature drops abruptly to well below zero.";
now the description of the sun is "Currently out of sight."
Dawn is a recurring scene. Dawn begins when Night ends. Dawn ends when the time since Dawn began is 1 minute.
When Dawn begins:
say "The sun appears on the horizon.";
now the description of the sun is "It is tiny and weak.".
Day is a recurring scene. Day begins when Dawn ends. Day ends when the time since Day began is 3 minutes.
When Day begins:
say "The sun is now properly up."
Dusk is a recurring scene. Dusk begins when Day ends. Dusk ends when the time since Dusk began is 1 minute.
When Dusk begins:
say "The sun has passed across the sky and is on the verge of setting."
Cratered Landscape is a room. "The ground here is [if Night is happening]dim silver, with the craters visible as darker splotches[otherwise]the color of dried blood; here and there it is also rippled by impact craters[end if]. The horizon curves visibly."
Test me with "z / z / z / look / x sun / z / z / z / z / z / z / z".
If we run this example and then have a look at the scenes index, we'll see that the cycle is listed through thus:
Night (recurring)
Dawn (recurring)
Day (recurring)
Dusk (recurring)
Night
with the second "Night" in italics, to indicate that it is a repetition of the same scene that has already been listed above.
First we define the events, and then we create a phrase to schedule them:
"Totality"
At the time when the penumbra appears:
say "The sunlight dies away to an eerie, brownish penumbra."
At the time when the eclipse begins:
say "The moon passes across the disc of the sun, plunging the world into darkness.";
now the Chamber is dark.
At the time when the eclipse ends:
say "The moon passes away from the sun, and a gloomy penumbral light returns.";
now the Chamber is lighted.
At the time when normal sunlight returns:
say "The sun shines once more bright in the sky, not to be eclipsed again on this spot for another thirty-seven years."
To schedule an eclipse for (totality - a time):
the penumbra appears at two minutes before totality;
the eclipse begins at totality;
the eclipse ends at three minutes after totality;
normal sunlight returns at five minutes after totality.
Now we make use of the new phrase:
When play begins, schedule an eclipse for 3:27 PM.
The Chamber is a room.
The time of day is 3:25 PM.
Test me with "z / z / z / z / z / z / z / z / z".
We shall see much more about creating phrases later. Their advantage is that they enable a complicated sequence of operations to be given a meaningful name, and that they can be re-used many times as needed.
Because we can invent our own adjectives (see the chapter on Phrases), we can make the conditions for a backdrop as simple or as complicated as we like.
In this scenario, we want the player to be able to take, move, and drop orange traffic cones to seal off one street or another. So we create our own "accessible" adjective as follows:
Definition: a road is accessible if the orange cones are not in it.
...and now
move the traffic backdrop to all accessible roads.
will tell the traffic backdrop where to appear.
"Orange Cones"
A road is a kind of room.
The traffic is a backdrop. It is not scenery. The initial appearance is "Dense traffic snarls the streets, making it difficult to cross even with the lights. Men on motorbikes edge between the cars, and sometimes pull up onto the sidewalks to go around." The description is "It is more or less as usual for this time of day. It's a wonder it ever dissipates, really."
When play begins:
move the traffic backdrop to all accessible roads.
A line of orange cones are a thing.
Definition: a road is accessible if the orange cones are not in it.
After dropping the orange cones in a road:
say "With steely determination you begin to lay out the orange cones, blocking access to this segment of street. This produces honking and swearing -- but you persevere.";
update backdrop positions.
After taking the orange cones:
say "You go around taking up the orange cones, and within moments the traffic begins to flow into the street again.";
update backdrop positions.
That accomplishes everything we set out to do, but let's add a very simple puzzle to test it out with:
The Town Square is a road. North of the Town Square is Candle Street. Candle Street is a road. East of Town Square is Mortar Street. Mortar Street is a road.
The line of orange cones are in Mortar Street.
The player wears a reflective vest and a hard hat.
The manhole cover is a door. "[if location is accessible]Under the cars in the middle of the street, you can just make out the cover of the manhole you need to get into.[otherwise]There's a promising manhole in the middle of the street.[end if]". It is closed and openable. It is below the Town Square and above the Access Tunnel.
Instead of opening the manhole cover when the location is an accessible road:
say "You can't get anywhere near the manhole cover with all these cars above it."
Instead of taking the orange cones in Town Square:
if the manhole cover is closed or Town Square is accessible, continue the action;
otherwise say "You'd better not let the traffic back in until you've closed the manhole. There'll be accidents otherwise."
After going to the Access Tunnel:
say "With a stealthy glance left and right, you lower yourself into the access tunnel, thus accomplishing your mission for Chapter 2. To continue your adventure, see Chapter 3: The Vault of Peaquod.";
end the story finally.
And finally, a couple of features from the Activities chapter to make the output more elegant:
Rule for writing a paragraph about the orange cones: say "A line of orange cones holds back the traffic from entering here."
Rule for printing the name of the orange cones when the cones are carried by the player:
say "stack of orange cones".
Test me with "x traffic / open manhole / n / x traffic / s / e / x traffic / get cones / look / x traffic / w / drop cones / look / open manhole / take cones / d".
Suppose we have an urban space we want to populate with random passers-by. These should have a range of characteristics and not always be described in the same way; and once the player has noticed one, he should be able to look at her further, until another pedestrian crosses his path.
"Uptown Girls"
Riverside Drive is a room. "There's a pleasant late-afternoon view of the Hudson, and a snap in the air, and you would rather be here than anywhere."
Instead of going a direction, say "Oh, you know where you're going; no need to deviate from the usual path."
Instead of waiting, say "You stroll along enjoying the November crispness."
It gets a little annoying to have a random event occurring every single turn of play, so let's introduce some randomness to determine how often the message appears:
Every turn when a random chance of 1 in 3 succeeds:
reset passerby;
choose a random row in the Table of Atmospheric Events;
say "[event entry][paragraph break]"
Table of Atmospheric Events
event
"Slowly [a passerby] strolls by, turning to look at you as she passes."
"Some [passerby] nearly bumps into you."
"You dodge to avoid [a passerby]."
"You weave around [a passerby], who has stalled to look into a window."
"There's a ruckus as one of the ubiquitous taxis nearly collides with [a passerby] crossing the street."
"[The passerby] beside you waves to a friend across the street."
"To your left, [a passerby] drops her purse, and swears as she retrieves it."
Hair color is a kind of value. A person has hair color. the hair colors are red-headed, brunette, blonde.
Height is a kind of value. A person has height. The heights are tall, medium-height, short.
Grooming is a kind of value. A person has grooming. The groomings are messy and tidy.
To reset passerby:
now the hair color of the passerby is a random hair color;
now the height of the passerby is a random height;
now the grooming of the passerby is a random grooming.
The passerby is a woman in Riverside Drive. The passerby is scenery. Understand "woman" or "lady" as the passerby. The printed name of the passerby is "[one of]woman[or]lady[purely at random]".
At this point we borrow some techniques from later to describe the woman with a random combination of characteristics, and to let the player refer to her by those traits:
Before printing the name of the passerby:
if a random chance of 1 in 4 succeeds, say "[height] ";
if a random chance of 1 in 4 succeeds, say "[grooming] ";
if a random chance of 1 in 4 succeeds, say "[hair color] ".
Understand the hair color property as describing the passerby. Understand the height property as describing the passerby. Understand the grooming property as describing the passerby.
If we also wanted each of those combinations to mean some more specifically-described woman:
Instead of examining a passerby:
repeat through Table of Passerby Descriptions:
if hair entry is the hair color of the passerby and height entry is the height of the passerby and grooming entry is the grooming of the passerby, say "[description entry][paragraph break]".
Table of Passerby Descriptions
hair
|
height
|
grooming
|
description
|
red-headed
|
tall
|
messy
|
"An older woman with long red hippie-hair poking out of a ponytail in straggles, and bent to hide how tall she is."
|
red-headed
|
medium-height
|
messy
|
"A shaggy red-head with shingled hair."
|
red-headed
|
short
|
messy
|
"Almost an urchin, and very young, with ginger hair and a smudged nose and far too many freckles."
|
red-headed
|
tall
|
tidy
|
"A precise career woman with henna-red hair."
|
red-headed
|
medium-height
|
tidy
|
"Her hair is red in the way that lollipops and fire trucks are red: not by nature but by art. The rest of her clothing is pretty ordinary, though."
|
red-headed
|
short
|
tidy
|
"Thin and small in every sense, with chin-length red-hair. Even high heels do not bring her head much above your shoulder."
|
brunette
|
tall
|
messy
|
"A Juno-esque woman with dark hair, wearing something resembling a tent."
|
brunette
|
medium-height
|
messy
|
"An unremarkable woman with dark brown hair and the aura of needing a wash."
|
brunette
|
short
|
messy
|
"There are mustard stains on the t-shirt of this short brown-haired woman. Estimated age ca. 40. Possibly homeless."
|
brunette
|
tall
|
tidy
|
"A leggy brunette in business attire."
|
brunette
|
medium-height
|
tidy
|
"Medium-height, brown-haired, generally nondescript."
|
brunette
|
short
|
tidy
|
"A neat little dark-haired girl."
|
blonde
|
tall
|
messy
|
"A tall blonde of about thirteen who looks as though she has not yet figured out how to get her wardrobe to catch up with her rate of growth. Her t-shirt and her pants are too short."
|
blonde
|
medium-height
|
messy
|
"Black leather pants and the wall-o-hair look."
|
blonde
|
short
|
messy
|
"One of those shocking platinum blonde types, with a tiger-patterned skirt. Reeally trashy."
|
blonde
|
tall
|
tidy
|
"Elfin and severe, with perfectly straight hair falling to the middle of the back."
|
blonde
|
medium-height
|
tidy
|
"A rounded, Marilyn-esque blonde."
|
blonde
|
short
|
tidy
|
"Pin-precise in a blue-and-white striped suit and a boyish haircut."
|
Test me with "z / z / x passerby / z / z / x passerby".