1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-05-03 17:49:39 +03:00

Fix for Jira bug I7-2380

This commit is contained in:
Graham Nelson 2024-03-19 21:14:26 +00:00
parent 6ba290b57f
commit 29926cc74e
461 changed files with 6984 additions and 6718 deletions

View file

@ -19,6 +19,15 @@ addresses, we need to compare them with the following routine, which returns
return -1;
];
@h Fully random word.
This should be our best try at a single word consisting of 16 uniformly
random bits. |random($100)-1| is a fully random byte.
=
[ FullyRandomWord;
return (random($100)-1)*$100 + (random($100)-1);
];
@h Integer roots.
We are unable to provide VM support for taking square or cube roots rapidly:

View file

@ -20,6 +20,15 @@ addresses, we need to compare them with the following routine, which returns
return 0;
];
@h Fully random word.
This should be our best try at a single word consisting of 32 uniformly random bits.
=
[ FullyRandomWord w;
@random 0 w;
return w;
];
@h Integer square root.
Although this routine performs integer square root, it does so using Glulx's
floating-point operations if available (with code contributed by Andrew

View file

@ -226,12 +226,31 @@ a random number between 17 and 4 is the same thing as a random number
between 4 and 17, and there is therefore no pair of $n$ and $m$ corresponding
to an empty range of values.
The following trick, devised by Zed Lopez in 2023, is designed to work even
when the range width (here called $s$) is larger than the maximum signed
integer size, so that the signed comparison $s > 0$ fails. In that case, it
appears alarmingly to go into an infinite loop, but the loop terminates with
a probability of at least 0.5 on each iteration. Even in the worst case of the
range, the expected number of iterations is only 2, and the probability of taking
more than 50 iterations is less than 0.0000000000000001, which is obviously
negligible. But we check the iteration count anyway in case a rigged random
number generator is being used, e.g. for story testing purposes, which happens
to be biased in a really unlucky way for us.
=
[ GenerateRandomNumber n m s;
if (n==m) return n;
if (n>m) { s = n; n = m; m = s; }
n--;
return random(m-n) + n;
[ GenerateRandomNumber n m s it;
if (n==m) return n;
if (n>m) { s = n; n = m; m = s; }
n--;
s = m - n;
if (s > 0) return random(s) + n;
n++;
do {
s = FullyRandomWord();
if ((s >= n) && (s <= m)) return s;
it++;
} until (it > 50);
return n;
];
Constant R_DecimalNumber = GenerateRandomNumber;
Constant R_PrintTimeOfDay = GenerateRandomNumber;

View file

@ -6,52 +6,53 @@ Description: A shake command which agitates soda and makes items thump around in
For: Z-Machine
{*}"3 AM"
Understand "shake [something preferably held]" as shaking.
Shaking is an action applying to one carried thing.
Carry out shaking:
say "Nothing results of your shaking [the noun]."
Instead of shaking a closed container when something is in the noun:
say "Something rattles inside [the noun]."
Instead of shaking a closed transparent container when something is in the noun:
say "Inside [the noun] there are banging noises produced by [the list of things contained by the noun]."
Instead of shaking an open container which contains something:
say "[The list of things contained by the noun] might fly out."
The Wawa is a room. "A convenience store, if you like to call it that, vending the usual assortment of chips, donuts, soda, and beer. There is something of a line at the sandwich counter."
The box of enrobed cakes is in the Wawa. "A box of Tastykake Enrobed Cakes has fallen off its shelf." The description is "'Enrobed Cakes' is a fancy term for 'strange sponge-like baked good, covered in a thin shell of waxy chocolate'. They are addictive, but not in a way that lets you respect yourself in the morning." The box is a closed openable container. In the box is a cake.
Instead of opening the box, say "The Wawa clerks frown on the consumption of unpurchased foodstuffs."
The can of root beer is a closed openable container carried by the player. The can of root beer is either agitated or calm.
Because the can of root beer should have some reactions to having been shaken later in the game, we need to borrow a few ideas from the chapter on Time:
Because the can of root beer should have some reactions to having been shaken later in the game, we need to borrow a few ideas from the chapter on [Time]:
{**}Instead of shaking the can of root beer:
the can calms down in five turns from now;
say "You give the can a good hard shake.";
now the can is agitated.
Instead of listening to the can: say "It sounds [if agitated]fizzy[otherwise]calm[end if]!"
At the time when the can calms down:
now the can is calm.
The sticky mess is fixed in place. "There is a sticky mess on the ground."
Instead of opening the agitated can of root beer:
now the can of root beer is nowhere;
now the sticky mess is in the location;
say "You open the can and fizzing sweet soda goes absolutely everywhere."
Instead of opening the calm can of root beer when the can has been agitated:
now the can of root beer is nowhere;
say "The root beer is disappointingly flat. That's what you get for shaking it up!"
Test me with "get box / shake box / open box / shake box / listen to can / shake can / listen to can / wait / wait / wait / wait / wait / listen to can / open can".

View file

@ -8,26 +8,26 @@ For: Z-Machine
Suppose we have a complete Encyclopedia in our game. The player is allowed to pick up the whole set (there must not be too many volumes), but also to do things with individual volumes, and indeed to scatter these volumes all over the place. Putting a volume back in the same place as the rest of the Encyclopedia should, however, restore it to the collective. We will start out by defining general rules for collectives like this:
{*}"AARP-Gnosis"
Fitting relates various things to one thing (called the home). The verb to fit means the fitting relation. Definition: a thing is missing if it is not part of the home of it.
A collective is a kind of thing.
Before doing something to something which is part of a collective:
let space be the holder of the home of the noun;
move the noun to the space.
Instead of examining a collective:
say "[The noun] consists of [the list of things which are part of the noun]."
Now the real work begins. One reason to make this an activity is that we might easily want to override it for specific objects; for instance, the generic collecting activity here would not deal properly with collectives of clothing where some items might be worn and others not. In that case, we would want to write another, more specific "collecting" activity to handle the complexities of fashion.
{**}Collecting something is an activity.
Every turn:
repeat with item running through collectives:
carry out the collecting activity with the item.
To remove (item - a thing) when empty:
let space be the holder of the item;
if the number of things which are part of the item is 0:
@ -36,7 +36,7 @@ Now the real work begins. One reason to make this an activity is that we might e
let the last thing be a random thing which is part of the item;
move the last thing to the space;
now the item is nowhere.
Before collecting a thing (called the item):
remove item when empty;
let space be the holder of the item;
@ -44,7 +44,7 @@ Now the real work begins. One reason to make this an activity is that we might e
if something (called the other space) contains at least two things which fit the item, move item to the other space;
if a room (called the other space) contains at least two things which fit the item, move item to the other space;
if someone (called the owner) carries at least two things which fit the item, move item to the owner.
Rule for collecting a thing (called the item):
let space be the holder of the item;
if space is a thing or space is a room:
@ -55,15 +55,16 @@ Now the real work begins. One reason to make this an activity is that we might e
And now for a cheerful scenario:
{**}The Boise Memorial Library is a room. "A concrete box of a room, roughly eight feet by fourteen, which contains all the fallout shelter has to offer by way of entertainment. Someone with a grim sense of humor has tacked a READ! literacy poster to the door, as though there were anything else to do while you await the calming of the Geiger counters." The shelf is a supporter in the Library. "A battered utility shelf stands against the south wall."
The New Idahoan Encyclopedia Set is a collective. Volume A-Aalto fits the Encyclopedia. It is part of the Set. Volume AAM-Aardvark fits the Encyclopedia. It is part of the Set. Volume Aarhus-Aaron fits the Encyclopedia. It is part of the Set. Volume AARP-Gnosis fits the Encyclopedia. It is part of the Set. Volume Gnu-Zygote fits the Encyclopedia. It is part of the Set. The Set is on the shelf.
Let's have the Encyclopedia describe itself differently depending on whether it's all in one place:
{**}After printing the name of the Set when something missing fits the Set:
say " (missing [a list of missing things which fit the Set])"
Before printing the name of the Set when the number of missing things which fit the set is 0:
say "complete ".
Test me with "get aarhus-aaron / look / inventory / get aam-aardvark / look / get gnu-zygote / look / get aarp-gnosis / look / inventory / drop set / look / get set / get a-aalto / inventory".

View file

@ -5,188 +5,187 @@ Index: Person who comments on the player's every action
Description: A complete story by Emily Short, called "A Day for Fresh Sushi", rewritten using Inform 7. Noteworthy is the snarky commenter who remarks on everything the player does, but only the first time each action is performed.
For: Z-Machine
The following is an almost-completely-faithful rewrite of Emily Short's "A Day for Fresh Sushi", which was originally written using the (very different) Inform 6 programming language. The -- let us be honest and call it a gimmick -- of this game is the evil fish, who has some unpleasant remark to offer on pretty much every action. But the effect would wear off fast if he repeated himself, so these comments need to be single-use only.
The following is an almost-completely-faithful rewrite of Emily Short's "A Day for Fresh Sushi", which was originally written using the (very different) Inform 6 programming language. The let us be honest and call it a gimmick of this game is the evil fish, who has some unpleasant remark to offer on pretty much every action. But the effect would wear off fast if he repeated himself, so these comments need to be single-use only.
Inform 7's repeated action syntax makes it much tidier to write the same scenario, so:
{*}"A Day For Fresh Sushi" by Emily Short.
Use scoring.
The story headline is "Your basic surreal gay fish romance".
The Studio is a room. "[if visited]Decorated with Britney's signature flair. It was her innate sense of style that first made you forgive her that ludicrous name. And here it is displayed to the fullest: deep-hued drapes on the walls, the windows flung open with their stunning view of old Vienna, the faint smell of coffee that clings to everything. Her easel stands over by the windows, where the light is brightest.[otherwise]This is Britney's studio. You haven't been around here for a while, because of how busy you've been with work, and she's made a few changes -- the aquarium in the corner, for instance. But it still brings back a certain emotional sweetness from the days when you had just met for the first time... when you used to spend hours on the sofa...
You shake your head. No time for fantasy. Must feed fish.[end if]"
Instead of smelling the Studio:
say "The evil fish notices you sniffing the air. 'Vanilla Raspberry Roast,' it remarks. 'You really miss her, don't you.'
You glance over, startled, but the fish's mouth is open in a piscine equivalent of a laugh. You stifle the urge to skewer the thing..."
Instead of jumping:
say "'Er,' says the fish. 'Does that, like, EVER help??'"
Instead of going nowhere:
say "You can't leave until you've fed the fish. Otherwise, he'll complain, and you will never hear the end of it."
The cabinet is an openable closed container in the Studio. It is fixed in place. "A huge cabinet, in the guise of an armoire, stands between the windows." The description is "Large, and with a bit of an Art Nouveau theme going on in the shape of the doors." Understand "armoire" as the cabinet.
Instead of looking under the cabinet for the first time:
say "'Dustbunnies,' predicts the fish, with telling accuracy. It executes what for all the world looks like a fishy shudder. 'Lemme tell you, one time I accidentally flopped outta the tank, and I was TWO HOURS on the floor with those things STARING ME IN THE NOSE. It was frightening.'"
After opening the cabinet for the first time:
say "'There ya go,' says the fish. 'The girl is getting WARMER.'"
After closing the cabinet for the first time:
if the fish food is not found, say "'Ooh, what do you think, Bob? I think we're going to have to dock the girl a few points. HAVE ANOTHER LOOK, sweetcakes, there's a doll.'"
The cabinet contains some paints and some cloths. The description of the paints is "A bunch of tubes of oil paint, most of them in some state of grunginess, some with the tops twisted partway off."
After taking the paints for the first time:
say "'Boy,' says the fish, apparently to himself, 'I sure hope that's some food she's finding for me in there. You know, the yummy food in the ORANGE CAN.'"
After examining the paints for the first time:
say "'Tons of useful stuff in there,' hollers in the fish, in a syncopated burble."
The description of the cloths is "Various colors of drapery that Britney uses to set up backgrounds and clothe her models. She does a lot of portraiture, so this comes in handy. It's all a big messy wad at the moment. Organized is not her middle name." Understand "drapery" or "cloth" as the cloths. The indefinite article of the cloths is "a heap of". [see 3.17]
Instead of searching or looking under the cloths for the first time:
now the player is carrying the fish food;
now the fish food is found;
say "Poking around the cloths reveals -- ha HA! -- a vehemently orange can of fish food."
Instead of showing the cloths to the fish:
say "'What are you, some kind of sadist? I don't want to see a bunch of cloths! What kind of f'ing good, 'scuse my French, is that supposed to do me? I don't even wear pants for God's sake!'
He really looks upset. You start wondering whether apoplexy is an ailment common to fish."
After examining cloths for the first time:
say "'Whatcha looking at? I can't see through the doors, you know.'"
There is a can of fish food. Understand "canister" as the can. The description is "A vehemently orange canister of fish food." The fish food can be found or hidden. The fish food is hidden.
Instead of giving the can to the fish:
say "'I don't want the whole can, GeniusChyk. Just feed me and we'll ALL be happy, 'kay?"
Instead of showing the can to the fish:
say "'That's the ticket, sweetie! Bring it on.'"
Instead of opening the can:
say "'Oh, for--!' The evil fish breaks out in exasperation and hives. 'Screw the screwing around with the screwtop. SHE never has to do that.'
'Well, SHE is not here,' you reply. 'What do you suggest?'
'>FEED FISH<' says the fish promptly, making fishy faces and pointing at you with his fin. 'Simplicity. Try it.'"
Instead of inserting the can into something:
say "'HelLLLOOO,' screams the fish. 'Whatever happened to FEEDING MEEE?'"
The easel is a supporter in the Studio. It is scenery. On the easel is a painting. Understand "portrait" or "image" as the painting.
The description of the painting is "Only partway finished, but you can tell what it is: Britney's mother. You only met the old woman once, before she faded out of existence in a little hospice in Salzburg.
In the picture, her hands are grasping tightly at a small grey bottle, the pills to which she became addicted in her old age, and strange, gargoyle-like forms clutch at her arms and whisper in her ears.
But the disturbing thing, the truly awful thing, is the small figure of Britney herself, down in the corner, unmistakable: she is walking away. Her back turned.
You thought she'd finally talked this out, but evidently not. Still feels guilty for leaving. You only barely stop yourself from tracing, with your finger, those tiny slumped shoulders..."
Instead of taking the painting, say "No, you'd better leave it. It'd freak her out if you moved it."
Before examining the painting for the first time:
say "A ferocious banging from the aquarium attracts your attention as you go to look at the painting. 'Hey!' screams the fish. 'She doesn't like strangers looking at her paintings before they're DOONNNE!'
'Shut up, you,' you reply casually. 'I'm not a stranger.' But the fish puts you off a little bit, and your heart is already in your mouth before you see the painting itself...".
Instead of examining the painting more than once:
say "Once is really enough. It's pretty much embedded in your consciousness now."
After doing something to the painting:
say "'So what's it of?' asks the fish, as you turn away. 'She never asks if I want to see them, you know?'
'Her mother,' you respond without thinking.
'Yeah? Man. I never knew my mother. Eggs, that's the way to go.'"
The window is scenery in the Studio. The window can be openable. The window can be open. It is openable and closed. Understand "windows" as the window. The description of the window is "[if open]Through the windows you get a lovely view of the street outside. At the moment, the glass is thrown open, and a light breeze is blowing through.[otherwise]Through the windows, you get a lovely view of the street outside -- the little fountain on the corner, the slightly dilapidated but nonetheless magnificent Jugendstil architecture of the facing building. The glass itself is shut, however.[end if]"
After opening the window for the first time:
say "'Thank god some air,' says the fish. 'Man, it was getting hard to breathe in here.' Two beats pass. 'Oh wait.'"
The table is scenery in the Studio. On the table is a vase. The vase is an open container. It is not openable.
The description of the table is "A monstrosity of poor taste and bad design: made of some heavy, French-empire sort of wood, with a single pillar for a central leg, carved in the image of Poseidon surrounded by nymphs. It's all scaley, and whenever you sit down, the trident has a tendency to stab you in the knee. But Britney assures you it's worth a fortune." The description of the vase is "A huge vase -- what you saw once described in a Regency romance as an epergne, maybe -- something so big that it would block someone sitting at the table from seeing anyone else also sitting at the table. But it does function nicely as a receptacle for hugeass bouquets of flowers."
Instead of looking under the table for the first time:
say "'You're not going to find anything down there,' whines the fish. 'I mean, c'mon. It's the fricking floor. Please tell me you can see that. I can see that. I'm a myopic fish in a tank ten feet away and I can tell you there is nothing there but floor.'"
After examining the table:
say "'That there is MY PA,' says the fish, pointing at the scaley triton figure with one fin."
Instead of inserting something which is not the bouquet into the vase:
say "'Okay, so, what were you, raised in a barn? Normal folks like to use that for flowers. Or so I've observed.'"
After inserting the bouquet into the vase for the first time:
say "You settle the flowers into the vase and arrange them so that they look sprightly.
'Oooh,' says the fish. 'No one ever changes the plant life in HERE. It's the same seaw--'
'Cut me a break and cork it,' you reply tartly."
The player is carrying a telegram, a bouquet, and a lingerie bag. The player is wearing a chef hat.
The description of the telegram is "A telegram, apparently. And dated three days ago. [fixed letter spacing]TRIUMPH OURS STOP BACK SOON STOP BE SURE TO FEED FISH STOP[variable letter spacing]". [For printing options see 4.13.] Understand "yellow paper" as the telegram.
After examining the telegram for the first time:
say "'So,' blubs the evil fish. 'How about it? Little food over here?'"
After examining the telegram:
choose a random row in the Table of Insulting Fish Comments;
say "[comment entry][paragraph break]".
Table of Insulting Fish Comments
comment
"'Yeah, yeah,' says the fish. 'You having some trouble with the message, there? Confused? Something I could clear up for you?'"
"'Oookay, genius kid has some troubles in the reading comprehension department.' The fish taps his head meaningfully against the side of the tank. 'I'm so hungry I could eat my way out, you get my meaning?'"
"'I'll translate for you,' screams the fish in toothy fury. 'It says GIVE FOOD TO FISH!! How much more HELP do you NEED???"
The description of the chef hat is "A big white chef hat of the kind worn by chefs. In this case, you. Just goes to show what a hurry you were in on the way out of the restaurant." Understand "big" or "white" or "chefs" or "chef's" as the chef hat. [Inform knows that this is clothing because the player starts out wearing it, so there's no need to say so separately.]
The aquarium is a transparent open container in the Studio. It is not openable. "In one corner of the room, a large aquarium bubbles in menacing fashion." The description of the aquarium is "A very roomy aquarium, large enough to hold quite a variety of colorful sealife -- if any yet survived." Understand "tank" as the aquarium.
The aquarium contains some gravel and some seaweed. Understand "little rocks" as the gravel. Understand "weed" as the seaweed. The description of the gravel is "A lot of very small grey rocks." The description of the seaweed is "Fake plastic seaweed of the kind generally bought in stores for exactly this purpose."
The examine containers rule does nothing when examining the aquarium.
After examining the gravel for the first time:
say "The fish notices your gaze; makes a pathetic mime of trying to find little flakes of remaining food amongst the gravel."
After examining the seaweed for the first time:
say "'Nice, hunh?' blubs the fish, taking a stabbing bite out of one just by way of demonstration. 'Look so good I could eat it.'"
The aquarium contains an animal called an evil fish. The description of the fish is "Even if you had had no prior experience with him, you would be able to see at a glance that this is an evil fish. From his sharkish nose to his razor fins, every inch of his compact body exudes hatred and danger."
Instead of taking the evil fish:
say "The fish swims adroitly out of range of your bare hand. 'Hey,' he says, and the bubbles of his breath brush against your fingers. 'Count yourself lucky I don't bite you right now, you stinking mammal.'"
Instead of attacking the evil fish:
say "Oh, it's tempting. But it would get you in a world of hurt later on."
Instead of kissing the evil fish:
say "You're saving all your lovin for someone a lot cuddlier."
After examining the evil fish for the first time:
say "The fish glares at you, as though to underline this point."
After examining the evil fish for the second time:
say "'If you're looking for signs of malnutrition,' says the fish, 'LOOK NO FURTHER!!' And it sucks in its gills until you can see its ribcage."
An every turn rule:
choose a random row in the Table of Fish Banter;
say "[comment entry][paragraph break]".
Table of Fish Banter
comment used
"'Hey, nice SKIN TONE,' shouts the evil fish. His words reach you in a spitting gurgle of aquarium water. 'You gone over to a pure eggplant diet these days?'" 0
@ -194,48 +193,48 @@ Inform 7's repeated action syntax makes it much tidier to write the same scenari
"The evil fish darts to the bottom of the tank and moves the gravel around with his nose." 0
"The evil fish is swimming around the tank in lazy circles." 0
"The evil fish begins to butt his pointy nose against the glass walls of the tank." 0
The description of the bouquet is "Okay, so it's silly and sentimental and no doubt a waste of money, of which there is never really enough, but: you miss her. You've missed her since ten seconds after she stepped aboard the shuttle to Luna Prime, and when you saw these -- her favorites, pure golden tulips like springtime -- you had to have them." Understand "flowers" or "tulip" or "tulips" as the bouquet.
After examining the bouquet for the first time:
say "'Oh, you shouldn't have,' says the fish. 'For me??'
You just respond with a livid glare."
say "'Oh, you shouldn't have,' says the fish. 'For me??' You just respond with a livid glare."
Instead of smelling the bouquet for the first time:
say "'Mmm-mm,' says the fish. 'Damn, I sure wish I had olfactory abilities. Hey, if I did, I might be even better at noticing the presence or absence of FOOD.'"
The description of the lingerie bag is "You grant yourself the satisfaction of a little peek inside. You went with a pale, silky ivory this time -- it has that kind of sophisticated innocence, and it goes well with the purple of your skin. A small smirk of anticipation crosses your lips."
After examining the lingerie bag for the first time:
say "'What's in THERE?' asks the fish. 'Didja bring me take-out? I don't mind Chinese. They eat a lot of carp, but what do I care? I'm not a carp. Live and let live is what I s--'
'It's NOT take-out.' You stare the fish down and for once he actually backstrokes a stroke or two. 'It's PRIVATE.'"
After examining the lingerie bag for the second time:
say "'If it's not take-out, I don't see the relevance!' shouts the fish. 'Food is what you want in this situation. Food for MEEEE.'"
Understand the command "feed" as something new.
Understand "feed [something]" as feeding.
Feeding is an action applying to one visible thing.
Check feeding:
if the noun is not the evil fish, say "That doesn't make much sense." instead;
if the player is not carrying the fish food, say "You need the fish food first." instead.
Carry out feeding:
increment the score;
say "Triumphantly, you dump the remaining contents of the canister of fish food into the tank. It floats on the surface like scum, but the fish for once stops jawing and starts eating. Like a normal fish. Blub, blub.[paragraph break]";
say "[bold type] *** TWO HOURS LATER ***[roman type][paragraph break]'So,' Britney says, tucking a strand of hair behind your ear, 'where shall we go for dinner? Since I made the big bucks on this trip, it's my treat. Anywhere you like.'[paragraph break]'I've had a hankering all day,' you admit, as the two of you turn from the shuttle platform and head toward the bank of taxis. 'I could really go for some sashimi right now.'";
end the story finally.
Before feeding the fish food:
try feeding the evil fish instead.
When play begins:
say "You're on the run. You've got a million errands to do -- your apartment to get cleaned up, the fish to feed, lingerie to buy, Britney's shuttle to meet-- [paragraph break]The fish. You almost forgot. And it's in the studio, halfway across town from anywhere else you have to do. Oh well, you'll just zip over, take care of it, and hop back on the El. This'll be over in no time.[paragraph break]Don't you just hate days where you wake up the wrong color?[paragraph break]".
The maximum score is 1.
Test me with "x fish / g / kiss fish / x aquarium / x gravel / x seaweed / i / x telegram / x bouquet / smell bouquet / x lingerie / g / x hat / x window / open window / x painting / g / x cabinet / open cabinet / x cloths / search cloths / open food / feed fish".

View file

@ -8,17 +8,18 @@ For: Z-Machine
Rules about going to regions make it easy to exclude the player from a large portion of the map, even if there are many connecting paths to the region. For instance, in this story it would be annoying to have to write a rule about all four exits by which the player could reach the film set area:
{*}"A&E"
Winding Street is a room. Winding Street is west of Duck Pond. Sloping Street is north of Winding Street, northwest of Duck Pond, west of Stately Lawn, and southwest of Stately Home. Stately Lawn is north of Duck Pond. Stately Home is north of Stately Lawn.
Film Set is a region. Duck Pond, Stately Lawn, and Stately Home are in Film Set.
Instead of going to Film Set when the player does not carry the VIP Pass: say "A burly studio guard materializes in your path, convincing you that you would prefer to be elsewhere."
The VIP Pass is in the garbage can. The garbage can is in Sloping Street.
After going to the Film Set:
say "Success! At last you are inside the set of 'Prouder and More Prejudiced'. Next step: locating Mr Firth.";
end the story finally.
Test me with "e / n / e / get pass / e".

View file

@ -10,7 +10,7 @@ Suppose we have a game in which the player can climb through windows which overl
To figure out the height distance between the start room and the destination room, we might have a repeat loop look at all the directions one has to follow along the "best route" path between the two rooms, and record any ups and downs; then subtract the number of "up" steps from the number of "down" steps, and report what remains.
{*}"A Haughty Spirit"
To decide what number is the distance (first place - a room) rises above (second place - a room):
let the total distance be the number of moves from the first place to the second place;
if the total distance is less than 1, decide on 0;
@ -28,12 +28,12 @@ To figure out the height distance between the start room and the destination roo
Now we just have to create windows and some action rules for interacting with them...
{**}A window is a kind of thing. A window is always fixed in place. A window can be open or closed. A window is usually closed. A window can be openable or unopenable. A window is usually openable.
Understand "climb through [something]" as entering. Understand "jump through/out [something]" as entering.
Before entering a closed window:
say "[The noun] would have to be opened first." instead.
Instead of entering a window:
if the noun overlooks a room (called the far side):
let fall be the distance the location rises above the far side;
@ -42,18 +42,19 @@ Now we just have to create windows and some action rules for interacting with th
move the player to the far side;
otherwise:
say "There's nowhere to go."
Instead of examining a window:
say "[The noun] [if the noun is open]opens over[otherwise]gives a view of[end if] [the list of rooms overlooked by the noun]."
Here we must anticipate a little from the chapter on Relations, and provide ourselves with a way of keeping track of how windows and rooms relate to one another:
Here we must anticipate a little from the chapter on [Relations], and provide ourselves with a way of keeping track of how windows and rooms relate to one another:
{**}Overlooking relates various windows to various rooms. The verb to overlook means the overlooking relation. The initial appearance of a window is usually "[The item described] overlooks [the list of rooms overlooked by the item described]."
The Square Keep is above the Winding Staircase. The Winding Staircase is above the Motte. A crown and a broken sword are in the Motte. The Bailey is west of the Motte.
The long window is in the Keep. The long window overlooks the Bailey and the Motte. The narrow window is in the Winding Staircase. The narrow window overlooks the Bailey.
Test me with "jump through window / open window / jump through window / d / x narrow window / open window / climb through window / e / up / down".
We could then add rules to allow the player to look through windows and see things in the rooms below, but that would require more material from later chapters.

View file

@ -8,23 +8,23 @@ For: Z-Machine
First we define the relationships we choose to acknowledge:
{*}"A Humble Wayside Flower"
Marriage relates one person to another (called the spouse). The verb to be married to means the marriage relation.
Fatherhood relates one person (called father) to various people. The verb to engender means the fatherhood relation.
For brevity, we will ignore the existence of mothers. It is a sad world.
{**}Siblinghood relates a person (called A) to a person (called B) when a person who engenders A engenders B. The verb to be sibling to means the siblinghood relation.
Family relates a person (called A) to a person (called B) when A is married to B or A engenders B or B engenders A or A is sibling to B. The verb to be related to means the family relation.
A person can be known or unknown. After printing the name of an unknown person (called the alien):
if a known person (called the contact) is related to the alien:
say " ([relation between alien and contact] of [the contact])";
now the alien is known;
rule succeeds.
To say relation between (first party - a person) and (second party - a person):
if the first party is married to the second party:
if the first party is female, say "wife";
@ -41,9 +41,10 @@ For brevity, we will ignore the existence of mothers. It is a sad world.
if the first party is female, say "daughter";
otherwise say "son";
rule succeeds.
Pere Blanchard's Hut is a room. Percival Blakeney is a known man in the Hut. Marguerite is a woman in the Hut. Percival is married to Marguerite. Outside from the Hut is the Garden. Louise is a woman in the Garden. The Road to Paris is west of the Garden. Armand St Just is a man in the Road. Louise is married to Armand. Monsieur St Just is a man. He engenders Armand and Marguerite.
Test me with "out / west / east / west".
Monsieur St Just never appears on the scene in this piece, but if we did put him somewhere the player could find him, he, too, would be properly introduced.

View file

@ -2,7 +2,7 @@ Example: *** A point for never saving the game
Location: Out of world actions
RecipeLocation: Saving and Undoing
Index: A point for never saving the game
Description: In some of the late 1970s "cave crawl" adventure games, an elaborate scoring system might still leave the player perplexed as to why an apparently perfect play-through resulted in a score which was still one point short of the supposed maximum. Why only 349 out of 350? The answer varied, but sometimes the last point was earned by never saving the game - in other words by playing it right through with nothing to guard against mistakes (except perhaps UNDO for the last command), and in one long session.
Description: In some of the late 1970s "cave crawl" adventure games, an elaborate scoring system might still leave the player perplexed as to why an apparently perfect play-through resulted in a score which was still one point short of the supposed maximum. Why only 349 out of 350? The answer varied, but sometimes the last point was earned by never saving the game - in other words by playing it right through with nothing to guard against mistakes (except perhaps ``undo`` for the last command), and in one long session.
For: Untestable
Here is one way to score this point with Inform:
@ -17,3 +17,4 @@ That has the right effect, but it just isn't sneaky enough. Instead let us quiet
Sneakier, certainly, but now we could get the bonus even if the game ends earlier on, so finally:
When play ends: if the number of saves is 0 and the score is 349, increment the score.

View file

@ -2,35 +2,35 @@ Example: *** A View of Green Hills
Location: Adjacent rooms and routes through the map
RecipeLocation: Continuous Spaces and The Outdoors
Index: LOOK [direction] command
Description: A LOOK [direction] command which allows the player to see descriptions of the nearby landscape.
Description: A ``look`` [direction] command which allows the player to see descriptions of the nearby landscape.
For: Z-Machine
Suppose a game in which the player is wandering an open landscape with long vistas, allowing them to LOOK in some direction, or even look at an adjacent location.
Suppose a game in which the player is wandering an open landscape with long vistas, allowing them to ``look`` in some direction, or even look at an adjacent location.
{*}"A View of Green Hills"
Corinth is a room. Athens is east of Corinth. Epidaurus is southeast of Corinth and east of Mycenae. Mycenae is south of Corinth. Olympia is west of Mycenae. Argos is south of Mycenae. Thebes is northwest of Athens. Pylos is south of Olympia. Sparta is east of Pylos and south of Argos. Delphi is northwest of Thebes.
Understand "look [direction]" as facing.
Facing is an action applying to one visible thing.
Carry out facing:
let the viewed item be the room noun from the location;
if the viewed item is not a room, say "You can't see anything promising that way." instead;
try looking toward the viewed item.
In rules about action handling, "noun" refers to the first object that the player has mentioned in their command, so if the player typed >LOOK WEST, "let the viewed item be the room noun from the location" would be processed as "let the viewed item be the room west from the location", and so on.
In rules about action handling, "noun" refers to the first object that the player has mentioned in their command, so if the player typed ``look west``, "let the viewed item be the room noun from the location" would be processed as "let the viewed item be the room west from the location", and so on.
We can at need override the default behavior, if it is not going to be appropriate for the player to see the next room over. There is only sky above at any time, so...
We can at need override the default behaviour, if it is not going to be appropriate for the player to see the next room over. There is only sky above at any time, so...
{**}Instead of facing up:
say "Above you is bright sky."
Understand "look toward [any adjacent room]" as looking toward. Understand "examine [any adjacent room]" as looking toward.
Looking toward is an action applying to one visible thing.
Carry out looking toward:
say "You make out [the noun] that way."
@ -38,5 +38,6 @@ This design allows us to create descriptions for rooms (as seen from the outside
{**}Instead of looking toward Athens:
say "Even from here you can make out the silhouette of the Acropolis."
Test me with "look north / look south / look up / look east / east / look west".

View file

@ -5,36 +5,37 @@ Index: About Inform's regular expression support
Description: Some footnotes on Inform's regular expressions, and how they compare to those of other programming languages.
For: Untestable
There is not really any unanimity about what regular expression language is. The unix tools sed and grep extend on Kleene's original grammar. Henry Spencer's regex library extended on this again, and was a foundation for Perl, but Perl once again went further. Philip Hazel's PCRE, despite the name Perl Compatible Regular Expressions, makes further extensions still, and so on.
There is not really any unanimity about what regular expression language is. The unix tools sed and grep extend on Kleene's original grammar. Henry Spencer's regex library extended on this again, and was a foundation for Perl, but Perl once again went further. Philip Hazel's ``pcre``, despite the name Perl Compatible Regular Expressions, makes further extensions still, and so on.
Inform's regular expressions are modelled on those of Perl, as the best de facto standard we have, but a few omissions have been inevitable. Inform's regex matcher must occupy source code less than one hundredth the size of PCRE, and it has very little memory. Inform aims to behave exactly like Perl except as follows:
Inform's regular expressions are modelled on those of Perl, as the best de facto standard we have, but a few omissions have been inevitable. Inform's regex matcher must occupy source code less than one hundredth the size of ``pcre``, and it has very little memory. Inform aims to behave exactly like Perl except as follows:
(i) Inform allows angle brackets as synonymous with square brackets, for reasons explained above. This means literal angle brackets have to be escaped as "\<" and "\>" in Inform regular expressions, which is unnecessary in Perl.
1. Inform allows angle brackets as synonymous with square brackets, for reasons explained above. This means literal angle brackets have to be escaped as "\<" and "\>" in Inform regular expressions, which is unnecessary in Perl.
(ii) Inform only has single-line mode, not multiline mode: this removes need for the mode-switches "(?m)" and "(?s)" and the positional markers "\A" and "\Z". Multiline mode is idiosyncratic to Perl and is a messy compromise to do with holding long files of text as single strings, yet treating them as lists of lines at the same time: this would not be sensible for Inform. Similarly, because there is no ambiguity about how line breaks are represented in Inform strings (by a single "\n"), initial newline convention markers such as "(*ANYCRLF)" are unsupported.
2. Inform only has single-line mode, not multiline mode: this removes need for the mode-switches "(?m)" and "(?s)" and the positional markers "\A" and "\Z". Multiline mode is idiosyncratic to Perl and is a messy compromise to do with holding long files of text as single strings, yet treating them as lists of lines at the same time: this would not be sensible for Inform. Similarly, because there is no ambiguity about how line breaks are represented in Inform strings (by a single "\n"), initial newline convention markers such as "(*ANYCRLF)" are unsupported.
(iii) The codes "\a", "\r", "\f", "\e", "\0" for alarm, carriage return, form feed, escape and the zero character are unsupported: none of these can occur in an Inform string.
3. The codes "\a", "\r", "\f", "\e", "\0" for alarm, carriage return, form feed, escape and the zero character are unsupported: none of these can occur in an Inform string.
(iv) Inform does not allow characters to be referred to by character code (whereas Perl allows "\036" for an octal character code, "\x7e" for a hexadecimal one, "\cD" for a control character). This is because we do not want the user to know whether text is internally stored as ZSCII or Unicode.
4. Inform does not allow characters to be referred to by character code (whereas Perl allows "\036" for an octal character code, "\x7e" for a hexadecimal one, "\cD" for a control character). This is because we do not want the user to know whether text is internally stored as ZSCII or Unicode.
(v) Inform's character class "\p" (and its negation "\P") have no equivalent in Perl, and Inform's understanding of "\w" is different. Perl defines this as an upper or lower case English letter, underscore or digit, which is good for programming-language identifiers, but bad for natural language - for instance, "é" is not matched by "\w" in Perl, but unquestionably it appears in words. Inform therefore defines "\w" as the negation of "\s" union "\p".
5. Inform's character class "\p" (and its negation "\P") have no equivalent in Perl, and Inform's understanding of "\w" is different. Perl defines this as an upper or lower case English letter, underscore or digit, which is good for programming-language identifiers, but bad for natural language - for instance, "é" is not matched by "\w" in Perl, but unquestionably it appears in words. Inform therefore defines "\w" as the negation of "\s" union "\p".
(vi) Inform supports only single-digit grouping numbers "\1" to "\9", whereas Perl allows "\10", "\11", ...
6. Inform supports only single-digit grouping numbers "\1" to "\9", whereas Perl allows "\10", "\11", ...
(vii) POSIX named character ranges are not supported. These are only abbreviations in any case, and are not very useful. (Note that the POSIX range "[:punct:]", which is supposedly for punctuation, includes many things we do not want to think of that way - percentage signs, for instance - and so "\p" has a more natural-language-based definition.)
7. POSIX named character ranges are not supported. These are only abbreviations in any case, and are not very useful. (Note that the POSIX range "[:punct:]", which is supposedly for punctuation, includes many things we do not want to think of that way - percentage signs, for instance - and so "\p" has a more natural-language-based definition.)
(viii) Character classes can be used inside ranges, so that "<\da-f>" is legal, but not as ends of contiguous runs, so that "<\d-X>" is not legal. (As reckless as this is, it is legal in Perl.)
8. Character classes can be used inside ranges, so that "<\da-f>" is legal, but not as ends of contiguous runs, so that "<\d-X>" is not legal. (As reckless as this is, it is legal in Perl.)
(ix) For obvious reasons, escapes to Perl code using the notation "(?{...})" are unsupported, and so is the Perl iteration operator "\G".
9. For obvious reasons, escapes to Perl code using the notation "(?{...})" are unsupported, and so is the Perl iteration operator "\G".
(x) Perl's extended mode "(?x)", a lexical arrangement which allows expressions to be expanded out as little computer programs with comments, is unsupported. It would look awful syntax-coloured in the Inform interface and is not a style of coding to be encouraged.
10. Perl's extended mode "(?x)", a lexical arrangement which allows expressions to be expanded out as little computer programs with comments, is unsupported. It would look awful syntax-coloured in the Inform interface and is not a style of coding to be encouraged.
Inform further does not support the Python extension of named subexpression groups, nor the Java extension of the possessive quantifier "++". There was only so much functionality we could squeeze in.
As verification of Inform's matching algorithm, we took the Perl 5 source code's notorious "re-test.txt" set of 961 test cases, removed the 316 using features unsupported by Inform (220 tested multiline mode, for instance), and ran the remaining 645 cases through Inform. It agrees with Perl on 643 of these: the two outstanding are -
As verification of Inform's matching algorithm, we took the Perl 5 source code's notorious "re-test.txt" set of 961 test cases, removed the 316 using features unsupported by Inform (220 tested multiline mode, for instance), and ran the remaining 645 cases through Inform. It agrees with Perl on 643 of these: the two outstanding are
(i) Perl is able to match "^(a\1?){4}$" against "aaaaaa" but Inform is not - Inform's backtracking is not as good when it comes to repetitions of groupings which are recursively defined. (Note that the optional "\1" match refers to the value of the bracketed expression which contains it, so that the interpretation is different on each repetition. Here to match we have to interpret "?" as 0, 0, 1, 0 repeats respectively as we work through the "{4}".)
1. Perl is able to match "^(a\1?){4}$" against "aaaaaa" but Inform is not - Inform's backtracking is not as good when it comes to repetitions of groupings which are recursively defined. (Note that the optional "\1" match refers to the value of the bracketed expression which contains it, so that the interpretation is different on each repetition. Here to match we have to interpret "?" as 0, 0, 1, 0 repeats respectively as we work through the "{4}".)
(ii) Perl matches "((&lt;a-c>)b*?\2)*" against "ababbbcbc" finding the match "ababb", whereas Inform finds the match "ababbbcbc". This is really a difference of opinion about whether the outer asterisk, which is greedy, should be allowed three matches rather than two if to do so requires the inner asterisk, which is not greedy, to eat more than it needs on one of those three matches.
2. Perl matches "((<a-c>)b*?\2)*" against "ababbbcbc" finding the match "ababb", whereas Inform finds the match "ababbbcbc". This is really a difference of opinion about whether the outer asterisk, which is greedy, should be allowed three matches rather than two if to do so requires the inner asterisk, which is not greedy, to eat more than it needs on one of those three matches.
Case 1 is a sacrifice to enable Inform's back-tracking to use less memory. Case 2 simply seems unimportant.
Case (i) is a sacrifice to enable Inform's back-tracking to use less memory. Case (ii) simply seems unimportant.

View file

@ -5,21 +5,25 @@ Index: About the examples
Description: An explanation of the examples in this documentation, and the asterisks attached to them. Click the heading of the example, or the example number, to reveal the text.
For: Untestable
[ZL: .png to be substituted]::
This is the first of about 400 numbered examples. In a few cases, such as this one, they provide a little background information, but almost all demonstrate Inform source text. The techniques demonstrated tend to be included either because they are frequently asked for, or because they show how to achieve some interesting effect.
The same examples are included in <b>both</b> of the books of documentation, but in a different order: in <i>Writing with Inform</i>, they appear near the techniques used to make them work; in <i>The Inform Recipe Book</i>, they are grouped by the effects they provide. For instance, an example called "Do Pass Go", about the throwing of a pair of dice, appears in the "Randomness" section of <i>Writing with Inform</i> and also in the "Dice and Playing Cards" section of <i>The Inform Recipe Book</i>. Clicking the italicised WI and RB buttons at the right-hand side of an example's heading switches between its position in each book.
The same examples are included in **both** of the books of documentation, but in a different order: in *Writing with Inform*, they appear near the techniques used to make them work; in *The Inform Recipe Book*, they are grouped by the effects they provide. For instance, an example called [Do Pass Go], about the throwing of a pair of dice, appears in the [Randomness] section of *Writing with Inform* and also in the [Dice and Playing Cards] section of *The Inform Recipe Book*. Clicking the italicised WI and RB buttons at the right-hand side of an example's heading switches between its position in each book.
Many computing books quote excerpts from programs, but readers have grown wary of them: they are tiresome to type in, and may only be fragments, or may not ever have been tested. The authors of Inform have tried to avoid this. All but two dozen examples contain entire source texts. A single click on the paste icon ///paste.png/// (always placed just left of the double-quoted title) will write the complete source text into the Source panel. All that is then required is to click the Go button, and the example should translate into a working game.
In most cases, typing the single command TEST ME will play through a few moves to show off the effect being demonstrated. (You may find it convenient to create a "scratch" project file for temporary trials like this, clearing all its text and starting again with each new test.)
In most cases, typing the single command ``test me`` will play through a few moves to show off the effect being demonstrated. (You may find it convenient to create a "scratch" project file for temporary trials like this, clearing all its text and starting again with each new test.)
As part of the testing process which verifies a new build of Inform, each example in turn is extracted from this documentation, translated, played through, and the resulting transcript mechanically checked. So the examples may even work as claimed. But the flesh is weak, and there are bound to be glitches. We would welcome reports, so that future editions can be corrected.
Each example is loosely graded by difficulty: if they were exercises in a textbook, the asterisks would indicate how many marks each question scores. As a general rule:
///asterisk.png/// - A simple example, fairly easily guessed.
///asterisk.png/// ///asterisk.png/// - A complicated or surprising example.
///asterisk.png/// ///asterisk.png/// ///asterisk.png/// - An example needing detailed knowledge of many aspects of the system.
///asterisk.png/// ///asterisk.png/// ///asterisk.png/// ///asterisk.png/// - A complete scenario, containing material not necessarily relevant to the topic being demonstrated.
[ZL: better without bullets; first line actually appears mangled; possibly a bug in IFM parsing ...]::
In general, the main text of <i>Writing with Inform</i> tries never to assume knowledge of material which has not yet appeared, but the trickier examples almost always need to break this rule.
- * A simple example, fairly easily guessed.
- ** A complicated or surprising example.
- *** An example needing detailed knowledge of many aspects of the system.
- **** A complete scenario, containing material not necessarily relevant to the topic being demonstrated.
In general, the main text of *Writing with Inform* tries never to assume knowledge of material which has not yet appeared, but the trickier examples almost always need to break this rule.

View file

@ -5,18 +5,19 @@ Index: The Pointy Hat of Liminal Transgression
Description: The Pointy Hat of Liminal Transgression allows its wearer to walk clean through closed doors.
For: Z-Machine
If somebody tries to walk through a closed door, the "can't go through closed doors rule" usually stops them. This is a rule belonging to the "check going" rulebook. These names are fairly explanatory when written out, but hard to remember: fortunately we don't need to remember them, as the Index panel contains a full inventory of the check, carry out and report rules for every action, showing all of their names and the order in which they are checked. (We can also find out which rules are stopping an action by typing the testing command ACTIONS.)
If somebody tries to walk through a closed door, the "can't go through closed doors rule" usually stops them. This is a rule belonging to the "check going" rulebook. These names are fairly explanatory when written out, but hard to remember: fortunately we don't need to remember them, as the Index panel contains a full inventory of the check, carry out and report rules for every action, showing all of their names and the order in which they are checked. (We can also find out which rules are stopping an action by typing the testing command ``actions``.)
Here we make the rule do nothing provided a condition holds:
{*}"Access All Areas"
The extremely difficult door is north of the Standing Room and south of the Room of Walking Upside Down. It is a locked door.
The player is carrying the Pointy Hat of Liminal Transgression. The hat is wearable.
The can't go through closed doors rule does nothing when the Hat is worn.
Test me with "n / wear hat / n".
(The Pointy Hat may be useful in debugging a game, even if it never makes it into the final published work.)

View file

@ -1,20 +1,20 @@
Example: ** Actaeon
Location: Understanding any, understanding rooms
RecipeLocation: Traveling Characters
RecipeLocation: Travelling Characters
Index: FOLLOW command
Description: A FOLLOW command allowing the player to pursue a person who has just left the room.
Description: A ``follow`` command allowing the player to pursue a person who has just left the room.
For: Z-Machine
Suppose we want the player to be able to go after characters who are moving around the map. The trick, of course, is that once characters are gone they are no longer visible to "follow [person]", so we need "follow [any person]" to find them.
{*}"Actaeon"
A person has a room called last location.
Understand "follow [any person]" as following. Understand the commands "chase" and "pursue" as "follow".
Following is an action applying to one visible thing.
Check following:
if the noun is the player, say "Wherever you go, there you are." instead;
if the noun is visible, say "[The noun] is right here." instead;
@ -28,9 +28,9 @@ Here again the best route comes in handy:
let aim be the best route from the location to the destination;
say "(heading [aim])[line break]";
try going aim.
Corinth is a room. Athens is east of Corinth. Epidaurus is southeast of Corinth and east of Mycenae. Mycenae is south of Corinth. Olympia is west of Mycenae. Argos is south of Mycenae. Thebes is northwest of Athens. Pylos is south of Olympia. Sparta is east of Pylos and south of Argos. Delphi is northwest of Thebes.
Artemis is a woman in Corinth.
We do also have to make sure that whenever we move a person from room to room, we record where they were moved from; otherwise, our clever restrictions about whom the player can pursue will not work properly.
@ -38,12 +38,13 @@ We do also have to make sure that whenever we move a person from room to room, w
{**}To move (pawn - a person) tidily to (target - a room):
now the last location of the pawn is the holder of the pawn;
move the pawn to the target.
Every turn:
let current location be the location of Artemis;
let next location be a random room which is adjacent to the current location;
if Artemis is visible, say "Artemis heads to [the next location].";
move Artemis tidily to next location;
if Artemis is visible, say "Artemis arrives from [the current location]."
Test me with "wait / follow artemis / follow artemis / follow artemis".

View file

@ -8,36 +8,36 @@ For: Z-Machine
Here we construct a video camera to track and play back actions:
{*}"The Actor's Studio"
Section 1 - The Video Camera
The video camera is a thing carried by the player.
Table of Videotape
recorded action time stamp
waiting 9:00 AM
with 25 blank rows.
Mode is a kind of value. The modes are idle, recording, and playing back. The video camera has a mode. The video camera is idle.
Understand "play back" as playing back. Instead of switching on the camera, try tuning the camera to recording. Instead of switching off the camera, try tuning the camera to idle.
The description of the video camera is "It is currently [mode]; its available settings are idle, recording, and playing back."
Understand "set [camera] to [a mode]" as tuning it to. Tuning it to is an action applying to one thing and one mode.
Instead of setting the camera to something:
say "The available settings are idle, recording, and playing back."
Check tuning it to:
if the noun is not the camera, say "Only the video camera can be set to [the mode understood]." instead.
Carry out tuning it to:
now the mode of the noun is the mode understood.
Report tuning it to:
say "You set [the noun] to [mode understood]."
After an actor doing something when the video camera is recording:
if the current action is tuning the video camera to recording, make no decision;
if the number of blank rows in the Table of Videotape is greater than zero:
@ -48,7 +48,7 @@ Here we construct a video camera to track and play back actions:
now the video camera is idle;
say "The video camera runs out of recording memory and switches off.";
continue the action.
Every turn when the video camera is playing back:
say "On the camera screen, you see [run paragraph on]";
let starting playback be false;
@ -59,13 +59,14 @@ Here we construct a video camera to track and play back actions:
blank out the whole row;
if starting playback is false, say "only static.";
otherwise say paragraph break.
Section 2 - The Scenario
The Actor's Studio is a room. Lucas is a man in the Actor's Studio. Persuasion rule: persuasion succeeds.
The Studio contains an edible thing called a croissant.
Test me with "set camera to recording / x lucas / lucas, take inventory / lucas, eat croissant / set camera to playing back / z".
Notice that both Lucas' implied taking action (picking up the croissant) and his eating action are recorded on the same move.

View file

@ -2,19 +2,19 @@ Example: *** Aftershock
Location: New activities
RecipeLocation: Televisions and Radios
Index: Radios and other devices active when switched on
Description: Modifying the rules for examining a device so that all devices have some specific behavior when switched on, which is described at various times.
Description: Modifying the rules for examining a device so that all devices have some specific behaviour when switched on, which is described at various times.
For: Z-Machine
The built-in behavior of Inform is to print a line after a device is examined, saying whether the item is on or off. This is often inappropriate, and we could simply turn off that behavior in general by instructing Inform to ignore the "examine devices rule" (see the chapter on rulebooks).
The built-in behaviour of Inform is to print a line after a device is examined, saying whether the item is on or off. This is often inappropriate, and we could simply turn off that behaviour in general by instructing Inform to ignore the "examine devices rule" (see the chapter on [Rulebooks]).
Perhaps, though, we would like continue to have a short passage about the action of any switched on device; we'd just like a little more control over what it says from time to time. And in that case, we might change the rule to give a new activity control over that portion of the description:
{*}"Aftershock"
Section 1 - Showing actions
Showing action of something is an activity.
Rule for showing action of something (called item):
if the item is switched on, say "[The item] is switched on.";
otherwise say "[The item] is switched off."
@ -22,13 +22,13 @@ Perhaps, though, we would like continue to have a short passage about the action
Borrowing from the rulebooks chapter, we can replace the standard "examine devices" rule with something that uses this activity.
{**}The new described devices rule is listed instead of the examine devices rule in the carry out examining rules.
This is the new described devices rule:
if the noun is a device:
carry out the showing action activity with the noun;
now examine text printed is true.
Thus far we have essentially replicated the original behavior, but we've made it possible to write specialized behavior for devices, and to invoke that behavior in other places:
Thus far we have essentially replicated the original behaviour, but we've made it possible to write specialised behaviour for devices, and to invoke that behaviour in other places:
{**}Report switching on something:
say "You flip a switch. ";
@ -37,30 +37,30 @@ Thus far we have essentially replicated the original behavior, but we've made it
This might be useful for an electric lamp kind:
{**}Section 2 - Electric Lamps
An electric lamp is a kind of device.
Rule for showing action of an electric lamp (called item):
if the item is switched on, say "[The item] is lit[if the number of visible lit things is greater than 1], competing with [the list of visible lit things which are not the item][end if].";
otherwise say "[The item] is dark."
Carry out switching on an electric lamp: now the noun is lit. Carry out switching off an electric lamp: now the noun is unlit.
{**}Section 2 - The Scenario
The time of day is 3:47 AM. When play begins, now the right hand status line is "[time of day]".
The Downstairs Hallway is a dark room. "The only room in the house with no furniture and almost nothing on the walls. At times like this you always notice the crack in the plaster, originating near the light fixture and running almost all the way to the wall."
A plastic jug of filtered water is in the Downstairs Hallway. The description is "Five gallons, not that that will last you very long, hot as it has been lately."
The crack is scenery in the Hallway. The description is "No, the ceiling isn't going to fall on you today."
The light fixture is an electric lamp in the Hallway. It is switched on, lit, and scenery. The description is "A plain globe of frosted glass containing the light bulb. Nothing special, and you never think about it except when, as now, you are forced to spend hours in this room."
The flashlight is an electric lamp carried by the player. The description is "A shiny red flashlight." The portable radio is a device carried by the player. The description is "A small battery-operated radio which you received for free with your subscription to US News & World Report. It has served you well through many earthquakes past."
And with our activity, we can override the flashlight's electric lamp behavior with new behavior:
And with our activity, we can override the flashlight's electric lamp behaviour with new behaviour:
{**}Rule for showing action of the flashlight:
if the flashlight is switched on, say "A strong, narrow beam of light shines from the flashlight.";
@ -71,8 +71,9 @@ And with our activity, we can override the flashlight's electric lamp behavior w
{**}Rule for showing action of the radio:
if the radio is switched on, say "Through the static, you pick up pieces of discussion: a 6.7 on the Richter scale, epicenter... something about Topanga... but it crackles out again.";
otherwise say "The radio is silent. You're saving the batteries."
Instead of listening in the presence of the switched on radio:
carry out the showing action activity with the radio instead.
Test me with "examine light / switch light off / switch flashlight on / switch radio on / examine radio / examine flashlight".

View file

@ -8,21 +8,22 @@ For: Z-Machine
The following source is very short and simple, yet it already feels surprisingly interesting in play, because something is going on which the player does not control but must observe. The single scene both starts and finishes.
{*}"Age of Steam"
The Station is a room. "Eynforme Halt is a raised platform fringed with cowslip: a whistle-stop with no more than a signal and a water-tank."
The Flying Scotsman is fixed in place. "The Flying Scotsman, fastest train in the world, is now at a dead standstill."
Train Stop is a scene. Train Stop begins when the player is in the Station for the third turn. Train Stop ends when the time since Train Stop began is 3 minutes.
When Train Stop begins:
now the Flying Scotsman is in the Station;
say "The Flying Scotsman pulls up at the platform, to a billow of steam and hammering."
When Train Stop ends:
now the Flying Scotsman is nowhere;
say "The Flying Scotsman inches away, with a squeal of released brakes, gathering speed invincibly until it disappears around the hill. All is abruptly still once more."
Instead of entering the Flying Scotsman, say "Alas, the [time when Train Stop began] arrival is only to take on water, not to set down or pick up."
Test me with "z / z / z / enter flying scotsman / z / z".

View file

@ -17,23 +17,24 @@ would cause a problem when we tried to call it with
In general, we probably don't need to make our phrase definitions quite so flexible as this, but it's a good idea to account for "a" vs. "the", and for the possibility of using singular and plural forms, especially when writing extensions or other source to be shared.
{*}"Ahem"
To do/follow (chosen rule - a rule) exactly/precisely/just (N - a number) time/times:
repeat with index running from 1 to N:
follow chosen rule.
This is the throat-clearing rule:
say "'Ahem,' says [a random visible person who is not the player]."
After waiting:
do the throat-clearing rule just one time.
Instead of listening:
follow the throat-clearing rule precisely three times.
Instead of smelling:
follow the throat-clearing rule exactly 2 times.
Chateau Marmont is a room. Tom, Jack, Zsa-Zsa, and Wilma-Faye are people in the Chateau. Zsa-Zsa and Wilma-Faye are women.
Test me with "wait / smell / listen".

View file

@ -2,21 +2,21 @@ Example: **** Air Conditioning is Standard
Location: Writing a paragraph about
RecipeLocation: Event Scheduling
Index: Paragraphs of flexible descriptions
Description: Uses "writing a paragraph about" to make person and object descriptions that vary considerably depending on what else is going on in the room, including some randomized NPC interactions with objects or with each other.
Description: Uses "writing a paragraph about" to make person and object descriptions that vary considerably depending on what else is going on in the room, including some randomised NPC interactions with objects or with each other.
For: Z-Machine
{*}"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":
@ -34,21 +34,21 @@ For: Z-Machine
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:
@ -59,17 +59,17 @@ For: Z-Machine
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":
@ -81,34 +81,34 @@ For: Z-Machine
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;
@ -117,17 +117,17 @@ For: Z-Machine
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;
@ -136,19 +136,20 @@ For: Z-Machine
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".

View file

@ -8,21 +8,21 @@ For: Glulx
Seven-digit telephone numbers are too long for Inform to handle when compiling to the Z-Machine, but they will work under Glulx. To have this example succeed, make sure that you have selected the Glulx option in your settings menu.
{*}"Alias"
A telephone is a kind of thing. Understand "phone" or "telephone" as a telephone.
A phone number is a kind of value. 999-9999 specifies a phone number.
Now we borrow some techniques from the Understanding chapter to set up dialing actions:
Now we borrow some techniques from the [Understanding] chapter to set up dialing actions:
{**}Understand "dial [phone number] on [telephone]" as dialing it on. Understand "dial [phone number] on [something]" as dialing it on.
Understand the commands "phone" or "telephone" or "call" as "dial".
Understand "call [text]" or "phone [text]" or "dial [text]" or "telephone [text]" as a mistake ("That's not a number you know.").
Dialing it on is an action applying to one phone number and one thing.
Report dialing it on:
say "You dial [the phone number understood]."
@ -31,27 +31,28 @@ This much is enough to let us dial telephone numbers and have Inform report that
We'll set up a little political espionage scenario from which our player can make calls:
{**}The Senator's Junior Suite is a room. "The Senator appears, unfortunately, to have very precise habits: little in the room has been moved from its usual place; the trash can is empty; the bed has been remade[if the blue paper is unexamined]. There may in fact be nothing to find here[end if]."
The bed is an enterable scenery supporter in the Junior Suite.
The player is wearing a housekeeping uniform and a brunette wig. The player carries a telephone called a Nokia.
Borrowing again from the chapter on Understanding, we might arrange things so that the player knows and can call a few standard numbers with such syntax as CALL HOME:
Borrowing again from the chapter on [Understanding], we might arrange things so that the player knows and can call a few standard numbers with such syntax as ``call home``:
{**}Understand "home" as 555-9200.
And what if we'd like to have the player learn some phone numbers during the game?
{**}A thing can be examined or unexamined. Carry out examining something: now the noun is examined.
Understand "Stephen" as 555-2513 when the blue paper is examined.
This will understand CALL STEPHEN once the paper is examined; before that, the player will just get the "That's not a number you know" response that Inform uses for all attempts to call unknown names.
This will understand ``call stephen`` once the paper is examined; before that, the player will just get the "That's not a number you know" response that Inform uses for all attempts to call unknown names.
We'd better plant this paper for the player to find:
{**}The blue paper is in the drawer. The description of the blue paper is "It reads: 'Call Stephen - 555-2513'."
The drawer is part of the dresser. It is closed and openable. The dresser is in The Senator's Junior Suite. The lamp is on the dresser. The description of the dresser is "The single drawer is [if the drawer is open]open[otherwise]shut[end if]."
Test me with "dial 555-9999 / call home on the telephone / phone the president / call stephen / open drawer / read paper / call stephen / put phone in drawer / close drawer / call stephen".

View file

@ -2,9 +2,11 @@
(The current puzzle difficulty is set to easy.)
Alien Invasion Part 23
An Interactive Fiction
Release 1 / Serial number 160428 / Inform 7 v10.1.0 / D
Release 1 / Serial number 160428 / Inform 7 v10.2.0 / D
Sewer Junction

View file

@ -4,38 +4,38 @@ RecipeLocation: Start-Up Features
Index: Preferences file loaded on replaying
Description: Keeping a preference file that could be loaded by any game in a series.
For: Glulx
ExternalFiles: prefs.glkdata
Suppose that we have a series of games each of which allows the player to select a puzzle difficulty level. When the player plays a new game in the series, we want them to start out by default with the same difficulty level they faced earlier on, so we store this information in a small preferences file, as follows:
{*}"Alien Invasion Part 23"
A difficulty is a kind of value. The difficulties are easy, moderate, hard, and fiendish.
Understand "use [difficulty] puzzles" as selecting difficulty. Selecting difficulty is an action out of world, applying to one difficulty.
Carry out selecting difficulty:
choose row 1 in the Table of Preference Settings;
now challenge level entry is difficulty understood;
say "Puzzles will be [challenge level entry] from now on."
The File of Preferences is called "prefs".
When play begins:
if File of Preferences exists:
read File of Preferences into the Table of Preference Settings;
choose row 1 in the Table of Preference Settings;
say "(The current puzzle difficulty is set to [challenge level entry].)"
choose row 1 in the Table of Preference Settings;
say "(The current puzzle difficulty is set to [challenge level entry].)";
Check quitting the game:
write File of Preferences from the Table of Preference Settings.
Table of Preference Settings
challenge level
easy
The Sewer Junction is a room.
Our preference file is restricted to a single option here for simplicity's sake, but we could keep track of more information -- whether the player preferred verbose or brief room descriptions, screen configurations, and so on.
Our preference file is restricted to a single option here for simplicity's sake, but we could keep track of more information whether the player preferred verbose or brief room descriptions, screen configurations, and so on.
If we were disposed to be somewhat crueler, we could use a similar method to make the player finish each episode of the series in order to "unlock" the next. All we would need to do is store a numerical password in our preferences file when the player finished a given level; the next level would check, say, the Table of Completed Levels for that password, and refuse to play unless the right number were present.

View file

@ -5,23 +5,24 @@ Index: Rooms player is forced to visit in order
Description: Layout where the player is allowed to wander any direction he likes, and the map will arrange itself in order so that he finds the correct "next" location.
For: Z-Machine
Suppose we want to allow the player to wander freely in any direction, but ourselves maintain control over the order in which they encounter the rooms. This sort of effect emphasizes the order of the story-telling over any kind of rigorous simulation of space; on multiple play-throughs, the player might not find all the same rooms in the same locations.
Suppose we want to allow the player to wander freely in any direction, but ourselves maintain control over the order in which they encounter the rooms. This sort of effect emphasises the order of the story-telling over any kind of rigorous simulation of space; on multiple play-throughs, the player might not find all the same rooms in the same locations.
{*}"All Roads Lead to Mars"
Before going a direction (called way) when a room (called next location) is not visited:
let further place be the room the way from the location;
if further place is a room, continue the action;
change the way exit of the location to the next location;
let reverse be the opposite of the way;
change the reverse exit of the next location to the location.
The Open Plain is a room. "A wide-open grassy expanse, from which you could really go any way at all."
The Hilly Place is a room. "The grassland gives way to a somewhat more hilly area, though there is still very little to guide you any particular way."
The Stream is a room. "This is the third place you've been today, and so the stream is welcome. How refreshing!"
Test me with "n / s / e / e".
If we wanted still to be able to find routes between places, we could define a relationship of connection between rooms, which we would add to as we went along.

View file

@ -1,53 +1,54 @@
Example: * Alpaca Farm
Location: New commands for old grammar
RecipeLocation: Clarification and Correction
Index: USE action which divines rational behavior for a wide range of possible nouns
Description: A generic USE action which behaves sensibly with a range of different objects.
Index: USE action which divines rational behaviour for a wide range of possible nouns
Description: A generic ``use`` action which behaves sensibly with a range of different objects.
For: Z-Machine
This example takes the ordering of grammar lines to its logical extreme, sorting the player's input into different categories depending on the kind and condition of the objects mentioned.
{*}"Alpaca Farm"
Understand "use [an edible thing]" as eating.
Understand "use [a wearable thing]" as wearing.
Understand "use [a closed openable container]" as opening. Understand "use [an open openable container]" as closing.
Understand "use [something preferably held] on [a locked lockable thing]" as unlocking it with (with nouns reversed). Understand "use [something preferably held] on [an unlocked lockable thing]" as locking it with (with nouns reversed).
Understand "use [a switched off device]" as switching on.
Understand "use [something]" as using. Using is an action applying to one thing. Carry out using: say "You will have to be more specific about your intentions."
Understand "use [a door]" as opening. Understand "use [an open door]" as entering.
The Llama Pen is a room. North of the Pen is the gate. The gate is a door. North of the gate is the Rocky Path. The brown llama is an animal in the Llama Pen.
Appearance is a kind of value. The appearances are muddy, scruffy, fluffy, and dapper. The brown llama has an appearance. The brown llama is muddy. Before printing the name of the brown llama, say "[appearance] ". Before printing the name of the brown llama while grooming: say "now-[if appearance of the brown llama is less than dapper]merely-[end if]".
A grooming tool is a kind of thing. Understand "use [a grooming tool] on [something]" as grooming it with (with nouns reversed). Grooming it with is an action applying to two things. Understand "groom [something] with [something]" as grooming it with.
Carry out grooming it with:
if the appearance of the noun is less than dapper, now the appearance of the noun is the appearance after the appearance of the noun.
Report grooming it with:
say "You attend diligently to the appearance and hygiene of [the noun]."
Instead of using a grooming tool in the presence of the brown llama:
try grooming the brown llama with the noun.
The player carries some nail nippers, a slicker brush, and an apple. The apple is edible. The brush and the nippers are grooming tools. The player wears a sombrero.
The description of the nail nippers is "Ten inches long, to give you the necessary leverage to cut tough llama toenails. It still helps to soften them up by making the llama stand in a bucket of water first, though."
The description of the slicker brush is "Fine, angled soft bristles set into a broad back, perfect for removing mud from the coat of a long-woolled llama."
The industrial-strength blower is a fixed in place device in the Llama Pen. "Attached to the nearest wall, on its own movable boom, is an industrial-strength blower for doing llama hair."
Understand "use [switched off blower]" as switching on. Understand "use [switched on blower] on [brown llama]" as grooming it with (with nouns reversed). Instead of using the blower in the presence of the brown llama, try grooming the brown llama with the blower.
Test me with "use gate / use blower / use nippers / use brush / use apple / remove sombrero / use sombrero".
Whether we actually want a USE action is a subject of some theoretical debate in the IF community. On the one hand, it helps avoid guess-the-verb problems where the player cannot figure out what term to use in order to express a fairly simple idea. On the other, it encourages the player to think that all items have one and exactly one use, rather than getting them to consider the range of possibilities that arise from having a complex vocabulary.
Whether we actually want a ``use`` action is a subject of some theoretical debate in the IF community. On the one hand, it helps avoid guess-the-verb problems where the player cannot figure out what term to use in order to express a fairly simple idea. On the other, it encourages the player to think that all items have one and exactly one use, rather than getting them to consider the range of possibilities that arise from having a complex vocabulary.

View file

@ -8,17 +8,18 @@ For: Z-Machine
Sometimes we want to let testers of a game insert their own comments during a transcript, without those comments wasting turns of the game or producing lengthy or inappropriate parser errors. Many testers have a habit of prefacing comments with a punctuation mark, so let's say that we'd like to catch any command that starts with any punctuation at all:
{*}"Alpha"
When play begins:
say "Hi, Larry! Thanks for testing my game!!"
Unimplemented Room is a room. "Room description goes here..."
The scary troll is a man in Unimplemented Room.
After reading a command (this is the ignore beta-comments rule):
if the player's command matches the regular expression "^\p":
say "(Noted.)";
reject the player's command.
Test me with "x me / x troll / !this game is a bit dull so far / kiss troll / ? does this troll do anything? / :yawn".

View file

@ -2,20 +2,21 @@ Example: * Anchorite
Location: New commands for old grammar
RecipeLocation: Entering and Exiting, Sitting and Standing
Index: GET DOWN and DOWN understood as EXIT
Description: By default, Inform understands GET OFF, GET UP, or GET OUT when the player is sitting or standing on an enterable object. We might also want to add GET DOWN and DOWN as exit commands, though.
Description: By default, Inform understands ``get off``, ``get up``, or ``get out`` when the player is sitting or standing on an enterable object. We might also want to add ``get down`` and ``down`` as exit commands, though.
For: Z-Machine
With GET DOWN, we can replace the whole command, which will not interfere with the normal function of the TAKE verb, or allow the player to attempt to GET any other directions:
With ``get down``, we can replace the whole command, which will not interfere with the normal function of the ``take`` verb, or allow the player to attempt to ``get`` any other directions:
{*}"Anchorite"
The Solitary Place is a room. "A glittering, shimmering desert without either locusts or honey." The pillar is an enterable supporter in the Solitary Place. "The broken pillar is short enough to climb and sit on." The description of the pillar is "Once it was a monument: a long frieze of battles and lion-hunts spirals up the side, in honor of an earthly king." The player is on the pillar.
Understand "get down" as exiting.
This doesn't cover the case where the player just types "DOWN", and we don't want to preempt the normal operation of the GO action here. So instead of writing a new understand instruction, we might catch this one at the action-processing level:
This doesn't cover the case where the player just types ``down``, and we don't want to preempt the normal operation of the ``go`` action here. So instead of writing a new understand instruction, we might catch this one at the action-processing level:
{**}Instead of going down when the player is on a supporter:
try exiting.
Test me with "down / enter pillar / get down / down / get down".

View file

@ -6,17 +6,18 @@ Description: A child who after a certain period in the car starts asking annoyin
For: Z-Machine
{*}"Annoyotron Jr"
The Minivan is a room. The Open Road is outside from the Minivan. Pete is a man in the Minivan. "Pete [if the player has been in the Minivan for 3 turns]is starting to look bored[otherwise]is playing with his travel activity book[end if]."
Every turn:
if the player has been in the Minivan for 5 turns, say "'Are we there [if saying no]now?'[otherwise]yet?' asks Pete.[end if]"
Instead of saying no:
say "'Oh,' says Pete. There is a blessed, momentary silence."
Instead of going to the Open Road:
say "You leap to your death.";
end the story.
Test me with "z / z / look / g / g / g / no / z / z / z / no / z / out".

View file

@ -5,7 +5,7 @@ Index: Varying room description text
Description: What are activities good for? Controlling output when we want the same action to be able to produce very flexible text depending on the state of the world -- in this case, making highly variable room description and object description text.
For: Z-Machine
Suppose we want to create an object -- or maybe even a series of objects -- that warp the player's perception of every room description and object around them.
Suppose we want to create an object or maybe even a series of objects that warp the player's perception of every room description and object around them.
We've already seen some ways to create variations in text. For instance, we could make a room description with if substitutions in it, like so:
@ -16,7 +16,7 @@ That works fine if we have one or two variations we want to add; it's not so goo
A slightly more flexible method is to use a substitution that calls out to a say phrase, like this:
The Kitchen is a room. "[kitchen-description]"
To say kitchen-description:
if the player is wearing the sunglasses:
say "Are ants coming out of the sink? No, probably no.";
@ -41,26 +41,28 @@ Inform's usual rule-ranking also means that more-specific rules will override le
Rule for printing the room-description of the Kitchen when the player wears the sunglasses:
say "Are ants coming out of the sink? No, probably not."
and have that rule override the behavior of the activity just in the kitchen. Meanwhile, our base room descriptions remain straightforward and uncluttered by if-statements.
and have that rule override the behaviour of the activity just in the kitchen. Meanwhile, our base room descriptions remain straightforward and uncluttered by if-statements.
Several other examples will show how to hook activities into existing actions: Crusoe goes into detail about how how to make the descriptions of things more variable, and Aftershock demonstrates activities for describing the behavior of switchable devices.
Several other examples will show how to hook activities into existing actions: [Crusoe] goes into detail about how how to make the descriptions of things more variable, and [Aftershock] demonstrates activities for describing the behaviour of switchable devices.
Here, we preview all of those methods, just to get a sense of how they work and why they might be useful in controlling a game. Subsequent chapters go into more detail about the syntax of creating activities and the list of activities that are already defined by Inform.
{*}"Ant-Sensitive Sunglasses"
Part 1 - Procedure
To add a new activity to an existing Inform rule, we need to do three things:
1) Define our new activity.
2) Give a basic rule that says what is supposed to happen when that activity occurs, as in "Rule for..."
3) Replace the existing rule in Inform's rulebooks with a new one that calls on our activity.
Here we do this with examining:
{**}Section 1 - Item Description
Printing the description of something is an activity.
Now, by default, we want to print the description property; we just want the option to write some extra rules overriding that property. So we tell Inform that our most basic rule for printing the description of something is just to give that description text:
@ -74,7 +76,7 @@ Now, by default, we want to print the description property; we just want the opt
Next, we need the standard examining rule to look at our printing-the-description activity:
{**}The activity-based examining rule is listed instead of the standard examining rule in the carry out examining rules.
This is the activity-based examining rule:
carry out the printing the description activity with the noun;
rule succeeds.
@ -82,15 +84,15 @@ Next, we need the standard examining rule to look at our printing-the-descriptio
Now we do the same thing to room descriptions.
{**}Section 2 - Room Description
Printing the room-description of something is an activity.
Rule for printing the room-description of a room (called item):
if the description of the item is not "":
say "[description of item][paragraph break]";
otherwise:
do nothing instead.
The activity-based room description body text rule is listed instead of the room description body text rule in the carry out looking rules.
Our replacement rule this time around is a little bit trickier just because the rule that we're replacing is a complicated one: describing a room already checks to see whether there's light to see by, whether the player has turned off room descriptions when entering a room for the second time, and whether the player character is (say) inside a closed box they can't see out of.
@ -113,59 +115,60 @@ But all of those details are re-copied from the standard rules, and the importan
if set to sometimes abbreviated room descriptions and abbreviated form
allowed is true and the location is visited, continue the action;
carry out the printing the room-description activity with the location.
Section 3 - Device Description
Showing action of something is an activity.
Rule for showing action of something (called item):
if the item is switched on, say "[The item] is switched on.";
otherwise say "[The item] is switched off."
The activity-based described devices rule is listed instead of the examine devices rule in the carry out examining rules.
This is the activity-based described devices rule:
if the noun is a device:
carry out the showing action activity with the noun;
now examine text printed is true.
Report switching on something:
say "You flip a switch. ";
carry out the showing action activity with the noun instead.
Part 2 - Scenario
The Kitchen is a room. "A small kitchen tucked into a corner of the vacation house. There is storage space for five or six cups, a sink, a two-ring stove; nothing else to speak of."
The microwave is a device in the Kitchen.
South of the Kitchen is the Living Area. The description of the Living area is "A whitewashed living/dining/reclining area in what used to be a shepherd's stone hut, but now costs vacationers 600 euros a week. It offers no mod cons, only a straight view of the Mediterranean and a wobbly writing table."
Rule for printing the room-description of a room when the player wears the sunglasses:
say "The walls look like they're covered with ants. Just a coincidence, I'm sure[antsy]."
Rule for printing the room-description of the Kitchen when the player wears the sunglasses:
say "Are ants coming out of the sink? No, probably not[antsy]."
Rule for printing the description of something (called the item) when the player wears the sunglasses:
say "[The item] [are] [one of]ant-colored[or]ant-legged[or]covered in ants[at random][antsy]."
Rule for showing action of the microwave:
say "The microwave hums meaningfully to itself."
Rule for showing action of the microwave when the player wears the sunglasses:
say "The microwave hums as though inhabited by a billion ants[antsy]."
The player carries sunglasses of freakiness and an apple. The apple is edible. The sunglasses are wearable.
ant-paranoia is a number that varies.
To say antsy:
increase ant-paranoia by 1;
Every turn:
if the ant-paranoia is greater than 3:
say "Augh! AUUUGH! GET THEM OFF--";
end the story saying "You have lost your mind."
Test me with "look / turn on microwave / turn off microwave / x apple / x sunglasses / s / wear sunglasses / look / x apple / n / turn on microwave".

View file

@ -6,33 +6,34 @@ Description: The player carries a gizmo that is able to record actions performed
For: Z-Machine
{*}"Anteaters"
A book is a kind of thing. Understand "book" as a book. A book has a table name called the contents.
Report consulting a book about:
say "You flip through [the noun], but find no reference to [the topic understood]." instead.
Instead of consulting a book about a topic listed in the contents of the noun:
say "[reply entry][paragraph break]".
The Guide to Desert Fauna is a book. The contents of the Guide is the Table of Critters.
Table of Critters
topic reply
"spines" "You flip through the Guide for a while and eventually realise that spines are flora, not fauna."
"anteater colonies" "The giant anteater, which grows to six feet in size and can kill a jaguar, is a solitary animal, found in many habitats, including grasslands, deciduous forests and rainforests. It does not form colonies. That's ants. They're actually quite easy to tell apart."
Death Valley is a room. The Guide is in the Valley.
The gizmo is in Death Valley. The gizmo has an action called idea. The description of the gizmo is "The gizmo is hard to describe, but it projects an idea of [idea]."
Before when the player carries the gizmo and the idea of the gizmo is waiting:
say "[The gizmo] eagerly soaks up the whole idea of [the current action].";
now the idea of the gizmo is the current action.
After dropping the gizmo:
say "The percussion of the fall seems to have shaken the gizmo's idea loose! There's nothing for it now but [idea of the gizmo].";
try the idea of the gizmo;
now the idea of the gizmo is waiting.
Test me with "get guide / look up spines in guide / x gizmo / get gizmo / i / x gizmo / drop gizmo / get gizmo / look up anteater colonies in guide / x gizmo / drop gizmo".

View file

@ -7,23 +7,29 @@ For: Z-Machine
Inform by default detects whether two objects can be disambiguated by any vocabulary available to the player. If so, it asks a question; if not, it picks one of the identical objects at random.
Generally this produces good behavior. Occasionally, though, two objects have some distinguishing characteristic that doesn't appear in the object name. For instance, suppose we've created a class of apples that can be told apart depending on whether they've been bitten or not:
Generally this produces good behaviour. Occasionally, though, two objects have some distinguishing characteristic that doesn't appear in the object name. For instance, suppose we've created a class of apples that can be told apart depending on whether they've been bitten or not:
An apple is a kind of thing. Consumption is a kind of value. The consumptions are pristine and bitten. An apple has a consumption. The description of an apple is "It is [consumption]."
Understand the consumption property as describing an apple.
The player can meaningfully type
>EAT BITTEN APPLE
``` transcript
>eat bitten apple
```
or
>EAT PRISTINE APPLE
``` transcript
>eat pristine apple
```
but if they type
>EAT APPLE
``` transcript
>eat apple
```
Inform will, annoyingly, ask
@ -32,36 +38,37 @@ Inform will, annoyingly, ask
This gives the player no indication of why Inform is making a distinction. So here we add a special "printing the name" rule to get around that situation:
{*}"Apples"
Orchard is a room.
An apple is a kind of thing. Consumption is a kind of value. The consumptions are pristine and bitten. An apple has a consumption. The description of an apple is "It is [consumption]."
Understand the consumption property as describing an apple.
Before printing the name of an apple while asking which do you mean: say "[consumption] ". Before printing the plural name of an apple while asking which do you mean: say "[consumption] ".
The player carries three apples.
Instead of eating a pristine apple (called the fruit):
say "You take a satisfying bite.";
now the fruit is bitten.
Instead of eating a bitten apple (called the fruit):
say "You consume the apple entirely.";
now the fruit is nowhere.
Inform will also separate the bitten from the pristine apples in inventory listings and room descriptions, even though it's not clear why; we can improve on that behavior thus:
Inform will also separate the bitten from the pristine apples in inventory listings and room descriptions, even though it's not clear why; we can improve on that behaviour thus:
{**}Before listing contents: group apples together.
Rule for grouping together an apple (called target):
let source be the holder of the target;
say "[number of apples held by the source in words] apple[s], some bitten".
Before printing the plural name of an apple (called target):
let source be the holder of the target;
if every apple held by the source is bitten, say "bitten ";
if every apple held by the source is pristine, say "pristine ".
Test me with "i / eat apple / i / eat apple / pristine / i / eat apple / pristine / i".

View file

@ -8,13 +8,14 @@ For: Z-Machine
Named properties are not the only kind that Inform is able to understand referring to an object. We can also use unit and number properties to distinguish things from one another, as here, where televisions have aspect ratios:
{*}"Aspect"
An aspect ratio is a kind of value. 16:9 specifies an aspect ratio.
A television is a kind of device. A television has an aspect ratio. Understand the aspect ratio property as referring to a television. Understand "European standard" as 16:9.
The Office is a room.
The widescreen TV is a television in the Office. The fifties TV is a television in the Office. The widescreen TV is 16:9. The fifties TV is 4:3.
Test me with "examine european standard tv / x 16:9 tv / x 4:3 tv".

View file

@ -1,15 +1,16 @@
Example: * Bad Hair Day
Location: Instead rules
RecipeLocation: Characterization
RecipeLocation: Characterisation
Index: Examining the player
Description: Change the player's appearance in response to EXAMINE ME.
Description: Change the player's appearance in response to ``examine me``.
For: Z-Machine
{*}"Bad Hair Day"
The Foyer is a room. "A mirror hangs over the table, tempting you to check your appearance before going in with all the others."
Instead of examining the player:
say "Oh, stop fussing. You look fine."
Test me with "examine me".

View file

@ -8,11 +8,11 @@ For: Z-Machine
If our map is largely or entirely set inside a single building, we might want to produce something that resembles a floorplan. It's possible to do this with a little tweaking, like so:
{*}"Baedeker"
Dome is a room. North of Dome is North Chapel. South of the Dome is South Chapel. West of the Dome is Western End. Quiet Corner is northwest of the Dome, north of Western End, and west of North Chapel. Loud Corner is east of North Chapel, northeast of Dome, and north of Eastern End. Eastern End is north of Dim Corner and east of Dome. Dim Corner is southeast of Dome and east of South Chapel. Ruined Corner is southwest of Dome, west of South Chapel, and south of Western End.
The church door is east of Eastern End and west of the Courtyard. The church door is a door.
Index map with
room-shape set to "square" and
room-size set to 60 and
@ -29,4 +29,4 @@ If our map is largely or entirely set inside a single building, we might want to
Now we have a map made of white lines and boxes over a white background, which is not very exciting. If, however, we put a layer of black under this and slightly adjust the room shapes (using an image editor such as Adobe Illustrator), we can produce something that plausibly resembles a floorplan or museum map, like so:
///Sophia.jpg///
![Sophia](doc_images/Sophia.jpg)

View file

@ -8,14 +8,14 @@ For: Z-Machine
Sometimes it is more sensible to describe numbers roughly than in exact terms. For instance, we might want to have our player perceive "many people" rather than "forty-two people" on entering a room. To achieve this, we might write our own "to say" phrase.
{*}"Ballpark"
To say (count - a number) in round numbers:
repeat through the Table of Numerical Approximation:
if count is less than threshold entry:
say "[approximation entry]";
rule succeeds.
Phrases will be explained more thoroughly in a later chapter, but as we have already seen in the examples, we can make a "To say..." phrase that will allow us to create our own text substitutions. In this case, we are going to replace the specific number with a vaguer one chosen from a chart, so:
[Phrases] will be explained more thoroughly in a later chapter, but as we have already seen in the examples, we can make a "To say..." phrase that will allow us to create our own text substitutions. In this case, we are going to replace the specific number with a vaguer one chosen from a chart, so:
{**}Table of Numerical Approximation
threshold approximation
@ -30,9 +30,10 @@ Phrases will be explained more thoroughly in a later chapter, but as we have alr
The idea here is that we will work our way through the table until we hit a line where the threshold number is higher than the number we want to express, and then print that output: so if we have less than one item, we'll print "no"; if we have more than none but less than two, we'll print "one"; if we have less than three, we'll print "a couple of"; if we have three, four, or five (but not six), we'll print "a few."
{**}A room has a number called the population. The population of a room is usually 0. The description of a room is usually "You observe [population of the location in round numbers] [if population of the location is 1]person [otherwise]people [end if]here.".
The Stadium is a room. The Hot Dog Stand is west of the Stadium. The Women's Restroom is south of the Stadium.
The population of the Stadium is 500. The population of the Hot Dog Stand is 3. The population of the Restroom is 750.
Test me with "w / e / s".

View file

@ -5,21 +5,23 @@ Index: Allowing the player to describe the main character before starting play
Description: Letting the player pick a gender (or perhaps other characteristics) before starting play.
For: Z-Machine
[ZL: This example should either be cut or should accept "neither" ]::
The "reading a command" activity is rather advanced; for the moment, what we need to understand is that we're intervening in commands at the start of play and insisting that the player's first instruction to the game consist of a choice of gender. After that point, the gender will be set and play will proceed as normal.
In order to do the parsing, we define gender as a kind of value, and give several alternate names to each gender.
{*}"Baritone, Bass"
Getting Started is a room.
Gender is a kind of value. The genders are masculine, feminine, and unknown. Understand "male" or "man" or "M" as masculine. Understand "female" or "woman" or "F" as feminine.
A person has a gender. The gender of the player is unknown.
When play begins:
now the command prompt is "Please choose a gender for your character. >".
After reading a command when the gender of the player is unknown:
if the player's command includes "[gender]":
now the gender of the player is the gender understood;
@ -35,12 +37,12 @@ In order to do the parsing, we define gender as a kind of value, and give severa
otherwise:
say "Sorry, we're not ready to go on yet. [run paragraph on]";
reject the player's command.
Sandy Beach is a room.
Instead of examining the player when the player is female:
say "Congratulations, you are a girl!"
Instead of examining the player when the player is male:
say "Congratulations, you are a boy!"
@ -52,3 +54,4 @@ and use a "construction stage" variable to keep track of the current stage of ch
After reading a command when the current construction stage is choosing a vocal range:
...

View file

@ -5,22 +5,22 @@ Index: GIVE action for other characters
Description: Allowing characters other than the player to give objects to one another, accounting for the possibility that some items may not be desired by the intended recipients.
For: Z-Machine
By default, if we make no modifications, telling one player to give something to another will fail, even if persuasion succeeds. This is because the default behavior of the GIVE command is interrupted by the "block giving rule" -- since in many cases we do not want people to exchange objects freely.
By default, if we make no modifications, telling one player to give something to another will fail, even if persuasion succeeds. This is because the default behaviour of the ``give`` command is interrupted by the "block giving rule" since in many cases we do not want people to exchange objects freely.
However, suppose that we do want characters to be able to exchange articles freely: we allow persuasion to succeed and turn off the "block giving rule".
{*}"Barter Barter"
The block giving rule is not listed in the check giving it to rules.
A persuasion rule for asking people to try giving: persuasion succeeds.
The Trading Post is a room.
Meriwether Lewis is a man in the Trading Post. He carries a fluffy handmade quilt and a bag of beans. The beans are edible.
William Clark is a man in the Trading Post. He carries leather slippers, a journal, and a loaf of bread. The bread is edible. The slippers are wearable.
Instead of examining someone:
say "[The noun] is carrying [the list of things carried by the noun]."
@ -28,17 +28,18 @@ And now we might want to implement a way to keep track of whether the recipient
{**}Check someone trying giving something to someone (this is the sneering refusal rule):
if the second noun dislikes the noun, stop the action.
Unsuccessful attempt by someone trying doing something:
if the reason the action failed is the sneering refusal rule, say "'Would you care for [the noun]?' [the person asked] asks solicitously of [the second noun].
But [the second noun] refuses [the noun] disdainfully.";
otherwise say "[The person asked] just appears bewildered by this improbable instruction."
Distaste relates one person to various things. The verb to dislike means the distaste relation.
Clark dislikes the beans. Lewis dislikes the bread.
Since we've defined this as a relation, we could change what the characters like and dislike during the course of the game, freely; for instance, characters might grow hungry and suddenly like all the edible articles.
{**}Test me with "x lewis / x clark / clark, give the slippers to lewis / clark, give the bread to lewis".

View file

@ -5,18 +5,18 @@ Index: Death message replaced
Description: Completely replacing the endgame text and stopping the game without giving the player a chance to restart or restore.
For: Z-Machine
Occasionally, a piece of IF is sufficiently serious that it feels bathetic to offer the player the usual restore-restart-undo-quit options at the end. The following would replace "*** You have died ***" with a centered epitaph, then quit the game when the player hits a key.
Occasionally, a piece of IF is sufficiently serious that it feels bathetic to offer the player the usual restore-restart-undo-quit options at the end. The following would replace "\*\*\* You have died \*\*\*" with a centered epitaph, then quit the game when the player hits a key.
This example relies on a standard extension to avoid any fancy programming:
{*}"Battle of Ridgefield"
Include Basic Screen Effects by Emily Short.
Ridgefield is a room.
Instead of doing something when the turn count is greater than 1: say "Alas, you no longer have the strength."; end the story.
Rule for printing the player's obituary:
say paragraph break;
center "In defense of American Independence";
@ -29,3 +29,4 @@ This example relies on a standard extension to avoid any fancy programming:
wait for any key;
stop game abruptly;
rule succeeds.

View file

@ -10,9 +10,9 @@ The map-maker can be used in quite versatile ways, in short; though the default
In many previous examples, we have sent hapless deities wandering around a map of Greece; we might like to chart that for ourselves, in a semi-realistic fashion. So:
{*}"Bay Leaves and Honey Wine"
Corinth is a room. Athens is east of Corinth. Epidaurus is southeast of Corinth and east of Mycenae. Mycenae is south of Corinth. Olympia is west of Mycenae. Argos is south of Mycenae. Thebes is northwest of Athens. Pylos is south of Olympia. Sparta is east of Pylos and south of Argos. Delphi is northwest of Thebes.
Index map with an EPS file and
room-size set to 8,
map-outline set to off,
@ -28,4 +28,4 @@ This produces a line-and-dot map, where the names of rooms do not appear inside
We can then superimpose this on a vector map of Greece and tweak the exact positions of cities a little by hand (in Adobe Illustrator, as it happens, but other programs would also allow this level of editing). The result:
///Greece.jpg///
![Greece](doc_images/Greece.jpg)

View file

@ -7,18 +7,18 @@ For: Z-Machine
Suppose we have our player, a detective, searching for evidence; we don't want them to be able to use this evidence until they have performed the action that reveals it, but after that it should be visible in the room when they look.
A simple way to do this is to start the object -- an envelope, in this scenario -- out of play, and only move it into the location when the player looks for it:
A simple way to do this is to start the object an envelope, in this scenario out of play, and only move it into the location when the player looks for it:
{*}"Beachfront"
The Stuffy Office is a room. "The windows are closed, making the sultry air even more unbearable. A narrow slice of Caribbean blue is visible between the scuba gear rental shop and the recreated 17th century pirate tavern.
The office is cheerfully furnished with wicker chairs and white curtains, but the tropical decorating scheme stopped at the desk, which is heavy oak and absolutely covered with papers."
The heavy oak desk is a supporter in the stuffy office. It is scenery. Understand "paperwork" as the desk.
The creamy envelope is an openable container. The description is "There is no return address on the outside of the envelope, just the address of the Doctor's office -- but the legs of the capital A are rubbed down in a characteristic way, and the top of every R is open. There's no question that it comes from the same typewriter as the blackmail note." In the envelope is a letter. The envelope can be found or lost. The envelope is lost.
Instead of searching the desk when the envelope is lost:
now the envelope is found;
say "You rifle through the piles of bills and notices; invitations to conventions; advertisements for high-end prescription drugs; pink carbon sheets bearing patients['] names and medical identification numbers in spidery, elderly handwriting. Almost at the bottom of the heap, you find what you were looking for: a creamy envelope with the address typed.";
@ -32,3 +32,4 @@ Here we've changed the property of the envelope to keep track of the fact that i
Notice that we have two rules that apply to "searching the desk", but one of them has a more specific set of parameters ("when the envelope is lost"). This means that Inform will consult that rule first and use it if it applies; it will only carry out our plain vanilla "instead of searching the desk" rule when the more restricted rule is not relevant.
{**}Test me with "x envelope / x desk / search desk / look / get envelope / x envelope".

View file

@ -1,8 +1,8 @@
Example: * Bee Chambers
Location: Now...
RecipeLocation: Map
Index: Maze with randomized room links
Description: A maze with directions between rooms randomized at the start of play.
Index: Maze with randomised room links
Description: A maze with directions between rooms randomised at the start of play.
For: Z-Machine
Mazes are a traditional element of interactive fiction, often consisting of apparently identical rooms with exits that do not work reciprocally and which cause confusion.
@ -10,11 +10,11 @@ Mazes are a traditional element of interactive fiction, often consisting of appa
The methods of mapping mazes are now fairly well understood and mazes themselves tend to be regarded as tiresome rather than enjoyable by a large portion of the playing audience. However, if we did want to ignore the common wisdom and create a maze, randomly generated at the start of play, here would be one way to go about it:
{*}"Maze of Gloom"
A Bee Chamber is a kind of room. The printed name of a Bee Chamber is usually "Hexagonal Room". The description of a Bee Chamber is usually "Waxy, translucent walls surround you on six sides; the floor and ceiling are made of the same material, gently uneven. There are exits in every direction, cut into the faces or the corners."
Bee1, Bee2, Bee3, Bee4, Bee5, Bee6, Bee7, Bee8, Bee9, and Bee10 are Bee Chambers.
When play begins:
now right hand status line is "[number of visited rooms]/[number of rooms]";
repeat with place running through Bee Chambers:
@ -30,5 +30,6 @@ The methods of mapping mazes are now fairly well understood and mazes themselves
now a random Bee Chamber is mapped below place;
now a random Bee Chamber is mapped inside place;
now a random Bee Chamber is mapped outside place.
Test me with "in / out / up / down / n / ne / nw / e / w / sw / se / s".

View file

@ -2,35 +2,38 @@ Example: ** Beekeeper's Apprentice
Location: Line breaks and paragraph breaks
RecipeLocation: Examining
Index: Examining everything at once
Description: Making the SEARCH command examine all the scenery in the current location.
Description: Making the ``search`` command examine all the scenery in the current location.
For: Z-Machine
We have to create a suitable action and say what it does, and to repeat what we do through all the scenery items. That needs material from subsequent chapters, but is quite ordinary Inform all the same:
{*}"Beekeeper's Apprentice"
Studying the vicinity is an action applying to nothing.
Report studying the vicinity:
if the location does not contain something which is scenery:
say "There's little of interest in the [location]." instead;
repeat with point of interest running through scenery in the location:
say "[point of interest]: [run paragraph on]";
try examining the point of interest.
Understand "search" as studying the vicinity.
The Yard is a room.
The hive and the honey are scenery things in the Yard. The description of the hive is "The honeycombed hive is all around you, thrumming with life." The description of the honey is "Wax-sealed honey has been cached in many of the hexagonal nurseries."
Test me with "search".
The reason for this example is to show the use of saying "[run paragraph on]". It means we have output such as:
The reason for this example is to show the use of saying `"[run paragraph on]"`. It means we have output such as:
>search
hive: The honeycombed hive is all around you, thrumming with life.
``` transcript
>search
hive: The honeycombed hive is all around you, thrumming with life.
honey: Wax-sealed honey has been cached in many of the hexagonal nurseries.
honey: Wax-sealed honey has been cached in many of the hexagonal nurseries.
```
Without the running on, the prompts "hive:" and "honey:" would be separated from the descriptions following them, which would look a little odd.

View file

@ -10,30 +10,30 @@ Let's say that we're implementing a particularly irrational and volatile charact
Moreover, her responses are divided between successful and failing outcomes, where success indicates that she's not too upset and failure means that she is distraught; we use this to determine how the rest of the room reacts.
{*}"Being Peter"
The Drawing Room is a room. "The company is assembled here for champagne. Most of it, anyway: Mary is on the phone to her babysitter, Roger is keeping her anxious company, and Carol doesn't drink. But everyone else."
Maggie is a woman in the Drawing Room.
The player wears a top hat.
Quizzing it about is an action applying to one thing and one visible thing. Understand "ask [someone] about [any thing]" as quizzing it about.
Instead of quizzing Maggie about something:
follow the attitude rules;
say "Everyone waits to see what the reaction will be: [outcome of the rulebook].";
if rule succeeded, say "There is general relief.";
otherwise say "Everyone is pointedly silent."
The attitude rules are a rulebook. The attitude rules have outcomes she stays calm (no outcome - default), she gets angry (failure), she has a stroke (failure), she is only mildly annoyed (success), and she is elated (success).
Here we want Inform to consult every appropriate attitude rule until it gets to some answer; if an attitude rule does not provide a result, the default 'no outcome' will mean that we go on to the next rule, and so on.
{**}A subject is a kind of thing. income, love life, and children are subjects.
An attitude rule for quizzing Maggie about love life:
she gets angry.
An attitude rule:
if the player wears the top hat, she gets angry.
@ -41,7 +41,8 @@ Now, as we saw, the 'no outcome' result will never be returned and printed as Ma
{**}The last attitude rule:
she is only mildly annoyed.
Test me with "ask maggie about love / ask maggie about income / take off hat / ask maggie about income".
There are plenty of contexts where we might want named outcomes for clarity but not want to print the results literally afterward.

View file

@ -6,11 +6,11 @@ Description: A kind for jackets, which always includes a container called a pock
For: Z-Machine
{*}"Being Prepared"
A jacket is a kind of thing. A jacket is always wearable.
A pocket is a kind of container. A pocket is part of every jacket. The carrying capacity of a pocket is always 2.
After examining a jacket:
let target be a random pocket which is part of the noun;
say "[The target] contains [a list of things in the target]."
@ -20,15 +20,16 @@ Now we've created the rules that will govern any specific jackets we might happe
Next we might want to create the environment and an actual example of the jacket kind:
{**}Tent is a room. "A dome made of two flexible rods and a lot of bright green ripstop nylon. It bills itself as a one-man tent, but you'd call it a two-dwarf tent: there is no way to arrange yourself on its square floor so that you can stretch out completely."
The hoodie is a jacket. "Your hoodie is balled up in the corner." The description of the hoodie is "Both elbows are stained from yesterday's entrenching project."
The hoodie's pocket contains a Swiss army knife and a folded map. The hoodie is in the Tent.
Notice that, since Inform has created a pocket for the hoodie, we can now refer to it by name in our source, giving it any additional properties we need to define. Here we simply put a few items into it.
{**}The player wears a whistle. The description of the whistle is "To frighten bears."
Test me with "x hoodie / get hoodie / get knife / get map / i / put hoodie in pocket / put whistle in pocket / put map in pocket / put knife in pocket / i".
Notice that Inform automatically refuses to put the hoodie into its own pocket: as a default, a container cannot contain something of which it is itself a part.

View file

@ -6,9 +6,10 @@ Description: You can see a bat, a bell, some woodworm, William Snelson, the sext
For: Z-Machine
{*}"Belfry"
The Belfry is a room. A bat is in the Belfry. The bell is in the Belfry. Some woodworm are in the Belfry. A man called William Snelson is in the Belfry. A woman called the sexton's wife is in the Belfry. A man called a bellringer is in the Belfry.
In the Belfry is a man called the vicar. The indefinite article of the vicar is "your local".
Test me with "look".

View file

@ -8,32 +8,33 @@ For: Z-Machine
The standard world model provides for the idea of containers and supporters, but this is not the only way that objects can relate to one another in the real world. Here we try adding the idea of concealment beneath another object:
{*}"Beneath the Surface"
Section 1 - In Which our Terms are Defined
Underlying relates various things to one thing. The verb to underlie means the underlying relation. The verb to be under means the underlying relation. The verb to be beneath means the underlying relation.
Instead of looking under a thing which is underlaid by something (called the lost object):
say "You find [the list of things which underlie the noun]!";
now every thing which underlies the noun is carried by the player;
now every thing which underlies the noun does not underlie the noun.
Hiding it under is an action applying to one carried thing and one thing. Understand "put [something preferably held] under [something]" as hiding it under. Understand "hide [something preferably held] under [something]" as hiding it under. Understand the commands "shove" and "conceal" and "stick" as "hide".
Check hiding it under:
if the second noun is not fixed in place, say "[The second noun] wouldn't be a very effective place of concealment." instead.
Carry out hiding it under:
now the noun is nowhere;
now the noun underlies the second noun.
Report hiding it under:
say "You shove [the noun] out of sight beneath [the second noun]."
Section 2 - In Which They are Put To Use
The Room of Hidden Objects is a room. It contains a sofa, an easy chair, and a rug. The sofa supports a lime-green pillow and an innocent-looking Chinese finger toy. The rug is fixed in place. The chair is a supporter.
A treasure map underlies the easy chair. A skeleton is beneath the sofa. A blueprint of Atlantis, a lexicon of Linear A, and the key to Jimmy Hoffa's Mausoleum are under the rug.
Test me with "look under the sofa / look under the rug / look under the easy chair / hide lexicon under rug".

View file

@ -5,16 +5,17 @@ Index: DRINKing a potion which then goes away
Description: A potion that the player can drink.
For: Z-Machine
Some kinds of game objects -- food, for instance -- can only sensibly be used once, and should then be destroyed. The EAT command already implements this, but suppose we also had a category of drinkable potions:
Some kinds of game objects food, for instance can only sensibly be used once, and should then be destroyed. The ``eat`` command already implements this, but suppose we also had a category of drinkable potions:
{*}"Beverage Service"
A potion is a kind of thing. The sparkly blue potion is a potion carried by the player.
Level 3 is a room.
Instead of drinking a potion (called the drink):
now the drink is nowhere;
say "You quaff [the drink]. It goes down beautifully."
Test me with "drink sparkly / i".

View file

@ -5,24 +5,24 @@ Index: Bookshelf with numerous books
Description: A bookshelf with a number of books, where the player's command to examine something will be interpreted as an attempt to look up titles if the bookshelf is present, but otherwise given the usual response.
For: Z-Machine
Suppose we want a bookshelf with a very large number of books on it. They aren't to be taken or carried around in the game, but they should be mentioned, and the player should be allowed to look them up by name. Furthermore, the player's attempts to examine something unrecognized should be understood as an attempt to look up a title -- but only when the player is in the presence of the books. The rest of the time such requests should be rejected in the usual way.
Suppose we want a bookshelf with a very large number of books on it. They aren't to be taken or carried around in the game, but they should be mentioned, and the player should be allowed to look them up by name. Furthermore, the player's attempts to examine something unrecognised should be understood as an attempt to look up a title but only when the player is in the presence of the books. The rest of the time such requests should be rejected in the usual way.
{*}"Bibliophilia"
The Graduate Lounge is a room. "Shabby sofas; plastic cups remaining from the afternoon's pre-lecture espresso; a collection of Xena and Hercules figurines posed for ironic effect. It's somewhat depressing at this hour, when everyone has gone home."
The Classics Reading Room is south of the Lounge. "Not as large a collection as the one in the Library, but it contains copies of everything really essential for reference."
Understand "examine [text]" as examining as a book when the player is in the Reading Room. Understand "look up [text]" as examining as a book when the player is in the Reading Room.
Examining as a book is an action applying to one topic.
Carry out examining as a book:
say "You can't find any such text."
Instead of examining as a book a topic listed in the Table of Book Titles:
say "[description entry][paragraph break]"
Table of Book Titles
topic title description
"Reading Greek Death" or "reading/greek/death" or "greek death" "Reading Greek Death" "A dense orange paperback treatise on the development of Greek eschatology."
@ -30,21 +30,26 @@ Suppose we want a bookshelf with a very large number of books on it. They aren't
"Oxford Classical Dictionary" or "OCD/dictionary/classical/oxford" "Oxford Classical Dictionary" "A hefty reference with short articles on everything from Greek meter to ancient cosmetics."
"Collected Dialogues of Plato" or "Plato/dialogues/hamilton/cairns" "Collected Dialogues of Plato" "All the Platonic dialogues -- some, admittedly, in rather tired translations -- but still a useful single volume, ed. Edith Hamilton and Huntington Cairns."
"Adobe Illustrator CS User Guide" or "user guide" or "adobe illustrator" or "adobe/illustrator/cs/user/guide" "Adobe Illustrator CS User Guide" "Hello, how did this get here? A suspiciously familiar name is scribbled inside the front cover..."
Some books are scenery in the Reading Room. Understand "copies" or "book" or "shelf" or "shelves" as the books. Instead of examining the books:
choose a random row in the Table of Book Titles;
say "You scan the shelves and notice, among others, a volume entitled [italic type][title entry][roman type]."
Test me with "south / examine ocd / examine books / examine books / examine plato / n / x hercules / s / x hercules".
Now if we type >X HERCULES in the Lounge, we will get
Now if we type ``x hercules`` in the Lounge, we will get
>x hercules
You can't see any such thing.
``` transcript
>x hercules
You can't see any such thing.
```
thanks to our somewhat slovenly implementation of the Lounge scenery; but in the Reading Room,
>x hercules
You can't find any such text.
``` transcript
>x hercules
You can't find any such text.
```
In practice we might also want to extend our coverage somewhat to handle a case where the player tried to take books from the bookshelf: currently that would not be understood.

View file

@ -8,18 +8,19 @@ For: Z-Machine
It may occasionally be useful to check whether all objects in our game have a given property. Here we have a "not for release" section that will run at the start of the game and alert us to any objects lacking description:
{*}"Bic"
Section 1 - Testing descriptions - Not for release
When play begins (this is the run property checks at the start of play rule):
repeat with item running through things:
if description of the item is "":
say "[item] has no description."
Section 2 - Story
The Staff Break Room is a room.
The player carries an orange, a Bic pen, and a napkin. The description of the orange is "It's a small hard pinch-skinned thing from the lunch room, probably with lots of pips and no juice."
The description of the napkin is "Slightly crumpled."

View file

@ -2,57 +2,57 @@ Example: *** Big Sky Country
Location: When play ends
RecipeLocation: Ending The Story
Index: Resuming play after an accidental death
Description: Allowing the player to continue play after a fatal accident, but penalizing them by scattering their possessions around the game map.
Description: Allowing the player to continue play after a fatal accident, but penalising them by scattering their possessions around the game map.
For: Z-Machine
Some older games allowed the player to be resurrected after a death, but punished them by distributing his possessions far and wide. Here we emulate that effect.
{*}"Big Sky Country"
Use scoring.
When play begins: say "There's a bit of a drive over from Anaconda, Montana, and then through a couple or three ghost towns, but finally you find what you're looking for, and strike out on foot..."
Entrance to Devil's Canyon is a room. "You are at the top of a steep road, which proceeds down into the canyon proper." A sign is in Devil's Canyon. It is fixed in place. "An ominous sign has been put up by the local sheriff's office." The description is "PROCEED AT OWN RISK - NO RESCUES!"
Instead of going down when a random chance of 1 in 3 succeeds:
say "Whoooops, your footing is not as secure as you thought...";
end the story.
Dusty Path is below Entrance. "A dusty path, with grey-brown thorny bushes on either side. Immediately to your right is a sheer drop; far below you can see the rusting remains of a Model T that some fool tried to drive by here."
Hairpin is below Dusty Path. "A sharp bend in the road, doubling back down towards the bottom of the canyon. Just north of here there is also a small cavern of some kind[if the stick pin is in the cavern], which attracts your eye with some glittery thing[end if]."
The Cavern is north of Hairpin. "Really not much more than a little hollow in the side of the canyon." In the cavern are a snake and a diamond stick pin. The snake is an animal. The description of the snake is "You're no expert, but it looks like a rattler."
Instead of taking the diamond stick pin in the presence of the snake: say "Turns out the snake is partial to that there pin, and takes exception to your intending to make off with it."; end the story.
In a fuller implementation of this game, we might make it possible to get by the snake, but in this version, it's just going to remain troublesome.
{**}Crooked Path is below Hairpin. "You're about two thirds of the way down to the bottom of the cavern at this point."
At the Spot is below Crooked Path. "This'll be it: a bare patch of ground that might as well have an X painted right on it."
Rule for supplying a missing noun while digging:
now noun is the location.
Understand "dig" or "dig hole/here" or "dig in ground/dirt/earth" as digging. Digging is an action applying to one thing.
Instead of digging at the spot:
say "You dig and dig, and after a half hour or so, sure enough, you do turn up a big box of gold! You're going to be richer than God and Bill Gates put together.";
increase the score by 5;
end the story finally.
Instead of digging at the spot when the player does not carry the shovel:
say "What, without your shovel? That won't work too well."
The player carries a walking stick. The player wears a hat, a whistle, and a daypack. The daypack contains a mylar blanket, a granola bar, a cellular phone, a water bottle, a folding shovel, and a photocopied map. The granola bar is edible. Instead of drinking the water, say "You quench your thirst, for the time being." The description of the map is "The map shows the winding path of Devil's Canyon, with a large X down by the south end. That would be where your uncle Jesse buried the gold from the train robbery."
The maximum score is 5.
When play ends when the story has not ended finally:
say "Oh dear, that ought to be fatal! However, if you like I can get you out of it...
Shall I? >";
if the player consents:
repeat with item running through things had by the player:
@ -62,3 +62,4 @@ In a fuller implementation of this game, we might make it possible to get by the
try looking.
"If the player consents" is just a convenient way to ask a yes/no question that the player must answer before going on with the game.

View file

@ -6,13 +6,14 @@ Description: Delaying the banner for later.
For: Z-Machine
{*}"Bikini Atoll" by Edward Teller
The Hut and the Tropical Beach are rooms.
The conch shell is in the Hut. After taking the shell for the first time: say "As you gather the oddly-warm conch shell into your arms, you experience a sudden flash of deja-vu...[banner text]"; move the player to the Tropical Beach.
Rule for printing the banner text when the player is not carrying the shell: do nothing.
Test me with "look / examine shell / get shell / look".
(By tradition, and as a courtesy to all the people who have worked on Inform, authors ensure that the banner is printed some time near the beginning of each game played. So please only defer it, rather than suppress it altogether.)

View file

@ -8,16 +8,16 @@ For: Z-Machine
In this example, we want the names of rooms to be asterisked out if the player wanders around without the benefit of a candle. We can do this by treating the room names as text, then replacing every letter:
{*}"Blackout"
Tiny Room is a dark room. Absurdly Long-Named Room is a dark room. It is west of Tiny Room.
The Candle Factory is north of Tiny Room. It contains a beeswax candle. The beeswax candle is lit.
Rule for printing the name of a dark room:
let N be "[location]";
replace the regular expression "\w" in N with "*";
say "[N]".
Test me with "w / look / e / n / get candle / s / w".
Notice that the hyphen in the Absurdly Long-Named Room does not get replaced. We could replace even that, if we liked, with
@ -25,3 +25,4 @@ Notice that the hyphen in the Absurdly Long-Named Room does not get replaced. We
replace the regular expression "\S" in N with "*";
which would catch every character that is not a space.

View file

@ -10,9 +10,9 @@ Occasionally we want to print something as our first screen and then pause the g
We can tidy this up in the "starting the virtual machine" activity, by temporarily changing the status line content. We will not provide game-pausing code here, because that is easily done by extension; so:
{*}"Blankness"
Include Basic Screen Effects by Emily Short.
When play begins:
say "take me home";
wait for any key;
@ -22,11 +22,12 @@ We can tidy this up in the "starting the virtual machine" activity, by temporari
pause the game;
now the left hand status line is "[location]";
now the right hand status line is "[turn count]".
Before starting the virtual machine:
now the left hand status line is "";
now the right hand status line is "".
Paradise City is a room. The description of Paradise City is "The grass is green and the girls are pretty."
Quite a modest effect, but occasionally useful.

View file

@ -8,12 +8,12 @@ For: Z-Machine
Suppose we are writing a game in which the mood of the piece changes, and we would like to have lots of descriptions that vary according to its current state. We might in that case want to create our own "by atmosphere" token, to control text variations, like this:
{*}"Blink"
Atmosphere is a kind of value. The atmospheres are normal, melancholy, and creepy.
The current atmosphere is an atmosphere that varies.
The current atmosphere variable is defined by Inter as "current_atmosphere".
To say by atmosphere -- ending say_one_of with marker I7_SOO_ATM:
(- {-close-brace} -).
@ -29,10 +29,10 @@ Since we're operating within the untyped Inform 6, we can make use of the fact t
And that concludes the hard part. Now to test that it works:
{**}The Flat is a room. "A small [one of]but cozy[or]depressing[or]imprisoning[by atmosphere] flat. Outside the window, the sun is [one of][or][or]apparently [by atmosphere]shining and there is a brisk breeze through the leaves of the birch trees. [one of]It would be quite nice weather for a walk[or]The rest of the world apparently has no appreciation of what you suffer[or]It all looks deceptively normal[by atmosphere]."
Instead of waiting when the current atmosphere is normal:
say "Everything stretches wide and flat for just a moment, as though all the world around you were painted on a thin rubber sheet that is being [italic type]stretched[roman type]. Then it snaps back into place, leaving your ears ringing. But that little glitch was enough to warn you. Someone is tampering with space-time again. Someone very close by.";
now the current atmosphere is creepy.
Test me with "look / z / look".

View file

@ -5,10 +5,10 @@ Index: Clothing that layers
Description: Clothing for the player that layers, so that items cannot be taken off in the wrong order, and the player's inventory lists only the clothing that is currently visible.
For: Z-Machine
We have two things to keep track of with our layering clothing: what currently is covering something else; and what <i>can</i> cover something else. This implementation goes for a fairly simple treatment, assuming that each item of clothing will completely conceal those beneath it, and that we are not implementing entire sets of shirts, jackets, etc. But it will do for a demonstration.
We have two things to keep track of with our layering clothing: what currently is covering something else; and what *can* cover something else. This implementation goes for a fairly simple treatment, assuming that each item of clothing will completely conceal those beneath it, and that we are not implementing entire sets of shirts, jackets, etc. But it will do for a demonstration.
{*}"Bogart"
Section 1 - Clothing Behavior
First we make our relation to represent what *is* underneath another item:
@ -18,25 +18,25 @@ First we make our relation to represent what *is* underneath another item:
And now we prevent taking a lower layer off before the thing that is worn over it:
{**}Before taking off something which underlies something (called the impediment) which is worn by the player:
say "(first removing [the impediment])[command clarification break]";
silently try taking off the impediment;
say "(first removing [the impediment])[command clarification break]";
silently try taking off the impediment;
if the noun underlies something which is worn by the player, stop the action.
Check taking off:
if the noun underlies something (called the impediment) which is worn by the player, say "[The impediment] [are] in the way." instead.
Carry out taking off:
now the noun is not underlaid by anything.
Report taking off something:
say "[We] [are] now wearing [a list of uppermost things worn by the player]." instead.
Definition: a thing is uppermost if it is not under something.
That covers order of clothing removal, but we also want to restrict what can be worn on top of what else. This time we need Inform to have some idea of what customarily can be layered on top of what other clothing:
{**}Overlying relates one thing to various things. The verb to overlie means the overlying relation.
Covering relates a thing (called A) to a thing (called B) when the number of steps via the overlying relation from A to B is greater than 0. The verb to cover means the covering relation.
With these definitions, we can say that a jacket should go over a shirt and a shirt over an undershirt (say), and then Inform will know that a jacket will cover both shirt and undershirt.
@ -46,34 +46,35 @@ With these definitions, we can say that a jacket should go over a shirt and a sh
say "(first removing [the impediment])[command clarification break]";
silently try taking off the impediment;
if the player is wearing the impediment, stop the action.
Carry out wearing:
if the noun covers something (called the hidden item) worn by the player, now the hidden item underlies the noun.
Instead of looking under something which is worn by the player:
if something (called the underwear) underlies the noun, say "[We] [peek] at [the underwear]. Yup, still there.";
otherwise say "Just [us] in there."
Instead of taking inventory:
say "[if the player carries something][We]['re] carrying [a list of things carried by the player][else][We]['re] empty-handed[end if][if the player wears something]. [We] [are] wearing [a list of uppermost things worn by the player][end if]."
To peek is a verb.
Notice that our inventory only describes the things that the player can see as the upper layer of clothing.
{**}Section 2 - The Scenario
The Trailer is a room. "A full-length mirror is the main amenity in here, and that suits you just fine." The full-length mirror is scenery in the Trailer. Instead of examining or searching the mirror, try taking inventory.
The player wears a fedora, a jacket, a shirt, some undershorts, an undershirt, some slacks, a pair of socks, and a pair of shoes.
The shirt underlies the jacket. The pair of socks underlies the pair of shoes. The undershorts underlie the slacks. The undershirt underlies the shirt.
The jacket overlies the shirt. The shoes overlie the socks. The slacks overlie the undershorts. The shirt overlies the undershirt.
Test me with "x mirror / remove fedora / remove jacket / remove shirt / remove slacks / remove undershirt / remove shoes / remove socks / remove shorts / remove undershorts".
If we further wanted to prevent the player from taking off clothes in inappropriate places, we might add something like this:
Instead of taking off something in the presence of someone who is not the player:
say "[We] [are] far too modest to strip in public."

View file

@ -2,19 +2,19 @@ Example: * Bosch
Location: Stored actions
RecipeLocation: Scoring
Index: FULL SCORE using a list of stored actions
Description: Creating a list of actions that will earn the player points, and using this both to change the score and to give FULL SCORE reports.
Description: Creating a list of actions that will earn the player points, and using this both to change the score and to give ``full score`` reports.
For: Z-Machine
We could, if we wanted, make a table of stored actions all of which represent things that will earn points for the player. For instance:
{*}"Bosch"
Use scoring.
The Garden of Excess is a room. The gilded lily is an edible thing in the Garden of Excess.
The Pathway to Desire is west of the Garden of Excess. The emerald leaf is in the Pathway.
Table of Valuable Actions
relevant action point value turn stamp
taking the emerald leaf 15 -1
@ -23,19 +23,19 @@ We could, if we wanted, make a table of stored actions all of which represent th
(And our list would presumably continue from there, in the full game.)
{**}The maximum score is 25.
After doing something:
repeat through Table of Valuable Actions:
if the current action is the relevant action entry and turn stamp entry is less than 0:
now the turn stamp entry is the turn count;
increase the score by the point value entry;
continue the action.
Understand "full score" or "full" as requesting the complete score. Requesting the complete score is an action out of world.
Check requesting the complete score:
if the score is 0, say "You have not yet achieved anything of note." instead.
Carry out requesting the complete score:
say "So far you have received points for the following: [line break]";
sort the Table of Valuable Actions in turn stamp order;
@ -43,7 +43,8 @@ We could, if we wanted, make a table of stored actions all of which represent th
if the turn stamp entry is greater than 0:
say "[line break] [relevant action entry]: [point value entry] points";
say line break.
Test me with "eat lily / w / full score / get leaf / full".
This system is tidy, but limited: we cannot give actions interesting names in the score list, like "seducing the pirate's daughter" or "collecting a valuable artifact". So it will not be ideal in all situations, but it has the virtue of being easy to extend, and of listing all of the player's successes in the order in which they occurred in their play-through.

View file

@ -6,17 +6,17 @@ Description: A fuller implementation of Ogg, giving him a motivation of his own
For: Z-Machine
{*}"Boston Cream"
Use scoring.
The Donut Shop is a room. "Vibrantly decorated in donut colors: pink, brown, and cream."
Ogg is a man in the Donut Shop. "Ogg is slumped in the corner[if Ogg carries something] with [a list of things carried by Ogg][end if]. He wears a nametag which says 'HELLO MY NAME IS OG.'" Understand "og" as Ogg. Ogg wears a nametag. The description of the nametag is "Very neatly written."
The Donut Shop contains a transparent closed openable locked lockable enterable container called a case. The case is fixed in place. The case contains some cake donuts, some jelly donuts, and some apple fritters. "The [if unopenable]damaged[otherwise]gleaming[end if] donut case [if something is in the case]contains [a list of things in the case][otherwise]has been stripped of its contents[end if]." The cake donuts, the jelly donuts, and the apple fritters are edible.
The matching key of the case is a silver key. The silver key is in a mesh basket. The mesh basket is closed, transparent, and openable. It is in the Donut Shop.
Before someone taking something which is carried by the player:
if the person asked cannot touch the player:
say "Ogg looks with a fixed frown at [the noun].";
@ -25,11 +25,11 @@ For: Z-Machine
say line break;
silently try dropping the noun;
stop the action.
Before someone unlocking a locked thing with something which is not carried by the person asked:
try the person asked taking the second noun;
stop the action.
Before someone opening a locked thing (called the sealed chest):
if the person asked can see the matching key of the sealed chest:
if the matching key of the sealed chest is enclosed by the sealed chest:
@ -39,13 +39,13 @@ For: Z-Machine
otherwise:
try the person asked unlocking the sealed chest with the matching key of the sealed chest;
stop the action.
Before someone taking something which is in a closed container (called the shut chest):
try the person asked opening the shut chest;
stop the action.
Ogg has a number called hunger. The hunger of Ogg is 0.
Every turn:
increment the hunger of Ogg;
if the hunger of Ogg is 2 and Ogg is visible, say "Ogg's stomach growls.";
@ -64,28 +64,28 @@ For: Z-Machine
otherwise:
if Ogg can touch the player, end the story saying "Ogg is gnawing your ankle";
otherwise try Ogg taking the player.
The crumbs are a thing. "Crumbs of [the list of edible things which cannot be seen by the player] lie scattered over the whole floor."
Instead of asking Ogg to try doing something when Ogg cannot touch the player:
say "Ogg tilts his head and shrugs, unable to hear your instruction clearly."
Instead of asking Ogg to try eating something:
say "It's not as though Ogg really needs any encouragement in that department, is it?"
Definition: Ogg is hungry if the hunger of Ogg is greater than 2.
Persuasion rule for asking Ogg to try doing something: if Ogg is hungry, persuasion fails; persuasion succeeds.
Persuasion rule for asking Ogg to try giving something edible to the player:
persuasion fails.
Unsuccessful attempt by Ogg doing something:
if the reason the action failed is a failing listed in the Table of Ogg Retorts:
say "[reply entry][paragraph break]";
otherwise:
say "Ogg looks adorably confused."
Table of Ogg Retorts
failing reply
can't take people's possessions rule "'Ogg too polite.'"
@ -93,47 +93,48 @@ For: Z-Machine
can't take scenery rule "'[The noun] very very heavy.'"
can't take what's fixed in place rule "'[The noun] very heavy."
can't drop what's not held rule "'Hunh?'"
Carry out Ogg eating an edible thing:
move the crumbs to the holder of Ogg;
now the hunger of Ogg is 0.
Report Ogg unlocking something with something:
say "Ogg struggles a bit with [the second noun] in the lock of [the noun], but does eventually succeed. 'Hunh!' says Ogg.";
stop the action.
Carry out Ogg opening the case when the case has been open:
now the case is unopenable.
Instead of closing the unopenable case:
say "The glass panels are no longer properly seated in their tracks, and the case cannot be closed ever again."
Report Ogg opening the unopenable case:
say "Ogg forces [the case] so hard that it does break.";
stop the action.
Report Ogg opening the case:
say "Ogg yanks [the noun] open with such force that you fear for its structural integrity.";
stop the action.
Report Ogg taking something edible:
say "Ogg acquires [the noun] with a look of tender affection.";
stop the action.
Report Ogg eating something:
say "Ogg chows down on [the noun], scattering crumbs in all directions.";
stop the action.
Report Ogg eating something when the number of visible edible things is 1:
say "Ogg eats [the noun] in his trademark style. You can no longer bear to watch.";
stop the action.
After entering the case:
say "You climb inside the case, folding yourself up uncomfortably."
After locking the case with something when the player is in the case:
say "You turn the key firmly in the lock -- amazing it locks from within, but it does -- and settle yourself for a long wait, hoping this thing is not air-tight."
The maximum score is 1.
Test me with "open mesh / get key / unlock case / open case / enter case / close case / lock case / wait / wait".

View file

@ -2,64 +2,64 @@ Example: *** Bowler Hats and Baby Geese
Location: During scenes
RecipeLocation: Scripted Scenes
Index: Scenes which restrict movement
Description: Creating a category of scenes that restrict the player's behavior.
Description: Creating a category of scenes that restrict the player's behaviour.
For: Z-Machine
Scenes can have properties -- a fact that is very useful when it comes to writing a series of scenes that all need to act alike in some respect.
Scenes can have properties a fact that is very useful when it comes to writing a series of scenes that all need to act alike in some respect.
Suppose we have a plot that features a number of scripted scenes, where we need the player to stand still and wait while the events of the scene play out. One way to set this up is to create a property for such scenes -- let's call them "restricted" -- and then write a rule that keeps the player in place while the scene happens:
Suppose we have a plot that features a number of scripted scenes, where we need the player to stand still and wait while the events of the scene play out. One way to set this up is to create a property for such scenes let's call them "restricted" and then write a rule that keeps the player in place while the scene happens:
{*}"Bowler Hats and Baby Geese"
Section 1 - The Procedure
A scene can be restricted or free.
Instead of going somewhere during a restricted scene:
say "Better to stay here for the moment and find out what is going to happen next."
And now let's set up our restricted scene. In it, a clown is going to turn up wherever the player is (it doesn't matter where on the map they've gotten to at this point) and do a performance; the player will not be able to leave the area until the performance completes. We'll start with the setting:
{**}Section 2 - The Stage and Props
The Broad Lawn is a room. "A sort of fun fair has been set up on this broad lawn, with the House as a backdrop: it's an attempt to give local children something to do during the bank holiday. In typical fashion, everyone is doing a very good job of ignoring the House itself, despite its swarthy roofline and dozens of blacked-out windows."
The House is scenery in the Broad Lawn. The description is "A cautious vagueness about the nature of the inhabitants is generally considered a good idea. They might be gods, or minor demons, or they might be aliens from space, or possibly they are embodiments of physical principles, or expressions of universal human experience, or... at any rate they can run time backward and forward so it warbles like an old cassette. And they're always about when somebody dies. Other than that, they're very good neighbors and no one has a word to say against."
Instead of entering the House:
say "You can't go in, of course. It's not a house for people."
The Gazebo is north of the Broad Lawn. "The gazebo is sometimes used for bands, but at the moment has been appropriated for the distribution of lemonade."
The clown is a man. "A clown wearing [a list of things worn by the clown] stands nearby." The description is "He winks back at you."
The clown wears a purple polka-dot bowler hat. He carries a supply of baby geese. The description of the supply of baby geese is "Three or four. Or five. It's hard to count." Understand "goose" or "gosling" or "goslings" as the supply of baby geese.
There are some eggs. The description of the eggs is "A blur, really."
There is a Spanish omelet. The description of the Spanish omelet is "Exquisitely prepared."
...And now the scene itself:
{**}Section 3 - The Scenes
The Clown Performance is a restricted scene. Clown Performance begins when the turn count is 3.
When Clown Performance begins:
move the clown to the location.
Every turn during Clown Performance:
repeat through the Table of Clowning:
say "[event description entry][paragraph break]";
blank out the whole row;
stop.
When Clown Performance ends:
now the eggs are nowhere;
now the clown carries the omelet.
Clown Performance ends when the number of filled rows in the Table of Clowning is 0.
Table of Clowning
event description
"A clown with a purple polka-dot bowler hat strides into the vicinity and begins to juggle baby geese."
@ -67,12 +67,12 @@ And now let's set up our restricted scene. In it, a clown is going to turn up wh
"In an attempt to resolve the problem, the clown reverses the direction of his juggling. The geese revert to goslings."
"The goslings become smaller and smaller until the clown is juggling goose eggs[replace eggs]."
"The clown throws all the eggs into the air at once and catches them in the bowler hat. He takes a bow; the audience applauds. As a final gesture, he upends his hat to release a perfectly cooked omelet."
To say replace eggs:
now the supply of baby geese is nowhere;
now the clown carries the eggs.
Free Time is a scene. Free Time begins when Clown Performance Ends.
Test me with "scenes / n / z/ z / look / x geese / s / x geese / x eggs / z / s".

View file

@ -2,21 +2,21 @@ Example: ** Bribery
Location: New rules
RecipeLocation: Barter and Exchange
Index: GIVE command extended
Description: A GIVE command that gets rid of Inform's default refusal message in favor of something a bit more sophisticated.
Description: A ``give`` command that gets rid of Inform's default refusal message in favor of something a bit more sophisticated.
For: Z-Machine
If we want to rewrite the functionality of a command that usually ends with a "block..." rule, we will have to begin by turning the blocking off.
{*}"Bribery"
The block giving rule is not listed in the check giving it to rules.
As it happens, correct behavior is built into the GIVE command once "block giving" is turned off, so we do not have to write a replacement report or carry-out rule; the object will be transferred to the possession of the caterpillar. But we do want to adjust the action just a little so that our gift cheers up the recipient:
As it happens, correct behaviour is built into the ``give`` command once "block giving" is turned off, so we do not have to write a replacement report or carry-out rule; the object will be transferred to the possession of the caterpillar. But we do want to adjust the action just a little so that our gift cheers up the recipient:
{**}Carry out giving (this is the gratitude for gifts rule): improve the mood of the second noun.
Mood is a kind of value. The moods are hostile, suspicious, indifferent, friendly, and adoring. An animal has a mood. An animal is usually indifferent.
To improve the mood of (character - an animal):
if the mood of character is less than friendly, now the mood of the character is the mood after the mood of the character.
@ -25,12 +25,12 @@ Now whenever we give something to an animal, the animal will be pleased about th
{**}Check giving (this is the polite refusal of unwanted objects rule):
unless the noun interests the second noun:
say "[The second noun] disdainfully refuses [the noun]." instead.
To decide whether (item - a thing) interests (character - a person):
if the character has the item, no;
if the item is edible, yes;
no.
Instead of showing something to someone:
try giving the noun to the second noun.
@ -42,29 +42,30 @@ There is already a perfectly workable report rule that will describe what happen
And the rest is all scenario:
{**}The Leafy Branch is a room. "You stand on smooth bark dappled by sunlight. The scent-trail runs forward to home.
The branch continues forward and backward from here, and a stem extends forward-up."
Instead of going south in Leafy Branch, say "You must not back down! The scent trail leads onward!"
The Very Hungry Caterpillar is a hostile animal in the Leafy Branch. "[The Caterpillar] looks [mood]." Instead of examining the Caterpillar, say "[The caterpillar] appears [mood]."
The player carries an edible thing called a peanut crumb. The carrying capacity of the player is 1. After taking something, say "You lift [the noun], though it is nearly your own size."
Instead of going north in the presence of a hostile caterpillar:
say "[The Caterpillar] moves to block your exit, glaring down at you with all the bristles on its skin extended to full size."
Instead of going north in the presence of a suspicious caterpillar:
say "[The Caterpillar] moves to block your exit, though it might allow you past if you offered further tribute."
The Leaf Face is above the branch. "The smooth and shiny surface of the leaf extends forward from here, but you have lost the scent-trail. This is not the way home." The pear fragment is an edible thing in Leaf Face. The dead aphid is a thing in Leaf Face.
The Twig is north of Leafy Branch. "The scent-trail is weak but not entirely gone, and you pursue it faithfully..."
After going to the Twig:
say "The scent-trail is weak but not entirely gone, and you pursue it faithfully...";
end the story finally.
Understand "forward-up" as up. Understand "forward" as north. Understand "backward" as south. Understand "backward-down" as down.
Test me with "forward / give crumb to caterpillar / forward / forward-up / get aphid / get fragment / down / give aphid to caterpillar / drop aphid / forward-up / get fragment / down / give fragment / forward".

View file

@ -1,20 +1,20 @@
Example: *** Brown
Location: Parts of things
RecipeLocation: Painting and Labeling Devices
RecipeLocation: Painting and Labelling Devices
Index: Red sticky label
Description: A red sticky label which can be attached to anything in the game, or removed again.
For: Z-Machine
{*}"Brown"
The Shipping Room is a room. The red sticky label is a thing carried by the player. The description of the red sticky label is "It reads: AIRMAIL[if the label is part of something (called the parent)]. It is stuck to [the parent][end if]."
A black crate is in Shipping. The description is "A boring black crate." The brown crate is a thing in Shipping. The description is "An ordinary brown crate."
After examining something when the label is part of the noun:
say "A bright red sticky label is attached to [the noun]!"
Here is the essential point: whenever we ATTACH LABEL TO something, it becomes part of that object.
Here is the essential point: whenever we ``attach label to`` something, it becomes part of that object.
{**}Instead of tying the red sticky label to something:
now the red sticky label is part of the second noun;
@ -29,10 +29,10 @@ And of course the label cannot be stuck to itself or to more than one thing at a
say "(first freeing the label)[line break]";
silently try taking the label;
if the label is part of something, stop the action.
Instead of tying the red sticky label to the label:
say "That would ruin the label entirely."
Instead of taking the label when the label is part of something:
now the player carries the label;
say "You peel the label off again."
@ -41,17 +41,18 @@ Much of the rest is just tidying to make sure that the player's commands are red
{**}Instead of tying something to the label:
try tying the label to the noun.
Instead of putting the label on something:
try tying the label to the second noun.
Instead of inserting the label into something:
try tying the label to the second noun.
Understand the commands "stick" or "apply" as "tie".
We could have created a new "sticking" action, but to keep the example short we will use the built-in "tying" action instead, and respond to the command "stick" just as if it were "tie".
We could have created a new "sticking" action, but to keep the example short we will use the built-in "tying" action instead, and respond to the command ``stick`` just as if it were ``tie``.
{**}Understand "peel [something]" or "peel off [something]" as taking.
Test me with "i / put label on the black crate / look / x black / x label / get the label / apply label to brown crate / look / x brown / peel off label / stick label to label".

View file

@ -6,45 +6,46 @@ Description: A candle which reacts to lighting and blowing actions differently d
For: Z-Machine
"Sire," said the Minister of the Interior to Napoleon, "yesterday I saw the most intrepid man in your Empire." - "What man is that?" said the Emperor brusquely, "and what has he done?" - "He wants to do something, Sire." - "What is it?" - "To visit the sewers of Paris."
This man existed and his name was Bruneseau.
- Victor Hugo, Les Miserables
Let's say that our intrepid explorer has a candle that can be lit and blown out again, and should accordingly appear unlit, burning, or partly burnt:
{*}"Bruneseau's Journey"
The Sewer Beneath St Denis is a room. "A narrow, stone-lined passageway, with only a little ledge to walk above the level of the refuse that flows down towards the Seine."
The candle is carried by the player. The description of the candle is "A candle, [if the candle has been lit]partially burnt[otherwise]still in pristine condition with untouched wick[end if]."
Instead of examining the lit candle, say "It burns with a pure heart."
The block burning rule is not listed in the check burning rules.
Instead of burning the lit candle:
say "The candle is already lit."
Check burning:
if the noun is not the candle, say "[The noun] cannot profitably be set on fire."
Carry out burning the candle:
now the candle is lit.
Report burning:
if the candle had been lit, say "You relight the candle.";
otherwise say "You light the candle for the first time.".
Understand "blow out [something]" as blowing out. Understand "blow [something] out" as blowing out. Blowing out is an action applying to one thing.
Carry out blowing out the candle:
now the candle is unlit.
Report blowing out:
if the noun is the candle and the candle was lit, say "You blow out [the noun].";
otherwise say "You blow on [the noun], to little effect."
Test me with "x candle / light candle / x candle / blow out candle / x candle".
We must be careful: "if the noun was lit" would throw errors because past-tense rules can only be applied to specific items, not to variables that could be anything.

View file

@ -22,9 +22,10 @@ Now we build in the instruction for what Inform should say if the player tries t
There is no theoretical reason why we have to define "count of exits" here: we could, if we wanted, just say "if the number of viable directions is 0", "if the number of viable directions is 1", and so on. However, each calculation of a "viable direction" takes a bit of computing power, so there is some slight savings in not requiring the game to count viable directions more than once in this routine.
{**}Dome is a room. North of Dome is North Chapel. South of the Dome is South Chapel. West of the Dome is Western End. Quiet Corner is northwest of the Dome, north of Western End, and west of North Chapel. Loud Corner is east of North Chapel, northeast of Dome, and north of Eastern End. Eastern End is north of Dim Corner and east of Dome. Dim Corner is southeast of Dome and east of South Chapel. Ruined Corner is southwest of Dome, west of South Chapel, and south of Western End.
The Crypt is below the dome.
The church door is east of Eastern End and west of the Courtyard. The church door is a door.
Test me with "u / n / n / e / n / s / u / open door / e / n".

View file

@ -6,11 +6,11 @@ Description: For every character besides the player, there is an action that wil
For: Z-Machine
{*}"Cactus Will Outlive Us All"
Death Valley is a room. Luckless Luke and Dead-Eye Pete are men in the Valley. A cactus is in the Valley. Persuasion rule: persuasion succeeds.
A person has an action called death knell. The death knell of Luckless Luke is pulling the cactus. The death knell of Dead-Eye Pete is Luke trying dropping the cactus.
Before an actor doing something:
repeat with the victim running through people in the location:
let the DK be the death knell of the victim;
@ -22,5 +22,6 @@ If we leave it at that, then pulling the cactus will kill Luckless Luke but then
{**}After pulling the cactus when Luckless Luke was in the location:
say "That's a real shame."
Test me with "get cactus / drop cactus / luke, get cactus / luke, drop cactus / pull cactus / look".

View file

@ -2,18 +2,18 @@ Example: ** Camp Bethel
Location: Text with random alternatives
RecipeLocation: Liveliness
Index: People who do new things each time the player looks
Description: Creating characters who change their behavior from turn to turn, and a survey of other common uses for alternative texts.
Description: Creating characters who change their behaviour from turn to turn, and a survey of other common uses for alternative texts.
For: Z-Machine
{*}"Camp Bethel"
Camp Bethel Kitchen is a room.
One use for text alternatives is to change the description of a room after first visiting. We've already seen, in the example "Slightly Wrong", how to do this with "[if visited] ... [otherwise] ... [end if]". But since the first description is printed once and the second description on all subsequent occasions, we could equally well write
One use for text alternatives is to change the description of a room after first visiting. We've already seen, in the example [Slightly Wrong], how to do this with "[if visited] ... [otherwise] ... [end if]". But since the first description is printed once and the second description on all subsequent occasions, we could equally well write
{**}The description of Camp Kitchen is "[one of]You've never been into the kitchen before, though you've spent many an hour in the dining lodge. The place is larger than you would have expected, and it has none of the fake rustic touches of the rest of the camp[or]A tidy, efficient industrial kitchen, without any of the kitsch rusticity found elsewhere[stopping]."
We might also want to liven up the behavior of people and animals, who are probably not doing the exact same thing every time we glance in their direction. There are more complex techniques for modeling the behavior of characters, as we will see in the chapters on Advanced Actions and Activities; but if we just want some textual variety, we might write something like:
We might also want to liven up the behaviour of people and animals, who are probably not doing the exact same thing every time we glance in their direction. There are more complex techniques for modeling the behaviour of characters, as we will see in the chapters on [Advanced Actions] and [Activities]; but if we just want some textual variety, we might write something like:
{**}Jeremy is a man in the Camp Bethel Kitchen. "Jeremy stands at his station, [one of]peeling white onions[or]briskly dicing onions[or]chopping celery[or]peeling carrots[or]tying fresh herbs together with string[or]putting all the vegetables into a large stock pot[or]watching over his boiling vegetable stock[cycling]."
@ -24,12 +24,12 @@ And since (textual variation or not) we do want the player to be able to see all
Jeremy is following a sequence of actions to do an implied task (still somewhat robotically, but it will do for now). Animals might be a bit more capricious, though:
{**}Fluffy is an animal in the Camp Bethel Kitchen. "[one of]Fluffy is chasing its tail[or]Fluffy is staring out the window[or]Fluffy is rubbing itself against your leg[purely at random]."
A housefly is an animal in the Camp Bethel Kitchen. "A large housefly [one of]lands on a countertop[or]flies around noisily[or]circles Jeremy's chef hat[at random]."
The housefly's description is merely "at random" rather than "purely at random" because we want to show it doing a different thing each turn, whereas Fluffy could plausibly stare out the window for five turns in a row.
There are more complex ways to change and override the initial descriptions of people and things; if text alternatives do not get us far enough, we can turn to the "rule for writing a paragraph about," documented in the Activities chapter.
There are more complex ways to change and override the initial descriptions of people and things; if text alternatives do not get us far enough, we can turn to the "rule for writing a paragraph about," documented in the [Activities] chapter.
Another frequent use of text alternatives is to give characters a bit of variety in things they're likely to say many times in the course of a game:
@ -46,4 +46,5 @@ Notice that, in that last line, our first option is entirely blank. If we put no
{**}Test me with "look / g / g / g / ask Jeremy about his feelings for me / ask jeremy about his amnesia / tell Jeremy about my unborn child".
As this example (alas) reveals, text alternatives will not go all the way toward making our characters into compelling conversationalists; we will have to wait until we know more about Actions. But at least we have abolished the default responses, and given Jeremy a touch of personality, however witless.
As this example (alas) reveals, text alternatives will not go all the way toward making our characters into compelling conversationalists; we will have to wait until we know more about actions. But at least we have abolished the default responses, and given Jeremy a touch of personality, however witless.

View file

@ -8,17 +8,18 @@ For: Z-Machine
Suppose we want to give the player a bag of candies, of which a random one is poisonous. We can pick which one should be poisoned at the start of play, like this:
{*}"Candy"
The plural of piece of candy is pieces of candy. A piece of candy is a kind of thing. A piece of candy is always edible. Four pieces of candy are in the Halloween bag.
Toxicity is a kind of value. The toxicities are safe and poisonous. A piece of candy has a toxicity. A piece of candy is usually safe.
The Porch is a room. The player carries the Halloween bag.
After eating a poisonous piece of candy:
say "Oh, that didn't taste right at all. Oh well!"
When play begins:
now a random piece of candy is poisonous.
Test me with "eat candy / g / g / g".

View file

@ -5,18 +5,19 @@ Index: Capitalised status line
Description: To arrange that the location information normally given on the left-hand side of the status line appears in block capitals.
For: Z-Machine
Not much is needed for this. The only noteworthy point is that it doesn't work by changing the LHSL to "[the player's surroundings in upper case]": it cannot do this because "the player's surroundings" is not a value. Instead, "[the player's surroundings]" is a text substitution sometimes printing the name of a room, sometimes printing "Darkness", and so on. We must therefore load it into a text first, and then apply "...in upper case".
Not much is needed for this. The only noteworthy point is that it doesn't work by changing the left hand status line to `"[the player's surroundings in upper case]"`: it cannot do this because "the player's surroundings" is not a value. Instead, `"[the player's surroundings]"` is a text substitution sometimes printing the name of a room, sometimes printing "Darkness", and so on. We must therefore load it into a text first, and then apply "...in upper case".
{*}"Capital City"
Capital City is a room. East is Lower Caissons. South of Lower Caissons
is San Seriffe. East of San Seriffe is a dark room.
To say the player's capitalised surroundings:
let the masthead be "[the player's surroundings]" in upper case;
say the masthead.
When play begins:
now the left hand status line is "[the player's capitalised surroundings]".
Test me with "e / s / e".

View file

@ -8,18 +8,18 @@ For: Z-Machine
Suppose we want to make an object that (unlike a backdrop) is definitely located in one room, but can be seen from far off. We want to allow the player to interact with it from a distance, but only using those actions that require visibility. Other actions should be denied:
{*}"Carnivale"
The Fairground is a region. Park Entrance, By the Wheel, and Candy Stand are in Fairground. Candy Stand is north of By the Wheel. Park Entrance is west of Candy Stand and northwest of By the Wheel.
The ferris wheel is scenery in By the Wheel. "It is extravagantly tall and carries several dozen glass gondolas for riders."
The description of By the Wheel is "You stand at the foot of an enormous ferris wheel, which turns far too quickly and never seems to stop for new riders."
The description of Park Entrance is "You are now just inside the gates. Behind you snakes a triple line of fairgoers all the way down the length of the valley to the railway station. Roughly southeast of here is the ferris wheel, towering over the other attractions."
The description of Candy Stand is "A hut in pale pink and baby blue dispenses marshmallow death's-heads, sugar-beetles, and other such treats. The giant ferris wheel is just off to the south from here."
As the descriptions make clear, the ferris wheel should be visible from everywhere in the fair, so we'll borrow a line from the Activities chapter to make that happen:
As the descriptions make clear, the ferris wheel should be visible from everywhere in the fair, so we'll borrow a line from the [Activities] chapter to make that happen:
{**}After deciding the scope of the player:
if the location is in Fairground, place the ferris wheel in scope.
@ -30,7 +30,7 @@ As the descriptions make clear, the ferris wheel should be visible from everywhe
as it normally would.
Now, by default, if the player were to type TOUCH FERRIS WHEEL while in another room, the story would respond
Now, by default, if the player were to type ``touch ferris wheel`` while in another room, the story would respond
You can't reach into By the Wheel.
@ -44,5 +44,6 @@ And because our accessibility rules are considered before the "Instead" phase, w
{**}Instead of touching the ferris wheel:
say "You don't dare: it's spinning too fast."
Test me with "x ferris wheel / touch ferris wheel / se / x ferris wheel / touch ferris wheel".

View file

@ -10,25 +10,25 @@ In a work of interactive fiction that involves many new discoveries, we might wa
One approach to this is to create a model of the facts we want the player to find out, and attach some narrative text to each. When a fact becomes relevant to the story, that narrative text is shown to the player. So:
{*}"Casino Banale"
Section 1 - Procedure
First we create the concept of facts, and the idea that facts can make some things more important than others.
{**}A fact is a kind of thing. A fact can be known or unknown. A fact can be ready to learn or hidden. A fact has some text called the narration.
Definition: a thing is narratively significant if it conveys an interesting fact.
Definition: a thing is narratively dull if it is not narratively significant.
Conveyance relates various things to various facts. The verb to convey means the conveyance relation.
Definition: a fact is interesting if it is unknown and it is ready to learn.
Now, we also need a way to tell Inform to introduce certain new facts when the right previous ones have been introduced. We'll create a "following" relation, according to which a new fact can be told to the player when the player has already learned all the facts it follows. This way, we can simulate the effect of putting together several pieces of evidence to come to a conclusion:
{**}Following relates various facts to various facts. The verb to follow means the following relation.
To say (new fact - a fact):
say "[narration of the new fact]";
now the new fact is known;
@ -40,12 +40,12 @@ Next we need a way for the game to introduce these new facts. Let's say we want
{**}After examining something which conveys an interesting fact (called discovery):
say "[discovery][paragraph break]".
After choosing notable locale objects:
repeat through the Table of Locale Priorities:
if the notable-object entry is narratively significant:
set the locale priority of the notable-object entry to 1.
For writing a paragraph about a narratively significant thing (called item):
now the item is mentioned;
let chosen fact be a random interesting fact which is conveyed by the item;
@ -56,41 +56,42 @@ The "after choosing notable locale objects" line here handles things so that any
And finally, we need to give the player a little evidence to piece together:
{**}Section 2 - Scenario
The Casino is a room.
Frince is a man in the Casino. The description is "Frince is a friend of yours -- if you reckon friendship on the same terms that one reckons a cat as a pet. He spends time with you when he wants to, but if your wishes or convenience ever run counter to a whim of his, it's the whim that wins. Always. [paragraph break]He's also wearing a somewhat ludicrous shirt."
Frince wears a ludicrous shirt. The description of the ludicrous shirt is "Fine white fabric with satiny white pinstripes: it's that expensive, effeminate look that Frince is so fond of, and which -- combined with his name -- gives people completely the wrong idea about him."
Tim is a man in the Casino. The description is "You don't know Tim well. Kind of wall-flowerish. The only thing that seems to excite him is craps."
Penny is a woman in the Casino. The description is "Loud. Brash. Hot, probably, if you can look past the loud and brash."
Rule for writing a paragraph about a narratively dull person:
let is-are-n be "is";
if the number of unmentioned narratively dull people is not 1:
let is-are-n be "are";
say "[A list of unmentioned narratively dull people] [is-are-n] [one of]watching the croupier[or]following the spin of the roulette[or]chattering[at random][one of] breathlessly[or] impatiently[or][at random]."
Penny-annoying is a fact.
It is ready to learn.
The narration is "[if looking]Penny grimaces at you-- [end if]Penny is the same woman who stepped on your toe in the buffet line. The third time, she blurted, 'You have big shoes, don't you?'"
Penny conveys penny-annoying.
lipstick-smudges is a fact.
It is ready to learn.
The narration is "There are a couple of smudges of coral-colored lipstick on the collar."
The ludicrous shirt conveys lipstick-smudges.
penny-wears-coral is a fact.
It follows penny-annoying.
The narration is "[if looking]Penny catches your eye again. [end if]The bright coral lipstick was really not a wise choice."
Penny conveys penny-wears-coral.
Affair-with-penny is a fact.
It follows lipstick-smudges and penny-wears-coral.
The narration is "You avoid [if examining Frince]his[otherwise]Frince's[end if] eye. You need some time to adjust to the image of him making out with Penny in a storage closet before you can talk to him without appalled giggling."
Frince conveys affair-with-Penny.
Test me with "x penny / x frince / x shirt / look".

View file

@ -5,11 +5,11 @@ Index: Modifying and re-parsing an entered command
Description: Determining that the command the player typed is invalid, editing it, and re-examining it to see whether it now reads correctly.
For: Z-Machine
Novice players of interactive fiction, unfamiliar with its conventions, will often try to add extra phrases to a command that the game cannot properly parse: HIT DOOR WITH FIST, for instance, instead of HIT DOOR.
Novice players of interactive fiction, unfamiliar with its conventions, will often try to add extra phrases to a command that the game cannot properly parse: ``hit door with fist``, for instance, instead of ``hit door``.
While we can deal with some of these instances by expanding our range of actions, at some point it becomes impossible to account for all the possible prepositional phrases that the player might want to tack on. So what do we do if we want to handle those appended bits of text sensibly?
We could go through and remove any piece of text containing "with ..." from the end of a player's command; the problem with that is that it overzealously lops off the ends of valid commands like UNLOCK DOOR WITH KEY, as well. So clearly we don't want to do this as part of the "After reading a command..." stage.
We could go through and remove any piece of text containing "with ..." from the end of a player's command; the problem with that is that it overzealously lops off the ends of valid commands like ``unlock door with key``, as well. So clearly we don't want to do this as part of the "After reading a command..." stage.
A better time to cut off the offending text is right before issuing a parser error. At that point, Inform has already determined that it definitely cannot parse the instruction as given, so we know that there's something wrong with it.
@ -20,13 +20,13 @@ This is where we have a valid reason to write a new "rule for reading a command"
Thanks to John Clemens for the specifics of the implementation.
{*}"Cave-troll" by JDC
Section 1 - The Mechanism
The last command is a text that varies.
The parser error flag is a truth state that varies. The parser error flag is false.
Rule for printing a parser error when the latest parser error is the only understood as far as error and the player's command matches the text "with":
now the last command is the player's command;
now the parser error flag is true;
@ -34,21 +34,22 @@ Thanks to John Clemens for the specifics of the implementation.
replace the regular expression ".* with (.*)" in n with "with \1";
say "(ignoring the unnecessary words '[n]')[line break]";
replace the regular expression "with .*" in the last command with "".
Rule for reading a command when the parser error flag is true:
now the parser error flag is false;
change the text of the player's command to the last command.
Section 2 - The Scenario
The Cave is a room.
The troll is a man in the cave.
The player carries a sword.
The chest is a locked lockable container in the cave.
Test me with "attack troll with sword / unlock chest with sword / attack troll as a test".
A caveat about using this method in a larger game: "parser error flag" will not automatically control the behavior of any rules we might have written for Before reading a command... or After reading a command..., so they may now fire at inappropriate times. It is a good idea to check for parser error flag in those rules as well.
A caveat about using this method in a larger game: "parser error flag" will not automatically control the behaviour of any rules we might have written for Before reading a command... or After reading a command..., so they may now fire at inappropriate times. It is a good idea to check for parser error flag in those rules as well.

View file

@ -5,21 +5,22 @@ Index: DROP applies even to objects the player carries indirectly
Description: Using the enclosure relation to let the player drop things which they only indirectly carry.
For: Z-Machine
By default, Inform only lets the player drop those things which they are carrying -- that is, those directly in their possession. Things inside satchels or on portable trays have to be taken first.
By default, Inform only lets the player drop those things which they are carrying that is, those directly in their possession. Things inside satchels or on portable trays have to be taken first.
If we want to change this behavior, we might add a dropping rule that distinguishes between carrying and mere enclosure (introduced back in "The location of something" in the chapter on Things):
If we want to change this behaviour, we might add a dropping rule that distinguishes between carrying and mere enclosure (introduced back in "The location of something" in the chapter on [Things]):
{*}"Celadon"
The Tea Room is a room. The player carries a black lacquer tray. The lacquer tray is portable. On the lacquer tray are a celadon teapot and a napkin.
Before dropping something:
if the player does not carry the noun and the player encloses the noun:
say "(first taking [the noun] from [the holder of the noun])[command clarification break]";
silently try taking the noun;
if the player does not carry the noun, stop the action.
Instead of taking the napkin:
say "It seems to be stuck to the tray, possibly by an underlying wad of gum."
Test me with "i / drop teapot / i / look / drop teapot / drop napkin / i / drop tray".

View file

@ -5,23 +5,26 @@ Index: Status line with centered text, the easy way
Description: Replacing the two-part status line with one that centers only the room name at the top of the screen.
For: Z-Machine
[ZL: "included as part of the standard distribution..."]::
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.

View file

@ -5,21 +5,22 @@ Index: HTML-style italic and boldface tags
Description: Making paired italic and boldface tags like those used by HTML for web pages.
For: Glulx
HTML uses angled brackets to achieve effects, and places italicised text between &lt;i&gt; and &lt;/i&gt; tags; and similarly boldface between &lt;b&gt; and &lt;/b&gt;. We can mimic this very easily by setting each up as a segmented substitution:
HTML uses angled brackets to achieve effects, and places italicised text between <i> and </i> tags; and similarly boldface between <b> and </b>. We can mimic this very easily by setting each up as a segmented substitution:
{*}"Chanel Version 1"
To say i -- beginning say_i -- running on: (- style underline; -).
To say /i -- ending say_i -- running on: (- style roman; -).
To say b -- beginning say_b -- running on: (- style bold; -).
To say /b -- ending say_b -- running on: (- style roman; -).
Place Vendôme is a room. "[i]Fashion fades, only style remains the same[/i] ([b]Coco Chanel[/b]). And this elegant drawing-room, once a milliner's shop, is a case in point."
Instead of going nowhere, say "[i]Don't spend time beating on a wall, hoping to transform it into a door.[/i] ([b]Coco Chanel[/b]) This one is a wall.".
Test me with "look / e".
We have had to use square instead of angle brackets, but then, "in order to be irreplaceable one must always be different" (Coco Chanel).
(Marking these as substitutions which run on prevents unexpected paragraph breaks if they should appear immediately after the end of a sentence.)

View file

@ -8,7 +8,7 @@ For: Z-Machine
Suppose we want to allow the player to go to sleep some of the time:
{*}"Change of Basis"
A person is either awake or asleep. A person is usually awake.
The important thing to note here is that it does not work to say "the player is either asleep or awake". This is because the player is not necessarily one specific person or thing during the game: the identity of the player can be changed, as we will see later.
@ -20,18 +20,19 @@ So if we want to make rules about the properties of the player, we should attach
Now a few rules about changing from one state to the other:
{**}Instead of sleeping: now the player is asleep; say "You drop off."
Instead of doing something other than waking up, waiting or sleeping when the player is asleep:
say "Ssh! You're sleeping!"
Instead of sleeping when the player is asleep:
say "Zzzz."
Instead of waking up when the player is asleep:
now the player is awake;
say "You come to suddenly, wiping drool from your lips."
Instead of doing something other than looking or sleeping when the player is awake:
say "You'd really rather just sleep through this."
Test me with "wake up / sleep / look / z / sleep / wake up / look".

View file

@ -1,5 +1,4 @@
Example: ** Channel 1
Subtitle: Television that can be referred to by channel
Location: Understanding things by their properties
RecipeLocation: Televisions and Radios
Index: Channel 1. Television that can be referred to by channel
@ -8,30 +7,30 @@ For: Z-Machine
We might want to allow every television to be tuned to a channel (a number property) which the player could refer to, so that
WATCH CHANNEL 13
TURN OFF CHANNEL 4
- ``watch channel 13``
- ``turn off channel 4``
would be directed to the appropriate television object, if any television is turned on and tuned to the correct station. We might now write:
{*}"Channel"
A television is a kind of device. A television has a number called the channel. Understand the channel property as referring to a television. Understand "channel" as a television.
The Office is a room. The widescreen TV is a television in the Office. The fifties TV is a television in the Office.
Changing the channel of it to is an action applying to one thing and one number.
Understand "tune [something] to [number]" or "change channel of [something] to [number]" as changing the channel of it to.
Check changing the channel of something to:
if the noun is not a television, say "[The noun] cannot be tuned to a channel." instead.
Carry out changing the channel of something to:
now the channel of the noun is the number understood.
Report changing the channel of something to:
say "You tune [the noun] to channel [number understood]."
Instead of examining a television:
if the noun is switched off, say "[The noun] is currently turned off." instead;
let the chosen channel be the channel of the noun;
@ -40,13 +39,13 @@ would be directed to the appropriate television object, if any television is tur
say "[output entry][paragraph break]";
otherwise:
say "Snow fills the screen of [the noun]."
Table of Television Channels
current channel output
0 "The screen of [the noun] is completely black."
4 "A gloomy female news anchor describes the latest car bomb in Baghdad: 104 dead today, and no sign of change."
5 "A couple of contestants in spangled scarlet outfits are performing an energetic paso doble."
13 "On-screen, Ichiro is up to bat with one man on second and no outs."
Test me with "change channel of fifties tv to 4 / x channel 4 / switch on fifties / x channel 4 / switch on widescreen / tune fifties tv to 5 / x channel 5 / x fifties tv / x channel 4".

View file

@ -1,56 +1,47 @@
Example: *** Channel 2
Subtitle: Television with more advanced parsing
Location: Understanding things by their properties
RecipeLocation: Televisions and Radios
Index: Channel 2. Television with more advanced parsing
Description: Understanding channels (a number) in the names of televisions, with more sophisticated parsing of the change channel action.
For: Z-Machine
Our previous implementation of televisions ("Channel 1") doesn't allow the player to type things like
[ZL: I took more liberties here than usual; please review.]::
TUNE FIFTIES TELEVISION TO CHANNEL 4
Our previous implementation of televisions ([Channel 1]) doesn't accept ``tune fifties television to channel 4``; neither does it deal with player input like ``tune to channel 4 on fifties television``, nor ``tune to channel 4`` where no television is specified.
nor does it deal with player input like
When we are designing commands which involve two elements (here, a television and a channel number), it's usually a good idea to allow the player to specify those elements in either order, as we saw demonstrated briefly in [New commands for old grammar].
TUNE TO CHANNEL 4 ON FIFTIES TELEVISION
or
TUNE TO CHANNEL 4
where no television is specified. When we are designing commands which involve two elements (here, a television and a channel number), it's usually a good idea to allow the player to specify those elements in either order, as we saw demonstrated briefly in "New commands for old grammar".
We might, therefore, want to add a few refinements: first by defining a "[channel]" token that will accept input of the forms "[number]" and "channel [number]", and second by creating some additional "Understand" lines that will accept variant versions of the player's input.
We might, therefore, want to add a few refinements: first by defining a `"[channel]"` token that will accept input of the forms `"[number]"` and "channel [number]", and second by creating some additional "Understand" lines that will accept variant versions of the player's input.
{*}"Channel 2"
Section 1 - Televisions in General
A television is a kind of device.
A television has a number called the channel. Understand the channel property as referring to a television. Understand "channel" as a television.
Changing the channel of it to is an action applying to one thing and one number.
Understand "tune [television] to [channel]" or "change channel of [television] to [channel]" as changing the channel of it to.
Understand "tune [something] to [channel]" or "change channel of [something] to [channel]" as changing the channel of it to.
Understand "tune to [channel] on [television]" or "change to [channel] on [television]" as changing the channel of it to (with nouns reversed).
Understand "tune to [channel] on [something]" or "change to [channel] on [something]" as changing the channel of it to (with nouns reversed).
Understand "[number]" or "channel [number]" as "[channel]".
Check changing the channel of something to:
if the noun is not a television, say "[The noun] cannot be tuned to a channel." instead.
Carry out changing the channel of something to:
now the channel of the noun is the number understood.
Report changing the channel of something to:
say "You tune [the noun] to channel [number understood]."
Instead of examining a television:
if the noun is switched off, say "[The noun] is currently turned off." instead;
let the chosen channel be the channel of the noun;
@ -59,15 +50,15 @@ We might, therefore, want to add a few refinements: first by defining a "[channe
say "[output entry][paragraph break]";
otherwise:
say "Snow fills the screen of [the noun]."
Table of Television Channels
current channel output
0 "The screen of [the noun] is completely black."
Section 2 - The Scenario
The Office is a room.
The widescreen TV is a television in the Office. The fifties TV is a television in the Office.
And we add the scenario-specific content to our Table of Television Channels; in the case of channel 13, we provide for a changing sequence of events using text variations.
@ -77,10 +68,10 @@ And we add the scenario-specific content to our Table of Television Channels; in
4 "A gloomy female news anchor describes the latest car bomb in Baghdad: 104 dead today, and no sign of change."
5 "A couple of contestants in spangled scarlet outfits are performing an energetic paso doble."
13 "[one of]On-screen, Ichiro is up to bat with one man on second and no outs.[or]Ichiro has singled to first and the other man is on third.[or]The next batter is in the middle of flying out.[or]Everything looks rosy until the men in black pull off a double-play and retire the side.[or]The channel has cut to a commercial.[stopping]"
Test me with "test one / test two".
Test one with "change channel of fifties tv to 4 / x channel 4 / switch on fifties / x channel 4 / switch on widescreen / tune fifties tv to channel 5 / x channel 5 / x fifties tv / x channel 4".
Test two with "tune to channel 13 / widescreen / tune channel 13 to channel 5 / tune channel 5 to channel 3 / widescreen / x channel 3".

View file

@ -2,86 +2,86 @@ Example: *** Cheese-makers
Location: Why are scenes designed this way?
RecipeLocation: Saying Complicated Things
Index: TALK TO command used with scenes
Description: Scenes used to control the way a character reacts to conversation and comments, using a TALK TO command.
Description: Scenes used to control the way a character reacts to conversation and comments, using a ``talk to`` command.
For: Z-Machine
As we have seen, there are a number of different ways of controlling conversation in interactive fiction, and the best choice of way will depend quite a lot on what kind of work we're writing.
One common model is to replace Inform's default ASK and TELL commands with a TALK TO command. This gives the player less control than they would otherwise have: instead of asking a character about any topic under the sun, they're restricted to seeing (or not seeing) a single sequence of text that the author has written in advance. On the other hand, such a system is harder for the player to break (since they can never ask about a topic that the author hasn't implemented), and easier for the author to tie into plot developments. If we give TALK TO different output at each scene, we get conversation that is always tied to the current state of the plot.
One common model is to replace Inform's default ``ask`` and ``tell`` commands with a ``talk to`` command. This gives the player less control than they would otherwise have: instead of asking a character about any topic under the sun, they're restricted to seeing (or not seeing) a single sequence of text that the author has written in advance. On the other hand, such a system is harder for the player to break (since they can never ask about a topic that the author hasn't implemented), and easier for the author to tie into plot developments. If we give ``talk to`` different output at each scene, we get conversation that is always tied to the current state of the plot.
This is a design approach that works best in a game with a large number of short, focused scenes. For other kinds of conversation system design, compare the other examples listed in the Recipe Book.
{*}"The Cheese-makers" by Phrynichus.
Chapter 1 - Replacing old talk commands and making a new one
Here, using some techniques that will be discussed in the chapter on Understanding, we get rid of Inform's default handling of ASK and TELL, and create our own TALK TO action instead:
Here, using some techniques that will be discussed in the chapter on [Understanding], we get rid of Inform's default handling of ``ask`` and ``tell``, and create our own ``talk to`` action instead:
{**}Understand the commands "ask" and "tell" and "say" and "answer" as something new.
Understand "ask [text]" or "tell [text]" or "answer [text]" or "say [text]" as a mistake ("[talk to instead]").
Instead of asking someone to try doing something:
say "[talk to instead][paragraph break]".
Instead of answering someone that something:
say "[talk to instead][paragraph break]".
To say talk to instead:
say "(To communicate in [story title], TALK TO a character.) "
Understand "talk to [someone]" as talking to. Understand "talk to [something]" as talking to. Talking to is an action applying to one visible thing.
Chapter 2 - Specific scenes and talking
Now, suppose we have a situation -- say, a stage play -- in which it is appropriate to talk to different characters at different times. During the prologue of the play, no one else is on-stage, and the player is to address the audience directly:
Now, suppose we have a situation say, a stage play in which it is appropriate to talk to different characters at different times. During the prologue of the play, no one else is on-stage, and the player is to address the audience directly:
{**}Section 1 - Prologue
When play begins:
now right hand status line is "416 BC";
now left hand status line is "[location]".
Prologue is a scene. Prologue begins when play begins.
The Theater of Dionysus is a room.
The audience is a person in the Theater. "The usual audience looks on: the priests and judges in the front row, and then Athenians, metics, and foreigners." The audience can be prepared or unprepared. The description is "Have you ever seen such a company of perjurers, pathics, and thieves?" Understand "priest" or "priests" or "priest of dionysus" or "judge" or "judges" or "athenians" or "metics" or "foreigners" as the audience.
Instead of talking to the player when the Prologue is happening:
say "There will be plenty of occasion for muttered asides later in the play, but for now you must prepare the audience for things to come."
Instead of talking to the audience when the Prologue is happening:
say "Drawing breath, you turn to the audience, and offer them a genial, witty, colorful, and of course crude synopsis of what they are about to see; describing all the characters in unmistakable terms and not omitting the most important of them all, your august self.";
now the audience is prepared.
Instead of talking to the audience when the Prologue has happened:
say "You may only direct monologues to the audience when the other actors are off-stage. Otherwise, their characters might have to notice."
Prologue ends when the audience is prepared.
But there might follow a scene in which the player shouldn't talk at all:
{**}Section 2 - Parodos
Parodos is a scene. Parodos begins when Prologue ends.
When Parodos begins:
move the chorus to the theater.
Instead of talking to someone during Parodos:
say "Sssh: this moment belongs to the chorus. They've worked so hard on it, after all."
Parodos ends when the time since Parodos began is 4 minutes.
The chorus is a person. The description is "They are dressed in exaggerated rural costume and feminine masks, as they are meant to represent a company of female cheese-makers from the Spartan-occupied deme of Dekeleia." Understand "cheesewives" or "cheese-makers" or "chorus-leader" as the chorus.
Every turn during Parodos:
repeat through Table of Choral Events:
say "[output entry][paragraph break]";
blank out the whole row;
make no decision.
Table of Choral Events
output
"The chorus now begins its entry, accompanying with anapestic song its march up the eisodos."
@ -89,7 +89,7 @@ But there might follow a scene in which the player shouldn't talk at all:
"You stand aside as the chorus fills the orchestra and dances to and fro."
"The tune of the aulos-player grows more and more frenzied and then breaks off."
This last rule is a refinement borrowing from the Activities chapter, which gives characters different appearances in room descriptions depending on when we happen to look; because of the action of the play, we want to show the chorus and audience doing different things during different scenes.
This last rule is a refinement borrowing from the [Activities] chapter, which gives characters different appearances in room descriptions depending on when we happen to look; because of the action of the play, we want to show the chorus and audience doing different things during different scenes.
{**}Rule for writing a paragraph about the chorus during Parodos:
say "The chorus are dancing and singing their way[if the time since Parodos began is less than 3 minutes] up the long walkways onto the stage[otherwise] into position in the orchestra[end if]. [The audience] appear to be pricing their costumes to the nearest obol: woe to the producer who cheats them of their due share of spectacle."
@ -97,39 +97,39 @@ This last rule is a refinement borrowing from the Activities chapter, which give
And now a scene in which the player can talk several times to a character (Heracles) but has no useful dialogue with the chorus, the audience, or himself. The prohibition from talking to the audience after the Prologue is already written, but we'll supply some appropriate responses for talking to the player or the chorus during this scene:
{**}Section 3 - Episode
Episode is a scene. Episode begins when Parodos ends.
When Episode begins:
move Heracles to the theater;
say "The chorus falls silent, which is the cue: Heracles bursts out of the scene building."
Heracles is a man. The description is "Hard to mistake in his lion skin and boots, and carrying a formidable club." Heracles wears a lion skin and boots. He carries a formidable club. Heracles can be placid or annoyed. Heracles is placid. Heracles can be satisfied, intrigued, or unsatisfied. Heracles is unsatisfied.
Instead of talking to the chorus during Episode:
say "Your improvised flirtation with the chorus raises no response but a crude gesture from the chorus-leader, who seems to be modeling the role on Iambe."
Instead of talking to the player during Episode:
if Heracles is annoyed:
say "You mutter to yourself about men with more appetite than brain. The actor playing Heracles ignores you, but it's good odds he's scowling under his mask. He hates it when anyone but himself ad-libs for attention.";
otherwise:
now Heracles is annoyed;
say "'By the dog, he'll eat me if he gets a chance,' you mutter aside. [paragraph break]'What's that you say, my ignoble friend?' demands Heracles, hefting his club. He's not entirely joking: you've left the script just now."
Instead of talking to Heracles when Heracles is unsatisfied during Episode:
say "'Dear Heracles, friendly Heracles,' you begin, cringing out of the way as he responds with one of his affectionate ox-killing punches to the shoulder. [paragraph break]But Heracles falls still, and looks almost thoughtful, as tell him you know how he may rout the Spartans, woo all twenty-four lactic ladies, and tame his savage gut with a bathtubful of porridge. [paragraph break]'Speak on, little man,' he says.";
now Heracles is intrigued.
Instead of talking to Heracles when Heracles is intrigued during Episode:
say "It takes several exchanges for him to wrap his one-inch brain around your ten-inch plan; but in the end he embraces the scheme, the women, and your humble self.";
now Heracles is satisfied.
Every turn when not talking to someone during Episode:
repeat through Table of Episodic Events:
say "[output entry][paragraph break]";
blank out the whole row;
make no decision.
Table of Episodic Events
output
"With a fart and a roar, Heracles asks the world at large, and you in particular, where his dinner might be."
@ -141,20 +141,20 @@ And now a scene in which the player can talk several times to a character (Herac
"The chorus-leader extends the list of delicacies to include ox-brains, ham-hocks, barley, mullet, carrots, pigeons, lentils, radishes, peas, and apples both wine-dark and golden. The audience shifts on the benches. An expression of gloom settles over the Priest of Dionysus in the front row."
"Inspired by Euripides['] own Muse, the chorus-leader invents a mock-Alcaean hymn on the merits of chervil. This is clearly his swan-song: if you don't speak at last, the play will come to a halt."
"Silence descends."
Rule for writing a paragraph about Heracles during Episode:
say "[Heracles] stands at the center of the orchestra, with members of [the chorus] ranged on either side. [paragraph break][The audience] appear to be reserving their judgement, though they show signs of restiveness at the usual jokes: must there be a Heracles in [italic type]every[roman type] play?"
Episode ends successfully when Heracles is satisfied.
When Episode ends successfully:
say "That, of course, is your cue: you're to come back on as Pan thirty verses from now, and it takes time to put on the hooves and the woolly-legged trousers.";
end the story saying "You exit".
Episode ends disastrously when the number of filled rows in the Table of Episodic Events is 0.
When Episode ends disastrously:
end the story saying "The production has crashed to a halt".
Test me with "ask audience about me / tell audience about me / audience, hello / audience, jump / talk to me / talk to audience / g / talk to chorus / look / x heracles / talk to me / talk to audience / z / look / talk to heracles / g".

View file

@ -8,71 +8,71 @@ For: Z-Machine
Suppose we have a conversation system in which it is important to keep track of which subjects the player has heard mentioned. If we're careful to mark subjects in brackets, we can use the "printing the name of" activity to record which things have been mentioned so far:
{*}"Chronic Hinting Syndrome"
A subject is a kind of thing.
Knowledge relates various people to various subjects. The verb to know means the knowledge relation.
Awareness relates various people to various subjects. The verb to be aware of means the awareness relation.
Definition: a subject is pending if the player is aware of it and it is not known by the player.
Instead of thinking:
if the number of pending subjects is 0, say "You have no fresh leads at the moment.";
otherwise say "You recall that thus far you have not followed up with questions about [the list of pending subjects]."
After printing the name of a subject (called idea):
now the player is aware of the idea.
Now suppose that as an added convenience for the player, we let them turn on a mode in which useful conversation topics are always automatically highlighted in the text, so they don't waste time trying to follow up dead leads:
{**}Setting is a kind of value. The settings are bright and dull. Understand "on" as bright. Understand "off" as dull.
Highlighting is a setting that varies. Highlighting is dull.
Understand "highlighting [setting]" as setting highlighting. Setting highlighting is an action out of world, applying to one setting.
Carry out setting highlighting:
now highlighting is the setting understood.
Report setting highlighting:
say "Highlighting is now [if highlighting is dull]off[otherwise]on[end if]."
Before printing the name of a subject (called idea) when highlighting is bright:
unless the player knows the idea:
say "[bold type]".
After printing the name of a subject when highlighting is bright:
say "[roman type]".
...And the rest is peripheral.
{**}The Sickbay is a room. "A place arranged for Nathan's comfort, since his sickness has been prolonged and because he becomes so irritating when not comfortable." The Hallway is outside from the Sickbay.
A supporter can be untried or rejected. A supporter is usually untried.
The Sickbay contains a wobbly pedestal, a table, and a sickbed. Understand "bed" as the sickbed. The pedestal, the table, and the sickbed are supporters. Nathan is a man on the sickbed. The sickbed is scenery. The initial appearance of the wobbly pedestal is "A wobbly pedestal near the door has sometimes been known to support vases of flowers, but is currently bare." The initial appearance of the table is "There is also a table of a more ordinary sort."
Nathan can be active or passive.
After printing the name of Nathan: now Nathan is passive.
Instead of putting the sculpture on the table:
now the table is rejected;
say "'[Not there],' [Nathan] snaps. 'The table is way too far from the sickbed.'"
Instead of putting the sculpture on the sickbed:
now the sickbed is rejected;
say "'[Not there],' [Nathan] rebukes you. 'You don't want me knocking it over if I roll around. In pain.'"
Instead of putting the sculpture on the pedestal:
now the pedestal is rejected;
say "The pedestal starts to wobble so ominously that you don't dare let go.
'[Not there],' says [Nathan]. 'That thing is falling apart.'"
Before putting something on the down: try dropping the noun instead.
To say not there:
if all the supporters are rejected:
say "Look, the floor would be fine";
@ -80,84 +80,84 @@ Now suppose that as an added convenience for the player, we let them turn on a m
say "Yeah, anywhere but there, I'm afraid";
otherwise:
say "Come on, use your head -- I can't be watching you all the time, I'm sick".
Instead of going outside when the player is carrying the sculpture:
say "You've still got this sculpture to get rid of."
Instead of going outside when the breakage is pending:
say "You can't very well smash in front of [Nathan] his prize sculpture and then just scamper off without saying something. Appealing though the thought is at the moment."
Instead of going outside when a subject which is not the breakage is pending:
say "'Yeah, go ahead,' says [Nathan], with a martyr-like air. 'It's probably best that you don't hear about [the random pending subject]. It's not something I'd go into normally.'"
The breakage is a subject. The description is "It's not a big deal. I'll just buy a new [mental wave generator].' A slight awkward pause. 'I mean, this one was a [gift], but don't worry about it". Understand "accident" or "smashing" or "breaking" or "shard" or "mishap" or "shards" or "mistake" as the breakage. Understand "sculpture" as the breakage when the player is not carrying the sculpture.
Instead of saying sorry in the presence of Nathan when the player is aware of the breakage:
try asking Nathan about the matter of breakage.
Instead of asking Nathan to try saying sorry when the player is aware of the breakage:
try asking Nathan about the matter of breakage.
The mental wave generator is a subject. The description is "They're kind of expensive but I can save up. I really need one, though, because of my [dreams]".
The dreams is a subject. The description is "They're not the kind of dream you want to have.' He closes his eyes and contemplates these undesirable dreams. 'Have you ever woken up convinced you were dead? No, probably not. Well... At any rate, I need the [generator]. Oh, don't worry, they're expensive but not so expensive that I won't be able to save up for another, in a few months".
The gift is a subject. The description is "[The mental wave generator] was a present from a girl named [Shari]. Actually I'm not sure she'd take to being called a girl".
Shari is a subject. The description is "Look, let's just not go into it, okay? I don't really want to relive all that right now. I still have a six-inch [scar] shaped like a banana in the middle of my back".
The scar is a subject.
Instead of asking Nathan about the matter of the scar:
say "Nathan clears his throat, lowers his voice, and begins to tell you the story...";
end the story saying "End of Demo -- Register to Continue!!"
Understand "ask [someone] about [any subject]" as asking it about the matter of.
Asking it about the matter of is an action applying to one thing and one visible thing.
Check asking it about the matter of:
if the player is not aware of the second noun, say "What [second noun]?" instead;
if the noun does not know the second noun, say "'I've no idea,' replies [the noun]." instead;
if the player knows the second noun, say "You've already covered that. The response was '[description of the second noun].'" instead.
Carry out asking it about the matter of:
now the player knows the second noun.
Report asking it about the matter of:
say "'[description of the second noun],' says [the noun]."
Instead of telling Nathan about something:
say "He pinches the bridge of his nose. 'I can't really follow this right now,' he says. 'I'm sorry.'"
Instead of asking Nathan about something:
say "He shrugs weakly."
When play begins:
say "'Just put that down anywhere,' says [Nathan], as you come into the room. He's sitting in the sickbed with his legs straight out in front of him. 'I don't care where.' His voice is weak, but it sharpens up for the last remark: 'And don't make a lot of noise about it.'
Considering that he woke you from a sound slumber to beg you to bring this thing over, his attitude is a bit much. You stare dubiously at the awkward crystal sculpture in your hands.";
now Nathan knows every subject.
Instead of asking Nathan about something while the player carries the sculpture, say "[Nathan] moans dramatically and refuses to be drawn into conversation."
The player is carrying an awkward crystal sculpture. Understand "objet" or "objet de hideous" as the sculpture. The description of the sculpture is "It might possibly be natural, or it might be man-made. It might appeal to someone, but it is certainly not to your tastes."
Instead of showing the sculpture to Nathan:
say "'Please put it anywhere,' he says."
Instead of giving the sculpture to Nathan:
say "'No, it doesn't work if I touch it. That's why I couldn't-- well, just put it down.'"
After dropping the sculpture:
now the player is aware of the breakage;
now the sculpture is nowhere;
say "You are incredibly careful, but somehow the sculpture slips -- you might almost say slithers -- from your fingers and crashes into a thousand shards at the feet of [Nathan].
There is a tense silence."
Before reading a command: now Nathan is active.
Every turn while not asking:
if Nathan is passive, rule succeeds;
if the player is carrying the sculpture:
@ -171,7 +171,7 @@ Now suppose that as an added convenience for the player, we let them turn on a m
if a subject is pending:
choose a random row in the Table of Offhand Reminiscences;
say "[line entry][paragraph break]".
Table of Offhand Reminiscences
line
"'It actually is kind of a funny story about [the random pending subject],' [Nathan] remarks casually."
@ -180,5 +180,6 @@ Now suppose that as an added convenience for the player, we let them turn on a m
"'I don't know why I brought up [the random pending subject] just now,' [Nathan] comments. 'Don't mention it to anyone, if you don't mind.'"
"'Okay, see, the thing about [the random pending subject] is...' [paragraph break]'Yes?' you ask, on cue.[paragraph break]'...never mind.'"
"[Nathan] makes an explosive exasperated sound. 'Don't you want to ask me about [the random pending subject]?' he demands."
Test me with "highlighting bright / put sculpture on pedestal / put it on table / put it on sickbed / drop it / think / ask nathan about breakage / think / ask him about generator / ask him about dreams / ask him about gift / ask him about shari / ask him about scar".

View file

@ -8,26 +8,27 @@ For: Z-Machine
It's fairly common that we want to be able to refer to a container in terms of what it has in it: a bottle of wine, a salt shaker, a chicken sandwich. The player is free to remove the contents again, and the object will go back to using its usual name:
{*}"Cinco"
Cinco de Mayo Fundraiser is a room.
The taco shell is an edible thing in the Fundraiser. It is a portable container. It has carrying capacity 1.
Understand "[something related by containment] taco" as the taco.
Rule for printing the name of the taco shell while not inserting or removing:
if the taco contains something (called filling), say "[filling] taco";
otherwise say "taco shell";
omit contents in listing.
The player carries shredded beef. It is edible.
The taking action has an object called source (matched as "from").
Setting action variables for taking:
now source is the holder of the noun.
Report taking something from the taco shell:
say "You gingerly pick [the noun] out of the taco shell." instead.
Test me with "x taco / put shredded beef in taco / get taco / i / x shredded beef taco / get shredded beef / x shredded beef taco".

View file

@ -8,13 +8,13 @@ For: Z-Machine
The only point we need to be careful about is that the carousel is simulated twice over, in the following text: once in the built-in way that objects are inside other objects, so that the luggage items are objects contained in the carousel object; but then again by the "circle of misery" list, a ring buffer keeping track of what order things are in. We need to be careful that these two records do not fall out of synchrony: anything put into the carousel must be added to the list, anything taken out must be removed. (In fact we forbid things to be added, for simplicity's sake.)
{*}"Circle Of Misery"
Luggage item is a kind of thing. The blue golf bag, the leopardskin suitcase, the green rucksack and the Lufthansa shoulder-bag are luggage items.
Heathrow Baggage Claim is a room. The carousel is a container in Heathrow. "The luggage carousel, a scaly rubbered ring, does for the roundabout what Heathrow Airport does for the dream of flight: that is, turns the purest magic into the essence of boredom, only with extra stress. [if the number of entries in the circle of misery is 0]For once it stands idle. Perhaps it's broken.[otherwise]The baggage approaching you now: [the circle of misery with indefinite articles]."
The circle of misery is a list of objects that varies.
When play begins:
now all the luggage items are in the carousel;
add the list of luggage items to the circle of misery.
@ -25,14 +25,15 @@ The list "circle of misery" is our ring, in which entry 1 is considered to be th
rotate the circle of misery;
let the bag be entry 1 of the circle of misery;
say "The carousel trundles on, bringing [a bag] to within reach."
After taking a luggage item (called the bag):
remove the bag from the circle of misery, if present;
say "Taken."
Before doing something with a luggage item (called the bag) which is in the carousel:
if the bag is not entry 1 of the circle of misery, say "[The bag] is maddeningly out of range. You'll have to wait for it to come round." instead.
Instead of inserting something into the carousel, say "In recent years, the authorities have tended to frown upon depositing bags in random places at airports."
Test me with "get suitcase / get suitcase / get suitcase / get suitcase / look / get golf bag / look / get golf bag".

View file

@ -7,16 +7,16 @@ For: Z-Machine
We start by creating a camera and a photograph object. As usual when we want to have a kind of object that can be dispensed in bulk, we start off with a bunch of identical instances of the object out of play (in this case, kept in an out-of-play container called "film roll"); we can then move them into play and give them characteristics when they're needed.
Each photograph can depict exactly one thing -- we're assuming that the player is not a landscape photographer here -- so we create a relation to indicate what is shown by each photograph. We'll then use that relation to determine how photographs are described, named, and parsed:
Each photograph can depict exactly one thing we're assuming that the player is not a landscape photographer here so we create a relation to indicate what is shown by each photograph. We'll then use that relation to determine how photographs are described, named, and parsed:
{*}"Claims Adjustment"
A photograph is a kind of thing. 36 photographs are in the film roll.
Appearance relates one thing to various photographs. The verb to be shown by means the appearance relation.
The description of a photograph is usually "It shows [a random thing which is shown by the item described]."
Understand "of [something related by reversed appearance]" as a photograph.
This allows the player to refer to any photograph by its subject: useful if we have a large number of them.
@ -24,36 +24,36 @@ This allows the player to refer to any photograph by its subject: useful if we h
Now we create an action to let the player use the camera and generate these photograph objects:
{**}The player carries a cheap instant camera.
Understand "photograph [something] with [camera]" as photographing. Understand "photograph [something] with [something preferably held]" as photographing. Photographing is an action applying to one visible thing and one carried thing, requiring light.
The photographing action has an object called the selected film.
Setting action variables for photographing:
let N be a random photograph in the film roll;
now the selected film is N.
Check photographing:
if the second noun is not the camera, say "You need a camera for that purpose." instead.
Check photographing:
if the noun is the camera, say "Sadly impossible." instead.
Check photographing:
if the selected film is nothing, say "You're out of film." instead.
Carry out photographing:
now the noun is shown by the selected film;
move the selected film to the player.
Report photographing:
say "Your camera instantly spits out [a selected film]."
Now we use two activities from the Activities chapter to describe the photographs to the player more elegantly:
Now we use two activities from the [Activities] chapter to describe the photographs to the player more elegantly:
{**}After printing the name of a photograph (called target):
say " of [a random thing which is shown by the target]".
After printing the plural name of a photograph (called target):
let N be the holder of the target;
say " of [a list of things which are shown by photographs which are held by N]";
@ -62,11 +62,12 @@ Now we use two activities from the Activities chapter to describe the photograph
And finally we provide a brief scenario to give the player something to take pictures of:
{**}The Treasure Room is a room. "Despite the fancy name, this is no more than a closet -- albeit a closet with its own special circuit on the house alarm."
The Treasure Room contains a small Degas, a Ming vase, and a collection of South African krugerrands. The player is carrying insurance forms, a first-class stamp, and a security envelope.
The description of the forms is "Completely filled out in black ink in block letters: now all you need to do is attach photographic evidence of the objects you wish to insure."
Test me with "photograph degas / i / photograph degas / i / x photograph of degas / photograph me / x photograph of me / i / photograph vase / photograph camera / photograph collection / g / i / test more".
Test more with "x photograph of collection / x photograph of krugerrands / x photograph of collection of south african krugerrands / photograph photograph of degas / x photograph of photograph of degas".

View file

@ -10,23 +10,23 @@ For: Z-Machine
Here is what the game looks like in Inform:
{*}"Cloak of Darkness"
The story headline is "A basic IF demonstration."
Use scoring.
The maximum score is 2.
Whatever room we define first becomes the starting room of the game, in the absence of other instructions:
{**}Foyer of the Opera House is a room. "You are standing in a spacious hall, splendidly decorated in red and gold, with glittering chandeliers overhead. The entrance from the street is to the north, and there are doorways south and west."
Instead of going north in the Foyer, say "You've only just arrived, and besides, the weather outside seems to be getting worse."
We can add more rooms by specifying their relation to the first room. Unless we say otherwise, the connection will automatically be bidirectional, so "The Cloakroom is west of the Foyer" will also mean "The Foyer is east of the Cloakroom":
{**}The Cloakroom is west of the Foyer. "The walls of this small room were clearly once lined with hooks, though now only one remains. The exit is a door to the east."
In the Cloakroom is a supporter called the small brass hook. The hook is scenery. Understand "peg" as the hook.
Inform will automatically understand any words in the object definition ("small", "brass", and "hook", in this case), but we can add extra synonyms with this sort of Understand command.
@ -36,9 +36,9 @@ Inform will automatically understand any words in the object definition ("small"
This description is general enough that, if we were to add other hangable items to the game, they would automatically be described correctly as well.
{**}The Bar is south of the Foyer. The printed name of the bar is "Foyer Bar". The Bar is dark. "The bar, much rougher than you'd have guessed after the opulence of the foyer to the north, is completely empty. There seems to be some sort of message scrawled in the sawdust on the floor."
The scrawled message is scenery in the Bar. Understand "floor" or "sawdust" as the message.
Neatness is a kind of value. The neatnesses are neat, scuffed, and trampled. The message has a neatness. The message is neat.
We could if we wished use a number to indicate how many times the player has stepped on the message, but Inform also makes it easy to add descriptive properties of this sort, so that the code remains readable even when the reader does not know what "the number of the message" might mean.
@ -59,7 +59,7 @@ This command advances the state of the message from neat to scuffed and from scu
{**}Instead of doing something other than going in the bar when in darkness:
if the message is not trampled, now the neatness of the message is the neatness after the neatness of the message;
say "In the dark? You could easily disturb something."
Instead of going nowhere from the bar when in darkness:
now the message is trampled;
say "Blundering around in the dark isn't a good idea!"
@ -67,28 +67,29 @@ This command advances the state of the message from neat to scuffed and from scu
This defines an object which is worn at the start of play. Because we have said the player is wearing the item, Inform infers that it is clothing and can be taken off and put on again at will.
{**}The player wears a velvet cloak. The cloak can be hung or unhung. Understand "dark" or "black" or "satin" as the cloak. The description of the cloak is "A handsome cloak, of velvet trimmed with satin, and slightly splattered with raindrops. Its blackness is so deep that it almost seems to suck light from the room."
Carry out taking the cloak:
now the bar is dark.
Carry out putting the unhung cloak on something in the cloakroom:
now the cloak is hung;
increment score.
Carry out putting the cloak on something in the cloakroom:
now the bar is lit.
Carry out dropping the cloak in the cloakroom:
now the bar is lit.
Instead of dropping or putting the cloak on when the player is not in the cloakroom:
say "This isn't the best place to leave a smart cloak lying around."
When play begins:
say "[paragraph break]Hurrying through the rainswept November night, you're glad to see the bright lights of the Opera House. It's surprising that there aren't more people about but, hey, what do you expect in a cheap demo game...?"
Understand "hang [something preferably held] on [something]" as putting it on.
Test me with "s / n / w / inventory / hang cloak on hook / e / s / read message".
And that's all. As always, type TEST ME to watch the scenario play itself out.
And that's all. As always, type ``test me`` to watch the scenario play itself out.

View file

@ -7,10 +7,10 @@ For: Z-Machine
It has sometimes been suggested that IF should allow for the player to use adverbs, so that doing something "carefully" will have a different effect from doing it "quickly". There are several inherent challenges here: it's a good idea to make very sure the player knows all their adverb options, and the list of possibilities should probably not be too long.
Another trick is that adverbs complicate understanding commands, because they can occur anywhere: one might type >GO WEST CAREFULLY or >CAREFULLY GO WEST, and ideally the game should understand both. After reading a command is the best point to do this sort of thing, because we can find adverbs, interpret them, and remove them from the command stream. So:
Another trick is that adverbs complicate understanding commands, because they can occur anywhere: one might type ``go west carefully`` or ``carefully go west``, and ideally the game should understand both. After reading a command is the best point to do this sort of thing, because we can find adverbs, interpret them, and remove them from the command stream. So:
{*}"Cloves"
Manner is a kind of value. The manners are insouciantly, sheepishly, and defiantly.
Now we have, automatically, a value called manner understood to be used whenever parsing manners, and we can use this even during the "after reading a command" stage, so:
@ -21,42 +21,43 @@ Now we have, automatically, a value called manner understood to be used whenever
otherwise:
say "But how, my dear boy, how? You simply can't do something without a pose. Thus far you have mastered doing things [list of manners].";
reject the player's command.
When play begins:
now the left hand status line is "Behaving [manner understood]";
now the right hand status line is "[location]";
now the manner understood is insouciantly.
The Poseur Club is a room. "Lady Mary is laid out on a sofa, her wrists bandaged importantly[if the manner understood is insouciantly] -- and she looks all the more depressed by your indifference to her state[end if]; Salvatore is at the gaming table, clutching his hair with both hands[if the manner understood is defiantly] -- though he looks up long enough to snarl in response to that expression of yours[end if]; Frackenbush is muttering lines from another of his works in progress, as though poetry has nearly made him mad[if the manner understood is sheepishly]. But he spares you a reassuring smile. He's not a bad fellow, Frackenbush[end if].
The usual people, in short."
Instead of doing something other than waiting or looking:
say "Dear. No. That would smack of effort."
Instead of waiting when the manner understood is sheepishly:
say "You scuff your foot against the ground for a moment, and allow a seemly blush to creep over your cheek. It's quite effective, you are sure, though you can't look up and see how it is going."
Instead of waiting when the manner understood is insouciantly:
say "Thrusting your hands into your pockets, you whistle a jaunty tune.
'Do shut up,' says a Melancholy Poseur from over by the window."
Instead of waiting when the manner understood is defiantly:
say "You raise your chin and give a pointed glance around the room as though to say that you are waiting for someone; you are unembarrassed about waiting for her; you have by no means been stood up; and the first person to comment will receive a poke in the eye."
Before looking when the manner understood is sheepishly:
say "You gaze up from under your brows..."
Before looking when the manner understood is defiantly:
say "You cast a withering gaze over the room."
Before looking when the manner understood is insouciantly:
if turn count > 1,
say "You turn an eye to your surroundings, looking faintly-- just faintly-- amused."
Test me with "wait / wait insouciantly / sheepishly look / defiantly look / look insouciantly".
The qualification about turn count is to prevent this before message from occurring when the player first looks around the room (automatically) at the start of play.
Note that to test this example, one must type INSOUCIANTLY TEST ME, and not simply TEST ME: a poseur's work is never done.
Note that to test this example, one must type ``insouciantly test me``, and not simply ``test me``: a poseur's work is never done.

View file

@ -5,18 +5,19 @@ Index: Murderer chosen randomly at start of play
Description: A murderer for the mystery is selected randomly at the beginning of the game.
For: Z-Machine
"When play begins" is the best point to initialize any aspects of the game that are meant to change between playings. For instance, in this scenario, we would randomly select one of the other characters to be guilty of murder:
"When play begins" is the best point to initialise any aspects of the game that are meant to change between playings. For instance, in this scenario, we would randomly select one of the other characters to be guilty of murder:
{*}"Clueless"
The murderer is a person that varies.
When play begins:
now the murderer is a random person who is not the player.
The Billiards Room is a room. Colonel Mustard and Professor Plum are men in the Billiards Room. Miss Scarlet and Mrs White are women in the Billiards Room.
Instead of examining the murderer:
say "[The noun] certainly looks fiendish!"
Test me with "x mustard / x plum / x scarlet / x white".

View file

@ -8,7 +8,7 @@ For: Z-Machine
The "reading a command" activity is not the only point at which we can interact with snippets, as it happens; it is merely the most useful. "The player's command" can be consulted at other points, however, as in this example of your somewhat deaf (or distracted, or simply cussed) Aunt:
{*}"Complimentary Peanuts"
Instead of asking Aunt Martha to try doing something:
repeat through Table of Aunt Martha's Commentary:
if player's command includes topic entry:
@ -22,7 +22,7 @@ The topic understood is also a snippet, so that whenever one has been generated,
Telling someone about something is speech.
Answering someone that something is speech.
Asking someone for something is speech.
Instead of speech when the noun is Aunt Martha:
repeat through Table of Aunt Martha's commentary:
if the topic understood includes topic entry:
@ -30,29 +30,32 @@ The topic understood is also a snippet, so that whenever one has been generated,
rule succeeds;
say "'Hmmf,' says Aunt Martha."
This is superior to checking "the player's command" because we do not want ASK MARTHA ABOUT FRENCH FRIES to trigger the "Martha" keyword, only the "french fries" keywords.
This is superior to checking "the player's command" because we do not want ``ask martha about french fries`` to trigger the "Martha" keyword, only the "french fries" keywords.
{**}The Empyrean Shuttle Bay is a room. "From here you have an excellent view of the colony world, which looks... well, it looks discouragingly orange. But terraforming is in progress."
Aunt Martha is a woman in the Empyrean Shuttle Bay. A gleaming shuttle and a stack of rations are in the Shuttle Bay. The shuttle is a vehicle. "Your shuttle awaits."
Table of Aunt Martha's Commentary
topic commentary
"shuttle" "'Shuttles! I hate shuttles,' Aunt Martha grumbles. 'Give me an airplane! AIRPLANE.'"
"airplane/airport" "'Those were the days,' Aunt Martha agrees, plainly reliving the days when she wore a blue-and-white uniform and passed out packets of salted pretzels."
"rations" "'Do you think there are any peanuts in there?' she asks in a wistful tone."
Test me with "martha, get in the shuttle / martha, for pity's sake, do you see an airplane around here? / martha, pass me the rations".
This means that Martha will respond to keywords regardless of the setting in which they occur. For instance:
>martha, get in the shuttle
"Shuttles! I hate shuttles," Aunt Martha grumbles. "Give me an airplane! AIRPLANE."
``` transcript
>martha, get in the shuttle
"Shuttles! I hate shuttles," Aunt Martha grumbles. "Give me an airplane! AIRPLANE."
>martha, for pity's sake, do you see an airplane around here?
"Those were the days," Aunt Martha agrees, plainly reliving the days when she wore a blue-and-white uniform and passed out packets of salted peanuts.
>martha, for pity's sake, do you see an airplane around here?
"Those were the days," Aunt Martha agrees, plainly reliving the days when she wore a blue-and-white uniform and passed out packets of salted peanuts.
>martha, pass me the rations
"Do you think there are any peanuts in there?" she asks in a wistful tone.
>martha, pass me the rations
"Do you think there are any peanuts in there?" she asks in a wistful tone.
```
This is not the stuff of which Loebner-winning chatbots are made, admittedly, but it is occasionally a useful alternative to stricter modes of command-parsing.

View file

@ -5,25 +5,25 @@ Index: Describing objects with parts
Description: Objects which automatically include a description of their component parts whenever they are examined.
For: Z-Machine
It is straightforward to make a rule that anything with parts must mention all those parts during an EXAMINE command:
It is straightforward to make a rule that anything with parts must mention all those parts during an ``examine`` command:
{*}"Control Center"
After examining a thing when something is part of the noun:
say "[The noun] includes [a list of things which are part of the noun]."
The Control Center is a room. "Here you are at the Control Center of the universe."
The Universe Management Computer is a fixed in place thing in the Control Center. "The Universe Management Computer sits directly before you, unguarded." The description of the Universe Management Computer is "The computer is so large that you would be unable to operate it all from one position. Alas, it does not come with a manual."
A chartreuse indicator light, an ennui meter, a golden knob settable to 15,000 positions, a toothpick dispenser, and a button labeled RESTART are part of the Universe Management Computer.
The command chair is an enterable supporter in the Control Center. It is pushable between rooms. "Because the computer is too large for you to reach all of the front panel from a standing position, there is a command chair on casters which allows you to push back and forth." The description of the command chair is "Quite ordinary, really, but for the heady rush of power that comes of sitting in it.". Some casters are part of the command chair.
Now whenever we look at any object with components, we will first see the description, then a list of parts which belong to it. The following refinement brings in elements of later chapters, but it may be worth noting: because we've written our rule as an "After examining...", anything that pre-empts the operation of the examine command will also prevent that rule from occurring. So for instance:
{**}A hair-thick needle is part of the ennui meter.
Instead of examining the ennui meter: say "You can't be bothered."
...would not result in the needle being mentioned.

View file

@ -7,55 +7,55 @@ For: Z-Machine
In a very dense environment, we might want to offer the player room descriptions in which only the currently-interesting items are mentioned, while other objects are suppressed even if they are present. In effect, this takes the idea of scenery and makes it more flexible: different things might become background objects or foreground objects at different times during play.
There are a wide range of possible reasons to do this -- to shift the narrative emphasis, to change the mood of the game by highlighting different parts of the environment, to show the game from the perspective of different viewpoint characters -- but in the following example, our goal is to show the player only the objects that are currently useful for puzzles.
There are a wide range of possible reasons to do this to shift the narrative emphasis, to change the mood of the game by highlighting different parts of the environment, to show the game from the perspective of different viewpoint characters but in the following example, our goal is to show the player only the objects that are currently useful for puzzles.
To do this, we need some notion of what puzzles are currently available and unsolved, so we make an "unsolved" adjective; we also need to know which things solve the puzzle, so we create a "resolving" relation, to indicate which objects resolve which problems.
Given that information, we can create rules about which objects in the game world are currently interesting, which are currently dull, and describe accordingly:
{*}"Copper River"
Use scoring.
Section 1 - Procedure
Resolving relates various things to various things. The verb to resolve means the resolving relation.
Definition: a thing is interesting if it is not dull.
Definition: a person is dull:
no.
Definition: a thing is dull:
if it is unsolved, no;
if it resolves an unsolved thing, no;
yes.
Definition: a supporter is dull:
if it is unsolved, no;
if it resolves an unsolved thing, no;
if it supports an interesting thing, no;
yes.
Definition: a container is dull:
if it is unsolved, no;
if it resolves an unsolved thing, no;
if it contains an interesting thing, no;
yes.
After choosing notable locale objects:
repeat with item running through unsolved things:
set the locale priority of the item to 1.
For printing a locale paragraph about a dull thing (called item):
now the item is mentioned.
Before printing a locale paragraph about a supporter (called item):
now every dull thing on the item is mentioned.
Before printing a locale paragraph about a container (called item):
now every dull thing on the item is mentioned.
Instead of searching a supporter:
if the noun supports something interesting:
say "[A list of interesting things on the noun] [are] on [the noun]";
@ -66,7 +66,7 @@ Given that information, we can create rules about which objects in the game worl
say "There's nothing very useful here, only [a list of dull things on the noun].";
otherwise:
say "[The noun] [are] completely bare."
Instead of searching a container:
if the noun contains something interesting:
say "[A list of interesting things in the noun] [are] in [the noun]";
@ -77,56 +77,55 @@ Given that information, we can create rules about which objects in the game worl
say "There's nothing very useful here, only [a list of dull things in the noun].";
otherwise:
say "[The noun] [are] completely empty."
Before listing contents when not taking inventory: group dull things together.
Rule for grouping together dull things: say "assorted dull items".
Section 2 - Scenario World and Objects
The Kitchen is a room. "Your Aunt Fiona's kitchen looks as though it has been at the eye of a glitter storm. Fine, sparkling grit dusts every surface. The appliances are slightly askew, too, as though they hadn't quite settled after a vigorous earthquake."
The shelf is a scenery supporter in the Kitchen. On the shelf is a can of beans, a can of potato leek soup, and a tin of deflating powder.
The cabinet is a scenery container in the Kitchen. In the cabinet is a book of matches, a bottle of descaling solution, a fish hook, and a rusty knife. It is openable and closed.
The counter is a scenery supporter in the Kitchen. On the counter is an espresso machine, a blender, and a mortar. The blender and the mortar are containers. In the mortar is a pestle. Understand "countertop" as the counter.
The stove is a scenery supporter in the Kitchen. The oven is part of the stove. The oven is a closed openable container.
The refrigerator is a fixed in place container in the Kitchen.
Understand "fridge" as the refrigerator.
The description is "The refrigerator is a dull blue-green, and has a puffy, marshmallow texture on the outside, which means that it's no good for sticking magnets to. Aunt Fiona has never been willing to explain where she got it." The refrigerator is openable and closed.
In the refrigerator are a bottle of ice wine, a bag of carrot sticks, and an egg.
Aunt Fiona is a woman in the Kitchen. Aunt Fiona can be inflated or deflated. Aunt Fiona is inflated. "[if Aunt Fiona is inflated]Aunt Fiona stands nearby. Or perhaps 'stands' is the wrong word: she has been sort of puffed up in her own skin like a balloon, and is now propped in a corner of the room with her head lolling back[otherwise]Aunt Fiona stands -- on her own two slender legs -- at the center of the room[end if]."
Every turn when Fiona is unsolved and Fiona can see the player:
if a random chance of 1 in 3 succeeds:
say "[one of]Aunt Fiona's eyes follow you, wide and desperate, but it doesn't look like she's able to do anything[or]Aunt Fiona is still looking reproachful[or]A faint gurgling comes from Aunt Fiona[or]Aunt Fiona makes a funny croak noise[or]Aunt Fiona is still having trouble speaking. Perhaps her throat is as swollen as the rest of her[or]Aunt Fiona twitches[stopping]."
There is a thing called a salmon. Understand "fish" as the salmon. The salmon can be scaly or prepared. The salmon is scaly. The description is "[if scaly]It looks delicious, but is still covered with scales[otherwise]The salmon has been scaled and is ready to eat[end if]."
Before printing the name of the salmon when the salmon is scaly:
say "very scaly ".
Section 3 - Scenario Puzzles
Definition: Aunt Fiona is unsolved if she is inflated.
Definition: the salmon is unsolved:
if the salmon is off-stage, no;
if the salmon is scaly, yes;
no.
The deflating powder resolves Aunt Fiona.
Instead of putting the deflating powder on Aunt Fiona:
try throwing the deflating powder at Aunt Fiona.
Instead of giving the deflating powder to Aunt Fiona:
try throwing the deflating powder at Aunt Fiona.
Instead of throwing the deflating powder at Aunt Fiona:
if Aunt Fiona is inflated:
say "You toss some of the powder in Aunt Fiona's direction, and with a sudden gaseous HUFF! she returns to her usual shape and size. [paragraph break]'Well!' she says, brushing herself off. 'That was bracing!' [paragraph break]You give her an embarrassed smile, to apologize for not curing her faster.";
@ -134,16 +133,16 @@ Given that information, we can create rules about which objects in the game worl
increase the score by 2;
otherwise:
say "[one of]You throw another hefty dose of the powder at your aunt. [paragraph break]'Thank you, child,' she says, sneezing. 'But I think you've done enough now.'[or]You throw another hefty dose of the powder at your aunt. [paragraph break]'You're too kind,' she wheezes, through a cloud of glittering dust.[or]You've probably done enough with the powder.[stopping]".
Every turn when Aunt Fiona is deflated and the salmon is off-stage:
move the salmon to the counter;
say "'At least they didn't get this,' she says, producing from somewhere on her person a fresh-caught salmon. An odd pattern around its eye sockets makes it looks comically as though it wears spectacles. 'It's the Salmon of Knowledge,' she explains casually. 'We just need to scale and cook it.'"
The bottle of descaling solution resolves the salmon.
Does the player mean putting the descaling solution on the fish hook: it is unlikely.
Does the player mean putting the descaling solution on the salmon: it is very likely.
Instead of putting the bottle of descaling solution on the salmon:
if the salmon is scaly:
now the salmon is prepared;
@ -151,6 +150,6 @@ Given that information, we can create rules about which objects in the game worl
increase the score by 2;
otherwise:
say "'Don't do that,' Aunt Fiona warns you. 'Excessive applications could damage the flesh.'"
Test me with "look / get powder / drop powder / look / look in cabinet / get powder / put powder on fiona / look / open cabinet / look in cabinet / get solution / open fridge / put solution in fridge / look / get solution / put solution on salmon / look".

View file

@ -8,20 +8,20 @@ For: Z-Machine
Making major changes to display features, such as the construction of the status line, sometimes requires that we rely on Inform 6 in bulk; here is how we might produce the Trinity-style status line, with the location centered at the top center of the screen.
{*}"Corner of No and Where"
No is a room. Where is west of No.
Rule for constructing the status line:
print the location in the center of the status line;
rule succeeds.
To print the location in the center of the status line:
(- PrintCenteredStatus(); -).
Include (-
Array printed_text --> 64;
[ PrintCenteredStatus i j;
@set_cursor 1 0;
i = 0->33;
@ -34,9 +34,10 @@ Making major changes to display features, such as the construction of the status
print (name) location;
spaces j-1;
];
-)
Test me with "w / e".
In fact, as we've already seen, many extra modifications to the display behavior are possible using Basic Screen Effects.
In fact, as we've already seen, many extra modifications to the display behaviour are possible using Basic Screen Effects.

View file

@ -8,12 +8,12 @@ For: Z-Machine
The following relies on quite a number of features we haven't met yet: tables, rules for printing names, instructions for understanding the player's commands. It is offered simply as an example of how a fully implemented book might be handled in Inform.
{*}"Costa Rican Ornithology"
A book is a kind of thing. Understand "book" as a book. A book has a table name called the contents.
Instead of consulting a book about a topic listed in the contents of the noun:
say "[reply entry][paragraph break]".
Report consulting a book about:
say "You flip through [the noun], but find no reference to [the topic understood]." instead.
@ -30,25 +30,26 @@ We will come back to the idea of tables and table names later, but for now the i
"[red]" or "[red] bird/macaw" "You flip through the Guide for a while and eventually discover a reference to the [scarlet macaw], which appears to correspond with what you see before you."
"quetzal/trogon" or "resplendent trogon" "The entry on the quetzal is quite lyrical, describing its brilliant plumage, flashing and igniting in the sunshine, which is supposedly sufficient to lure birdwatchers from all over the world. Unfortunately, the quetzal is described as being bright emerald in color, with a pink fuzz on its head and a long soft tail 'like a feather boa'. None of these describes your visitor."
The topic column is a bit special: it matches the player's input, and is not meant to be printed out again. Topic columns will be discussed further in the chapter on Tables. (Note also that, however it may appear in the documentation, the topic column should not be spanning multiple lines in our source text.)
The topic column is a bit special: it matches the player's input, and is not meant to be printed out again. Topic columns will be discussed further in the chapter on [Tables]. (Note also that, however it may appear in the documentation, the topic column should not be spanning multiple lines in our source text.)
We may also compress long or complicated topics by creating bracketed abbreviations, and in fact it's useful to do so now, to explain the red token we just used:
{**}Understand "red-orange" or "bird" or "red" or "orange" as the scarlet macaw. Understand "red-orange" or "red" or "orange" or "scarlet" as "[red]".
This technique is discussed further in the chapter on Understanding.
This technique is discussed further in the chapter on [Understanding].
If we wanted more books, we could define those in the same way, giving each its own separate contents table to be used for consultation. But for the sake of the example we will keep it simple, and move on to the scenario itself:
{**}The Veranda is a room. "From here you can see a considerable expanse of dense-growing jungle plants, and eventually the open water beyond."
The scarlet macaw is an animal in the veranda. "A vibrantly-colored [scarlet macaw] perches on the rail."
A thing can be known or unknown.
Before printing the name of the scarlet macaw while consulting:
now the scarlet macaw is known.
Rule for printing the name of the unknown scarlet macaw: if the macaw is unknown, say "red-orange bird of unknown species".
Test me with "look up penguins in the guide / look up quetzal in guide / look up silver nuthatches in the guide / look / look up red bird in the book / look".

View file

@ -5,36 +5,36 @@ Index: DROPPING into and onto things
Description: Adding special reporting and handling for objects dropped when the player is on a supporter, and special entering rules for moving from one supporter to another.
For: Z-Machine
Suppose that we have a design in which the player spends lots of time on enterable supporters, and in which we want to report certain actions -- dropping things onto those supporters, or leaping from one to another -- in a new way. We might begin by adding some action variables to help us keep track of the situation:
Suppose that we have a design in which the player spends lots of time on enterable supporters, and in which we want to report certain actions dropping things onto those supporters, or leaping from one to another in a new way. We might begin by adding some action variables to help us keep track of the situation:
{*}"Croft"
The dropping action has an object called the container dropped into (matched as "into").
The dropping action has an object called the supporter dropped onto (matched as "onto").
Rule for setting action variables for dropping:
if the actor is in a container (called C), now the container dropped into is C;
if the actor is on a supporter (called C), now the supporter dropped onto is C.
Report dropping a heavy thing onto a metallic thing:
say "You drop [the noun], and [the supporter dropped onto] clangs protestingly." instead.
Report someone dropping a heavy thing onto a metallic thing:
say "[The actor] drops [the noun] onto [the supporter dropped onto], which clangs protestingly." instead.
A thing can be heavy or light. A thing can be metallic or ordinary. A thing is usually ordinary. A thing is usually light.
The Ancient Cambodian Temple is a room. "A vast space built for ancient and forgotten rituals. The stone floor crawls with vermin. Well above the floor, and separated by some feet, are twin platforms built into the wall: the one carved of jointed wood, the other of sheets of graven bronze."
A platform is a kind of supporter. A platform is always enterable. A platform is usually scenery.
The bronze platform is a metallic platform in the Temple. Lara is a woman. She is on the bronze platform. She wears safari pants and a tank top. She carries a gun and a map. The gun is heavy.
The wood platform is an ordinary platform in the Temple. The player is on the wood platform. The player carries a rope, an Ancient Cambodian/English Phrasebook, a pickaxe, and a precious idol. The idol and the pickaxe are heavy.
Persuasion rule: persuasion succeeds.
The entering action has an object called the place left (matched as "from").
Check entering a platform from a platform:
if actor is the player, say "You leap into midair to cross the distance...";
@ -45,22 +45,23 @@ Because this rule occurs before the "implicitly pass through other barriers rule
{**}Rule for setting action variables for entering:
now the place left is the holder of the actor.
Report entering a platform from a platform:
say "You land in a cat-like crouch on [the noun]." instead.
Report Lara entering a platform from a platform:
say "Lara lands soundlessly on [the noun][if the noun supports the player] beside you[end if]." instead.
Report entering a platform from the location:
say "You jump, catch the edge of [the noun] in your hands, and -- exerting considerable upper-body strength -- pull yourself up onto it." instead.
Report Lara entering a platform from a location:
say "Lara jumps, catches the edge of [the noun], and is standing upright on it, all in less time than it takes to tell."
Instead of examining a person who is not the player:
say "[The noun] carries [list of things carried by the noun] and wears [list of things worn by the noun]."
Instead of climbing a platform, try entering the noun.
Test me with "Lara, drop map / lara, drop gun / drop idol / enter bronze platform / drop pickaxe / get off / climb wood".

View file

@ -7,27 +7,27 @@ For: Z-Machine
Suppose we want to add rules so that any time we examine a charred object (and most of our objects can be charred), a line about the charring is appended to the end of the object description. We could use "after examining...", but perhaps we would prefer for the sentence about the charring not to appear in its own paragraph.
This is an ideal occasion for a new activity. We look at the action index for "examining" to identify the rule that causes the old behavior (in this case, the "standard examining rule"); replace this with a new rule that calls our activity; and write our "printing the description" activity in such a way that it uses an object's description without forcing a paragraph return afterward.
This is an ideal occasion for a new activity. We look at the action index for "examining" to identify the rule that causes the old behaviour (in this case, the "standard examining rule"); replace this with a new rule that calls our activity; and write our "printing the description" activity in such a way that it uses an object's description without forcing a paragraph return afterward.
Then we will use "after printing the description" to add our line about charring, and make sure that the paragraph return does occur before the prompt.
So:
{*}"Crusoe"
Section 1 - Creating our New Activity
The fancy examining rule is listed instead of the standard examining rule in the carry out examining rules.
This instruction replaces a normal piece of the examine action, the standard examining rule, with another one of our own devising. (The replacement of the standard examining rule will be explained in more detail in the chapter on rulebooks.)
This instruction replaces a normal piece of the examine action, the standard examining rule, with another one of our own devising. (The replacement of the standard examining rule will be explained in more detail in the chapter on [Rulebooks].)
{**}Printing the description of something is an activity.
This is the fancy examining rule:
carry out the printing the description activity with the noun;
rule succeeds.
All we have done here is enclose what is usually just a rule inside an activity. This means that we can now write before and after rules for the activity, and also add special instructions like "Rule for printing the name of something while printing the description of something" -- this may not be likely to arise often, but Inform now has the concept of "printing the description of something" as a separate context of action. Next we add the modification that lets us append to the description without a new line:
All we have done here is enclose what is usually just a rule inside an activity. This means that we can now write before and after rules for the activity, and also add special instructions like "Rule for printing the name of something while printing the description of something" this may not be likely to arise often, but Inform now has the concept of "printing the description of something" as a separate context of action. Next we add the modification that lets us append to the description without a new line:
{**}Rule for printing the description of something (called item):
if the description of the item is not "":
@ -44,32 +44,33 @@ The instead at the end of this line stops Inform for going on with any other "af
The standard library also has rules for printing additional text about containers and supporters with visible contents, and devices that are switched on; with this current system, we could add those as "after printing the description" rules as well, building up a complete paragraph if we wanted. But for simplicity we won't exemplify all of that here. The effects would be much the same as with the "charred" line.
Now, because we want to make sure that we always do get a paragraph break after our description, we add this rule last after all the other rules. "Last" and "first" rules are covered in more detail in the chapter on rulebooks.
Now, because we want to make sure that we always do get a paragraph break after our description, we add this rule last after all the other rules. "Last" and "first" rules are covered in more detail in the chapter on [Rulebooks].
{**}Last after printing the description of something:
say paragraph break.
Section 2 - The Scenario
The Desert Isle is a room. "A pale expanse of sand, here and there developing into hillocks of grass, and a small clump of palms. The water is shallow here, and there are other islands within swimming distance -- or even wading distance, perhaps -- but none of them is any larger than your island, so it doesn't seem worth the trouble of visiting.
A few hundred feet out, the water turns darker blue, the sea floor drops away, and there is nothing to be seen all the way down to the horizon, except a couple of fluffy clouds, and an occasional bird.
The remains of your fire smolder in the stone-lined pit."
A thing can be charred or whole. A thing is usually whole. Instead of burning something: say "You hold [the noun] to the fire until it flares and chars."; now the noun is charred.
The player carries a stick. The description of the stick is "A strip of palm from the woodiest part of the leaf, about a foot and a half long."
The player carries a glass bottle and a piece of paper. The description of the paper is "A single blank sheet." In the glass bottle is a grain of sand. The glass bottle is openable and open. Instead of burning the glass bottle: say "You hold the bottle to the flame, but it grows uncomfortably warm."
Instead of burning the grain of sand: say "You drop the grain into the fire pit, where it becomes indistinguishable from all the others."; now the grain of sand is nowhere. Instead of dropping the grain of sand: now the grain of sand is nowhere; say "You return the grain of sand to its brethren."
The player's description is handled in an unusual way, and this will produce a space paragraph break there where it should not. Instead, therefore, we will add an instead for examining the player (probably a good idea anyway):
{**}Instead of examining the player:
say "You are sunburned and there is sand in cracks you didn't know existed."
Test me with "i / x stick / x bottle / x sand / x paper / x me / burn stick / x stick / burn paper / x paper".
The "printing a description" activity may be useful for other games, and can be imported just by lifting section 1.

View file

@ -1,14 +1,14 @@
Example: * Curare
Location: Descriptions as values
RecipeLocation: Varying What Is Written
Index: Cyclical randomization of named objects
Index: Cyclical randomisation of named objects
Description: A phrase that chooses and names the least-recently selected item from the collection given, allowing the text to cycle semi-randomly through a group of objects.
For: Z-Machine
{*}"Curare"
A thing has a number called the last use. The last use of a thing is usually 0.
Definition: a thing is old if its last use is 12 or less.
The actual number chosen in this definition is pretty much irrelevant: the main thing is that we want to establish relative values. The lower the "last use" number of an item, the older that item should be understood to be, as we see here:
@ -23,10 +23,11 @@ This phrase will select, from the collection of objects passed to it, the one th
{**}After taking inventory:
say "You stare morosely at [the cyclically random thing carried by the player], wondering what you're ever going to find to do with it."
We could have said "You stare morosely at [the oldest thing carried by the player]" here, but doing so would not have set the "last use" property correctly, so we would not get the cycling behavior that we're looking for.
We could have said "You stare morosely at [the oldest thing carried by the player]" here, but doing so would not have set the "last use" property correctly, so we would not get the cycling behaviour that we're looking for.
{**}The Evidence Room is a room. Some shelves are scenery supporters in the Evidence Room. A box is a kind of container which is open and not openable. On the shelves is a box. It contains a deformed bullet and a driver's license.
The player carries a steel fish hook, a Chinese passport, a tube of synthetic curare, and an envelope full of Euros.
Test me with "i / i / i / i / i / i / get all from box / i / i / i".

View file

@ -6,9 +6,9 @@ Description: A scene which plays through a series of events in order, then ends
For: Z-Machine
{*}"Day One"
Lecture is a scene. Lecture begins when play begins.
Every turn during Lecture:
repeat through Table of Lecture Events:
say "[event entry][paragraph break]";
@ -21,19 +21,19 @@ Here we use a table (see subsequent chapters) to keep track of all the events we
event
"'Welcome to Precolumbian Archaeology 101,' thunders Dr Freitag from the front of the class. 'Miss-- yes, you in the back. If you can't find a free seat, how are you going to find Atlantis? Sit down or leave. Now. Thank you.'"
"Freitag stands behinds his desk and lines up the pile of books there more neatly. 'It has come to my attention over previous years that there are two sorts of person who enroll in my class,' he says.
'Some of you will be members of the swim team or women's lacrosse players who have a distribution requirement to fulfill and are under the mistaken impression that archaeology must be easier than psychology. If that description applies to you, I advise you to drop the class now rather than at the midterm break. Under absolutely no circumstances will I ever sign a withdrawal form for someone who is crying at the time. Make a note of that, please.'"
"'The second sort of person,' Dr Freitag says, getting another wind. 'Yes, the second sort of person takes this class because she imagines that it is going to lead to adventure or possibly to new age encounters with dolphins.'
His eye moves over the class, lingering an especially long time on a girl in a patchwork skirt.
'You should also leave now, but since you are probably lying to yourself about the reasons you're here, you will probably not heed my warning and we will be doomed to a semester of one another's company nonetheless.'"
"'Whatever you may tell yourself, you are not here to gain a deeper understanding of the world or get in touch with yourself or experience another culture.'
He paces before the first row of desks, hammering on them one at a time. 'I know you probably wrote an admissions statement saying that that is what you hoped to do. Well, too bad. It is not inconceivable that some of you, somehow, will muddle towards a deeper understanding of something thanks to this class, but I am not holding my breath, and neither should you.'"
"Freitag takes a breath. 'No, my dear freshwomen, what you are here to do is learn facts. FACTS. Facts are unpopular in this university and, I am unhappily aware, at most of the institutions of inferior preparation from which you have come. Nonetheless, facts it will be. I will expect you to learn names. I will expect you to learn dates. I will expect you to study maps and I will expect you to produce evidence of exacting geographical knowledge on the exams. I will expect you to learn shapes of pottery and memorize masonry designs. There are no principles you can learn which are more important or more useful than a truly colossal bank of facts right there in your own head.'"
"'I do not ever want to hear that you do not need to learn things because you will be able to look them up. This is the greatest fallacy of your computer-semi-literate generation, that you can get anything out of Google if you need it. Not only is this demonstrably false, but it overlooks something phenomenally important: you only know to look for something if you already know it EXISTS. In short there is no way to fake knowledge, and I am not going to pretend there is.' He smiles in lupine fashion.
'This class is likely to be the most miserable experience of your four years in university. Clear?'"
"Everyone is silent."
"The lecture is interrupted by the shrill of a bell."
@ -49,12 +49,13 @@ And to add a few additional details:
{**}Instead of doing something other than waiting, looking, listening or examining during Lecture:
say "Dr Freitag glares at you so fiercely that you are frozen into inaction."
Notice the careful phrasing of "doing something other than..." so that we do not mention the objects; if we had written "something other than listening to something...", the instead rule would match only action patterns which involved a noun. We state the rule more generally so that it will also match nounless commands such as JUMP and SING, since Freitag will probably take a dim view of those as well.
Notice the careful phrasing of "doing something other than..." so that we do not mention the objects; if we had written "something other than listening to something...", the instead rule would match only action patterns which involved a noun. We state the rule more generally so that it will also match nounless commands such as ``jump`` and ``sing``, since Freitag will probably take a dim view of those as well.
{**}When Lecture ends:
now Freitag is nowhere;
say "There is a flurry of movement as your fellow students begin to put away their books. Dr Freitag makes his way to the door and is gone before anyone can ask him anything."
The Classroom is a room. Dr Freitag is a man in the Classroom. "Dr Freitag paces before the blackboard."
Test me with "listen / x dr / x me / jump / z / z / z / z / z / x dr".

View file

@ -1,22 +1,23 @@
Example: * Dearth and the Maiden
Location: Kinds of action
RecipeLocation: Characterization
Index: Restrictions preventing inappropriate behavior
RecipeLocation: Characterisation
Index: Restrictions preventing inappropriate behaviour
Description: Our heroine, fallen among gentleman highwaymen, is restrained by her own modesty and seemliness.
For: Z-Machine
The following example, indebted to the late Georgette Heyer, is suggestive:
{*}"Dearth and the Maiden"
The Chequers Inn is a room. "The room is panelled and ceilinged in oak, with blue curtains to the windows and blue cushions on the high-backed settle by the fire."
An oil painting is in the Inn. "An oil painting hangs upon one wall, a lascivious work from the Indies in which a very bendy, sloe-eyed courtesan - but no."
A man called Mr Carr is in the Inn. "Standing bashfully aside is one Mr Carr, who we have been led to understand is by profession a Highwayman (yet whose visage oddly recalls Lord John Carstares, disgraced eldest son of the Earl of Wyncham)."
Kissing Mr Carr is unmaidenly behaviour. Doing something to the painting is unmaidenly behaviour.
Instead of unmaidenly behaviour in the Inn, say "How unmaidenly! Why, one might just as wantonly strip a rose of its petals, letting each fragrant leaf flutter slowly to the ground."
Test me with "examine painting / take painting / kiss mr carr".

View file

@ -2,30 +2,31 @@ Example: ** Delayed Gratification
Location: Named rules and rulebooks
RecipeLocation: Waiting, Sleeping
Index: WAIT UNTIL [time] command
Description: A WAIT UNTIL [time] command which advances until the game clock reaches the correct hour.
Description: A ``wait until`` [time] command which advances until the game clock reaches the correct hour.
For: Z-Machine
{*}"Delayed Gratification"
Hanging around until is an action applying to one time.
Check hanging around until:
if the time of day is the time understood, say "It is [time understood] now!" instead;
if the time of day is after the time understood, say "It is too late for that now." instead.
Carry out hanging around until:
while the time of day is before the time understood:
follow the turn sequence rules.
Report hanging around until:
say "You yawn until [time understood]."
Understand "wait until [time]" as hanging around until.
The Empty Field is a room. "It's an ordinary empty field. Nothing to see here at all-- yet. Wait until 11:45 PM, though."
At 11:45 PM:
say "Suddenly the air is filled with light and the sounds of an approaching band. Over the crest of the hill comes a parade of singing, stomping, hooting people: and not just people, but dogs, horses, elephants, giraffes... There are banners, and candles, and a flag that glows eerie-green in the dark; there is a float shaped like an enormous turtle, its shell covered with winking green lights; there is an old man dressed as a skeleton, carried in a litter, his neck garlanded with dried chiles. There are small girls throwing rose petals from a basket, and grown women half-naked carrying the emblems of Bacchic revelry, and two little boys each with a silver basin of clear water. All these go by in procession, and you join on at the end.";
end the story finally.
Test me with "look / z / z / wait until 11:45 PM".

View file

@ -7,30 +7,32 @@ For: Z-Machine
In some cases, we may want to add new stages to action processing. One possibility is a stage where we check the sanity of what the player is trying to do before executing any of the other commands; so that we avoid, for instance
>EAT ROCK
(first taking the rock)
That's plainly inedible.
``` transcript
>eat rock
(first taking the rock)
That's plainly inedible.
```
Here is how we might insert such a stage in our action processing, using rulebook manipulation.
{*}"Delicious, Delicious Rocks"
Section 1 - Procedure
The sanity-check rules are a rulebook.
This is the sanity-check stage rule:
abide by the sanity-check rules.
The sanity-check stage rule is listed after the before stage rule in the action-processing rules.
Section 2 - Scenario
Candyland is a room. The lollipop tree is an edible thing in Candyland. The genuine rock is a thing in Candyland.
Sanity-check eating an inedible thing:
say "Your digestion is so delicate -- you're sure [the noun] wouldn't agree with you." instead.
Test me with "eat lollipop / eat rock".
Notice that now Inform does not try taking the rock before rejecting the player's attempt to eat it.
@ -41,3 +43,4 @@ It is of course possible to get the same effect with
say "Your digestion is so delicate -- you're sure [the noun] wouldn't agree with you." instead.
...and in a small game with few rules, there's not much reason to add an extra stage. The ability to modify the stages of action processing becomes useful when we have a fairly large game with sophisticated modeling and want to be sure that some kinds of message (such as the sanity-check) are always handled before other things that we might be doing at the before stage (such as generating implicit actions like opening doors before going through them).

View file

@ -2,28 +2,30 @@ Example: *** Democratic Process
Location: Before rules
RecipeLocation: Taking, Dropping, Inserting and Putting
Index: PUT and INSERT automatically TAKE first
Description: Make PUT and INSERT commands automatically take objects if the player is not holding them.
Description: Make ``put`` and ``insert`` commands automatically take objects if the player is not holding them.
For: Z-Machine
[ZL: https://inform7.atlassian.net/browse/I7-2348 This refers to outdated behaviour ]::
"Stop" and "Continue" are most useful when we need to write rules that will have to stop the action some of the time but at other times let it pass; so for instance:
{*}"Democratic Process"
Before inserting something which is not carried by the player into something:
if the noun is in the second noun, say "Already done." instead;
say "(first taking [the noun])[line break]";
silently try taking the noun;
if the player is not holding the noun, stop the action.
Before putting something which is not carried by the player on something:
if the noun is on the second noun, say "Already done." instead;
say "(first taking [the noun])[line break]";
silently try taking the noun;
if the player is not holding the noun, stop the action.
The Assembly Room is a room. "On most days, this room is used for elementary school assemblies; at the moment, it serves as a voting place." The ballot is on the desk. The desk is in the Assembly Room.
The machine is a container in the Assembly Room. "On the ballot machine is a sign which reads 'PUT BALLOTS IN ME :)'." Understand "ballot machine" as the machine.
Test me with "put ballot in machine".

View file

@ -8,11 +8,11 @@ For: Z-Machine
In the following, we pretend that every item has a cuboidal shape. Every thing has a length, width and depth, while a "measured container" also has interior dimensions. (Thus a 10x10x10 container with 1cm-thick sides might have interior dimensions 9x9x9.)
{*}"Depth"
A length is a kind of value. 10 cm specifies a length. An area is a kind of value. 10 sq cm specifies an area. A length times a length specifies an area. A volume is a kind of value. 10 cu cm specifies a volume. A length times an area specifies a volume.
A thing has a length called height. A thing has a length called width. A thing has a length called depth. The height of a thing is usually 10 cm. The width of a thing is usually 10 cm. The depth of a thing is usually 10 cm.
To decide what volume is the exterior volume of (item - a thing):
let base area be the height of the item multiplied by the width of the item;
let base volume be the base area multiplied by the depth of the item;
@ -25,7 +25,7 @@ In order to see how these shapes might fit together spatially, we need to work o
if the width of the item is greater than the long side, now the long side is the width of the item;
if the depth of the item is greater than the long side, now the long side is the depth of the item;
decide on the long side.
To decide what length is the middling dimension of (item - a thing):
let longer side be the height of item;
let shorter side be the width of item;
@ -35,7 +35,7 @@ In order to see how these shapes might fit together spatially, we need to work o
if the depth of the item is greater than the longer side, decide on the longer side;
if the depth of the item is less than the shorter side, decide on the shorter side;
decide on the depth of the item.
To decide what length is the shortest dimension of (item - a thing):
let short side be the height of item;
if the width of the item is less than the short side, now the short side is the width of the item;
@ -48,17 +48,17 @@ When testing this example, the author made use of the following: it's no longer
say "[the item] - height [height of the item], width [width of the item], depth [depth of the item].";
say "largest side [largest dimension of the item], middling [middling dimension of the item], smallest [shortest dimension of the item]."
We now introduce a new kind: a measured container, which not only has exterior dimensions - the height, width and depth which every thing now has - but also interior measurements. A convenient way to do calculations with the hollow interior is to regard it as if it were a solid shape in its own right, and we do this with the aid of something out of world, which the player never sees: the "imaginary cuboid", which is made into the shape of whatever measured container's interior is being thought about.
We now introduce a new kind: a measured container, which not only has exterior dimensionsthe height, width and depth which every thing now hasbut also interior measurements. A convenient way to do calculations with the hollow interior is to regard it as if it were a solid shape in its own right, and we do this with the aid of something out of world, which the player never sees: the "imaginary cuboid", which is made into the shape of whatever measured container's interior is being thought about.
{**}A measured container is a kind of container. A measured container has a length called interior height. A measured container has a length called interior width. A measured container has a length called interior depth.
There is an imaginary cuboid.
To imagine the interior of (receptacle - a measured container) as a cuboid:
now the height of the imaginary cuboid is the interior height of the receptacle;
now the width of the imaginary cuboid is the interior width of the receptacle;
now the depth of the imaginary cuboid is the interior depth of the receptacle.
To decide what volume is the interior volume of (receptacle - a measured container):
imagine the interior of the receptacle as a cuboid;
decide on the exterior volume of the imaginary cuboid.
@ -85,19 +85,20 @@ If we only constrained volume, a 140 cm-long fishing rod could fit into a 12 cm
And finally a situation to try out these rules.
{**}The Cubist Lab is a room. "A laboratory which, as the art critic Louis Vauxcelles said about Braque's paintings in 1908, is full of little cubes: everyday objects rendered as if cuboidal."
The box is a measured container. The interior height is 10 cm. The interior depth is 5 cm. The interior width is 6 cm. The player carries the box.
A pebble is a kind of thing. The height is usually 2 cm. The depth is usually 2 cm. The width is usually 2 cm. The player carries 25 pebbles.
A red rubber ball is carried by the player. The depth is 5 cm. The width is 5 cm. The height is 5 cm.
An arrow is carried by the player. The height is 40 cm. The width is 1 cm. The depth is 1 cm.
A crusty baguette is carried by the player. The height is 80 cm. The width is 4 cm. The depth is 5 cm.
A child's book is carried by the player. The height is 1 cm. The width is 9 cm. The depth is 9 cm.
A featureless white cube is carried by the player. The height is 6 cm. The width is 6 cm. The depth is 6 cm.
Test me with "put arrow in box / put book in box / put cube in box / put ball in box / put baguette in box / put pebbles in box".
Several warnings about this. First, the numbers can't go very high (if the Settings for the project set the story file format to the Z-machine): while the volume can in theory go to 32,767, in practice this equates to an object 32 cm on a side, which is not very large. One way to avoid this is to use the Glulx format, allowing for sizes in excess of 10 m on a side: or we could simply scale the dimensions to suit our purposes, using a decimeter (10 cm) as the basic unit of measurement, for instance.
Second, the system will require a height, width, and depth for every portable object in the game, which is a large commitment to data entry; it may become tiresome. So it is probably not worth bothering with this kind of simulation unless it is going to be genuinely significant.

View file

@ -8,23 +8,24 @@ For: Z-Machine
The following is not a very sophisticated approach, because it does not allow for weight to accumulate: if we put a gold ingot into a paper bag, then put the bag on the balance platform, only the bag's weight will register. But it will do for a first try.
{*}"Dimensions"
A length is a kind of value. 10m specifies a length. An area is a kind of value. 10 sq m specifies an area. A length times a length specifies an area.
A weight is a kind of value. 10kg specifies a weight. Everything has a weight.
The verb to weigh means the weight property. A thing usually weighs 1kg.
Definition: A thing is light if its weight is 3kg or less.
Definition: A thing is heavy if its weight is 10kg or more.
The Weighbridge is a room.
A blackboard is in the Weighbridge. "A blackboard propped against one wall reads: '122/10 is [122 divided by 10] remainder [remainder after dividing 122 by 10]; 122kg/10kg is [122kg divided by 10kg] remainder [remainder after dividing 122kg by 10kg]; 122kg/10 is [122kg divided by 10] remainder [remainder after dividing 122kg by 10].'" The blackboard weighs 10kg.
A feather and a lead pig are in the Weighbridge. The lead pig weighs 45kg.
The balance platform is a supporter in the Weighbridge. "The balance platform is 10m by 8m, giving it an area of [10m multiplied by 8m], currently weighing [the list of things on the platform]. The scale alongside reads: [total weight of things on the platform]. [if two things are on the platform]Average weight is: [the total weight of things on the platform divided by the number of things on the platform]. Heaviest item is [the heaviest thing on the platform], at [weight of the heaviest thing on the platform]. Lightest item is [the lightest thing on the platform], at [weight of the lightest thing on the platform].[otherwise]It seems to be able to weigh several things at once."
Test me with "get feather / put it on platform / look / get pig / put it on platform / look".

View file

@ -6,11 +6,11 @@ Description: A window between two locations. When the window is open, the player
For: Z-Machine
{*}"Dinner is Served"
Street in Kolonaki is a room. "There is a single round table out on the street here, and a window more or less at knee level looks down into the Olive Tree Gyro Shop, which is partly basement."
The Street contains a round table. The table is scenery. On the round table is a plate. On the plate are a gyro and a mound of fresh potates. The plate is portable. The potates and the gyro are edible. The description of potates is "They'd be called french fries, at home, but these are steak-cut and fried in olive oil." The description of the gyro is "Dripping garlic-yogurt sauce."
Olive Tree Gyro Shop is inside from Street in Kolonaki. Kostis is a man in the Gyro Shop. In the Shop is a stand. On the stand is a rotating column of cooking lamb flesh. In the shop is a closed, openable container called a drinks refrigerator. The refrigerator contains a can of Mythos beer and a can of Coke Light.
Here's the part that allows reaching through the window.
@ -18,7 +18,7 @@ Here's the part that allows reaching through the window.
We replace the usual rule that says the player can never reach into a room with one that more specifically checks whether we are trying to reach through the window. If we aren't, we return the usual refusal. If we are, we return a custom refusal if the window is closed ("You can't reach through the closed window"), but allow access if the window is open.
{**}The can't reach through closed window rule is listed instead of the can't reach inside rooms rule in the reaching inside rules.
This is the can't reach through closed window rule:
let reaching through the window be false;
if the container in question is a room and the container in question is not the location:
@ -40,18 +40,19 @@ And the rest is window-dressing.
{**}After looking when a room (called the next room) is adjacent:
try examining the next room.
Instead of examining a supporter, say "On [the noun] [is-are a list of things on the noun]." Instead of examining an open container, say "In [the noun] [is-are a list of things in the noun]."
The window is a backdrop. It is in the Street and the Shop. The window can be openable. The window can be open. The window is openable and closed. Instead of searching the window in the Street: try examining the shop. Instead of searching the window in the Shop: try examining the street.
Understand "examine [any adjacent room]" as examining.
Instead of examining a room:
say "Over in [the noun], you can see [a list of visible things in the noun]."
After deciding the scope of the player:
if the player is in the Street, place the Shop in scope;
if the player is in the Shop, place the Street in scope.
Test me with "examine shop / open refrigerator / open window / examine shop / open refrigerator / get beer / in / examine street / out / get gyro / close window / put gyro in refrigerator / open window / put gyro in refrigerator".

View file

@ -1,5 +1,4 @@
Example: * Disenchantment Bay 1
Subtitle: The charter boat
Location: Properties depend on kind
RecipeLocation: Disenchantment Bay
Index: The charter boat
@ -10,10 +9,10 @@ To begin with the title:
{*}"Disenchantment Bay"
There are many Disenchantment Bays across the world, named by eighteenth-century ships' captains - one in Antarctica, another in Tasmania, for instance. The most famous is probably the one where Lewis and Clark's expedition broke through to the Pacific. But ours is the one in Alaska, named in 1791 by a Spanish navigator who had hoped it might lead to the fabled Northwest Passage, and all of this history is beside the point since the game is set in the present day.
There are many Disenchantment Bays across the world, named by eighteenth-century ships' captainsone in Antarctica, another in Tasmania, for instance. The most famous is probably the one where Lewis and Clark's expedition broke through to the Pacific. But ours is the one in Alaska, named in 1791 by a Spanish navigator who had hoped it might lead to the fabled Northwest Passage, and all of this history is beside the point since the game is set in the present day.
{**}The Cabin is a room. "The front of the small cabin is entirely occupied with navigational instruments, a radar display, and radios for calling back to shore. Along each side runs a bench with faded blue vinyl cushions, which can be lifted to reveal the storage space underneath. A glass case against the wall contains several fishing rods.
Scratched windows offer a view of the surrounding bay, and there is a door south to the deck. A sign taped to one wall announces the menu of tours offered by the Yakutat Charter Boat Company."
We might want to start with the glass case.
@ -32,6 +31,6 @@ Using "some" rather than "a" or "the" tells Inform that the cushions are to be r
{**}The bench is enterable.
And now a short script, so that if we type TEST ME, we experiment with the case and bench:
And now a short script, so that if we type ``test me``, we experiment with the case and bench:
{**}Test me with "examine case / get rods / open case / get rods / sit on bench / take cushions / get up"

Some files were not shown because too many files have changed in this diff Show more