Inform 7 Home Page / Documentation


Examples in Numerical Order

arrow-right.png Examples in Alphabetical Order
arrow-right.png Examples in Thematic Order
arrow-right.png General Index
arrow-up-left.png Part I. Writing with Inform
arrow-up-left.png Part II. The Inform Recipe Book

Chapter 1: Welcome to Inform

§1.1. Preface

1

*ExampleAbout the examples
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.


Chapter 3: Things

§3.1. Descriptions

2

*ExampleBic
Testing to make sure that all objects have been given descriptions.

3

*ExampleVerbosity 1
Making rooms give brief room descriptions when revisited.

4

**ExampleSlightly Wrong
A room whose description changes slightly after our first visit there.

§3.2. Rooms and the map

5

*ExamplePort Royal 1
A partial implementation of Port Royal, Jamaica, set before the earthquake of 1692 demolished large portions of the city.

6

**ExampleUp and Up
Adding a short message as the player approaches a room, before the room description itself appears.

7

***ExampleStarry Void
Creating a booth that can be seen from the outside, opened and closed, and entered as a separate room.

§3.3. One-way connections

8

*ExamplePort Royal 2
Another part of Port Royal, with less typical map connections.

9

*ExampleThe Unbuttoned Elevator Affair
A simple elevator connecting two floors which is operated simply by walking in and out, and has no buttons or fancy doors.

§3.4. Regions and the index map

*ExamplePort Royal 3
Division of Port Royal into regions.

§3.5. Kinds

*ExampleFirst Name Basis
Allowing the player to use different synonyms to refer to something.

*ExampleMidsummer Day
A few sentences laying out a garden together with some things which might be found in it.

§3.6. Either/or properties

*ExampleTamed
Examples of a container and a supporter that can be entered, as well as nested rooms.

§3.7. Properties depend on kind

*ExampleDisenchantment Bay 1
A running example in this chapter, Disenchantment Bay, involves chartering a boat. This is the first step: creating the cabin.

§3.8. Scenery

*ExampleDisenchantment Bay 2
Disenchantment Bay: creating some of the objects in the cabin's description.

*ExampleReplanting
Changing the response when the player tries to take something that is scenery.

§3.9. Backdrops

*ExampleDisenchantment Bay 3
Disenchantment Bay: adding a view of the glacier.

§3.11. Two descriptions of things

*ExampleDisenchantment Bay 4
Disenchantment Bay: fleshing out the descriptions of things on the boat.

**ExampleLaura
Some general advice about creating objects with unusual or awkward names, and a discussion of the use of printed names.

§3.12. Doors

*ExampleDisenchantment Bay 5
Disenchantment Bay: adding the door and the deck to our charter boat.

**ExampleEscape
Window that can be climbed through or looked through.

***ExampleGaribaldi 1
Providing a security readout device by which the player can check on the status of all doors in the game.

§3.13. Locks and keys

*ExampleDisenchantment Bay 6
Disenchantment Bay: locking up the charter boat's fishing rods.

**ExampleNeighborhood Watch
A locked door that can be locked or unlocked without a key from one side, but not from the other.

§3.14. Devices and descriptions

*ExampleDisenchantment Bay 7
Disenchantment Bay: making the radar and instruments switch on and off.

**ExampleDown Below
A light switch which makes the room it is in dark or light.

§3.16. Vehicles and pushable things

*ExamplePeugeot
A journey from one room to another that requires the player to be on a vehicle.

**ExampleDisenchantment Bay 8
Disenchantment Bay: a pushable chest of ice for the boat.

***ExampleHover
Letting the player see a modified room description when he's viewing the place from inside a vehicle.

§3.17. Men, women and animals

*ExampleDisenchantment Bay 9
Disenchantment Bay: enter the charter boat's Captain.

§3.18. Articles and proper names

*ExampleBelfry
You can see a bat, a bell, some woodworm, William Snelson, the sexton's wife, a bellringer and your local vicar here.

**ExampleGopher-wood
Changing the name of a character in the middle of play, removing the article.

§3.20. Possessions and clothing

*ExampleDisenchantment Bay 10
Disenchantment Bay: things for the player and the characters to wear and carry.

§3.21. The player's holdall

*ExampleDisenchantment Bay 11
Disenchantment Bay: making a holdall of the backpack.

§3.23. Parts of things

***ExampleFallout Enclosure
Adding an enclosure kind that includes both containers and supporters in order to simplify text that would apply to both.

***ExampleBrown
A red sticky label which can be attached to anything in the game, or removed again.

****ExampleDisenchantment Bay 12
A final trip to Disenchantment Bay: the scenario turned into a somewhat fuller scene, with various features that have not yet been explained.

§3.24. Concealment

***ExampleSearch and Seizure
A smuggler who has items, some of which are hidden.

§3.25. The location of something

**ExampleVan Helsing
A character who approaches the player, then follows him from room to room.

§3.26. Directions

**ExamplePrisoner's Dilemma
A button that causes a previously non-existent exit to come into being.

**ExampleThe World of Charles S. Roberts
Replacing the ordinary compass bearings with a set of six directions to impose a hexagonal rather than square grid on the landscape.

***ExampleFore
Understand "fore", "aft", "port", and "starboard", but only when the player is on a vessel.


Chapter 4: Kinds

§4.1. New kinds

**ExampleVouvray
Adding synonyms to an entire kind of thing.

§4.3. Degrees of certainty

*ExampleOdin
Replacing "You see nothing special..." with a different default message for looking at something nondescript.

*ExampleSomething Narsty
A staircase always open and never openable.

§4.4. Plural assertions

***ExampleGet Me to the Church on Time
Using kinds of clothing to prevent the player from wearing several pairs of trousers at the same time.

§4.7. New either/or properties

**ExampleChange of Basis
Implementing sleeping and wakeful states.

§4.8. New value properties

*ExampleWould you...?
Adding new properties to objects, and checking for their presence.

**ExampleStraw Boater
Using text properties that apply only to some things and are not defined for others.

§4.9. Using new kinds of value in properties

*ExampleThe Undertomb 1
A small map of dead ends, in which the sound of an underground river has different strengths in different caves.

**ExampleThe Undertomb 2
Flickering lantern-light effects added to the Undertomb.

***ExampleThe Crane's Leg 1
A description text that automatically highlights the ways in which the object differs from a standard member of its kind.

***ExampleSigns and Portents
Signpost that points to various destinations, depending on how the player has turned it.

§4.12. Values that vary

***ExampleReal Adventurers Need No Help
Allowing the player to turn off all access to hints for the duration of a game, in order to avoid the temptation to rely on them overmuch.

§4.14. Duplicates

***ExampleEarly Childhood
A child's set of building blocks, which come in three different colours - red, green and blue - but which can be repainted during play.

§4.15. Assemblies and body parts

*ExampleBeing Prepared
A kind for jackets, which always includes a container called a pocket.

**ExampleModel Shop
An "on/off button" which controls whatever device it is part of.

***ExampleU-Stor-It
A "chest" kind which consists of a container which has a lid as a supporter.

***ExampleThe Night Before
Instructing Inform to prefer different interpretations of EXAMINE NOSE, depending on whether the player is alone, in company, or with Rudolph the Red-nosed Reindeer.


Chapter 5: Text

§5.4. Text with numbers

***ExampleBallpark
A new "to say" definition which allows the author to say "[a number in round numbers]" and get verbal descriptions like "a couple of" or "a few" as a result.

§5.5. Text with lists

*ExampleControl Center
Objects which automatically include a description of their component parts whenever they are examined.

**ExampleTiny Garden
A lawn made up of several rooms, with part of the description written automatically.

§5.6. Text with variations

*ExampleWhen?
A door whose description says "...leads east" in one place and "...leads west" in the other.

***ExampleWhence?
A kind of door that always automatically describes the direction it opens and what lies on the far side (if that other room has been visited).

***ExamplePersephone
Separate the player's inventory listing into two parts, so that it says "you are carrying..." and then (if the player is wearing anything) "You are also wearing...".

§5.7. Text with random alternatives

*ExampleRadio Daze
A radio that produces a cycle of output using varying text.

**ExampleCamp Bethel
Creating characters who change their behavior from turn to turn, and a survey of other common uses for alternative texts.

§5.8. Line breaks and paragraph breaks

**ExampleBeekeeper's Apprentice
Making the SEARCH command examine all the scenery in the current location.

§5.9. Text with type styles

*ExampleGaribaldi 2
Adding coloured text to the example of door-status readouts.

§5.11. Unicode characters

***ExampleThe Über-complète clavier
This example provides a fairly stringent test of exotic lettering.

§5.13. Making new substitutions

*ExampleFifty Ways to Leave Your Larva
Using text substitution to make characters reply differently under the same circumstances.

***ExampleFifty Times Fifty Ways
Writing your own rules for how to carry out substitutions.


Chapter 6: Descriptions

§6.4. Defining new adjectives

*ExampleFinishing School
The "another" adjective for rules such as "in the presence of another person".

§6.5. Defining adjectives for values

***ExampleOnly You...
Smoke which spreads through the rooms of the map, but only every other turn.

§6.9. Which and who

**ExampleVersailles
A mirror which will reflect some random object in the room.

§6.13. To be able to see and touch

***ExampleLean and Hungry
A thief who will identify and take any valuable thing lying around that he is able to touch.

§6.14. Adjacent rooms and routes through the map

*ExampleMistress of Animals
A person who moves randomly between rooms of the map.

*ExampleAll Roads Lead to Mars
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.

**ExampleHotel Stechelberg
Signposts such as those provided on hiking paths in the Swiss Alps, which show the correct direction and hiking time to all other locations.

***ExampleA View of Green Hills
A LOOK [direction] command which allows the player to see descriptions of the nearby landscape.

***ExampleUnblinking
Finding a best route through light-filled rooms only, leaving aside any that might be dark.

§6.15. All, each and every

****ExampleRevenge of the Fussy Table
A small game about resentful furniture and inconvenient objects.

§6.16. Counting while comparing

**ExampleYolk of Gold
Set of drawers where the item the player seeks is always in the last drawer he opens, regardless of the order of opening.


Chapter 7: Basic Actions

§7.2. Instead rules

*ExampleGrilling
A grill, from which the player is not allowed to take anything lest he burn himself.

*ExampleBad Hair Day
Change the player's appearance in response to EXAMINE ME.

§7.3. Before rules

***ExampleDemocratic Process
Make PUT and INSERT commands automatically take objects if the player is not holding them.

****ExampleSand
Extend PUT and INSERT handling to cases where multiple objects are intended at once.

§7.4. Try and try silently

*ExampleFine Laid
Making writing that can be separately examined from the paper on which it appears, but which directs all other actions to the paper.

*ExampleHayseed
A refinement of our staircase kind which can be climbed.

§7.5. After rules

*ExampleMorning After
When the player picks something up which he hasn't already examined, the object is described.

§7.6. Reading and talking

*ExampleSybil 1
Direct all ASK, TELL, and ANSWER commands to ASK, and accept multiple words for certain cases.

*ExampleLucy
Redirecting a question about one topic to ask about another.

**ExampleSybil 2
Making the character understand YES, SAY YES TO CHARACTER, TELL CHARACTER YES, ANSWER YES, and CHARACTER, YES.

***ExampleCosta Rican Ornithology
A fully-implemented book, answering questions from a table of data, and responding to failed consultation with a custom message such as "You flip through the Guide to Central American Birds, but find no reference to penguins."

§7.7. The other four senses

***ExampleThe Art of Noise
Things are all assigned their own noise (or silence). Listening to the room in general reports on all the things that are currently audible.

§7.9. All actions and exceptional actions

*ExampleZodiac
Several variations on "doing something other than...", demonstrating different degrees of restriction.

§7.10. The noun and the second noun

*ExampleMing Vase
ATTACK or DROP break and remove fragile items from play.

§7.12. In the presence of, and when

*ExampleBeachfront
An item that the player can't interact with until he has found it by searching the scenery.

**ExampleToday Tomorrow
A few notes on "In the presence of" and how it interacts with concealed objects.

§7.13. Going from, going to

*ExampleVeronica
An effect that occurs only when the player leaves a region entirely.

**ExampleA&E
Using regions to block access to an entire area when the player does not carry a pass, regardless of which entrance he uses.

***ExampleBumping into Walls
Offering the player a list of valid directions if he tries to go in a direction that leads nowhere.

***ExamplePolarity
A "go back" command that keeps track of the direction from which the player came, and sends him back.

§7.14. Going by, going through, going with

*ExampleNo Relation
A car which must be turned on before it can be driven, and can only go to roads.

*ExampleMattress King
Adding extra phrasing to the action to PUSH something in a direction.

**ExampleOne Short Plank
A plank bridge which breaks if the player is carrying something when he goes across it. Pushing anything over the bridge is forbidden outright.

***ExampleProvenance Unknown
Allowing something like PUSH TELEVISION EAST to push the cart on which the television rests.

***ExampleZorb
Replacing the message the player receives when attempting to push something that isn't pushable, and also to remove the restriction that objects cannot be pushed up or down.

§7.15. Kinds of action

*ExampleDearth and the Maiden
Our heroine, fallen among gentleman highwaymen, is restrained by her own modesty and seemliness.

***ExampleMimicry
People who must be greeted before conversation can begin.

§7.16. Repeated actions

*ExampleY ask Y?
Noticing when the player seems to be at a loss, and recommending the use of hints.

****ExampleA Day For Fresh Sushi
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.


Chapter 8: Change

§8.2. Changing the command prompt

***ExampleDon Pedro's Revenge
Combat scenario in which the player's footing and position changes from move to move, and the command prompt also changes to reflect that.

§8.3. Changing the status line

*ExamplePolitics as Usual
Have the status line indicate the current region of the map.

***ExampleCentered
Replacing the two-part status line with one that centers only the room name at the top of the screen.

§8.4. Change of either/or properties

*ExampleVitrine
An electrochromic window that becomes transparent or opaque depending on whether it is currently turned on.

§8.5. Change of properties with values

*ExampleThirst
A waterskin that is depleted as the player drinks from it.

*ExampleThirst 2
A campfire added to the camp site, which can be lit using tinder.

§8.7. Moving things

**ExampleMeteoric I and II
A meteor in the night sky which is visible from many rooms, so needs to be a backdrop, but which does not appear until 11:31 PM.

§8.8. Moving backdrops

***ExampleOrange Cones
Creating a traffic backdrop that appears in all road rooms except the one in which the player has laid down orange cones.

§8.9. Moving the player

***ExampleTerror of the Sierra Madre
Multiple player characters who take turns controlling the action.

§8.10. Removing things from play

*ExampleBeverage Service
A potion that the player can drink.

*ExampleSpring Cleaning
A character who sulks over objects that the player has broken (and which are now off-stage).

**ExampleExtra Supplies
A supply of red pens from which the player can take another pen only if he doesn't already have one somewhere in the game world.

§8.11. Now...

*ExampleBee Chambers
A maze with directions between rooms randomized at the start of play.

**ExampleHatless
It's tempting to use "now..." to distribute items randomly at the start of play, but we need to be a little cautious about how we do that.

***ExampleTechnological Terror
A ray gun which destroys objects, leaving their component parts behind.

§8.15. Calling names

*ExampleHigher Calling
All doors in the game automatically attempt to open if the player approaches them when they are closed.

§8.18. Randomness

*ExampleDo Pass Go
A pair of dice which can be rolled, and are described with their current total when not carried, and have individual scores when examined.

*ExampleLanista 1
Very simple randomized combat in which characters hit one another for a randomized amount of damage.

*ExampleWeathering
The automatic weather station atop Mt. Pisgah shows randomly fluctuating temperature, pressure and cloud cover.

***ExampleUptown Girls
A stream of random pedestrians who go by the player.

§8.19. Random choices of things

*ExampleCandy
One of several identical candies chosen at the start of play to be poisonous.

*ExampleZork II
A "Carousel Room", as in Zork II, where moving in any direction from the room leads (at random) to one of the eight rooms nearby.


Chapter 9: Time

§9.1. When play begins

*ExampleClueless
A murderer for the mystery is selected randomly at the beginning of the game.

§9.2. Awarding points

**ExampleMutt's Adventure
Awarding points for visiting a room for the first time.

***ExampleNo Place Like Home
Recording a whole table of scores for specific treasures.

§9.4. When play ends

***ExampleBig Sky Country
Allowing the player to continue play after a fatal accident, but penalizing him by scattering his possessions around the game map.

§9.5. Every turn

***ExampleWitnessed 1
A kind of battery which can be put into different devices, and which will lose power after extended use.

****ExampleText Foosball
A game of foosball which relies heavily on every-turn rules.

§9.6. The time of day

**ExampleIPA
Shops which each have opening and closing hours, so that it is impossible to go in at the wrong times, and the player is kicked out if he overstays his welcome.

§9.7. Telling the time

*ExampleSituation Room
Printing the time of day in 24-hour time, as in military situations.

§9.11. Future events

*ExampleMRE
Hunger that eventually kills the player, and foodstuffs that can delay the inevitable by different amounts of time.

**ExampleTotality
To schedule an eclipse of the sun, which involves a number of related events.

**ExampleEmpire
A train which follows a schedule, stopping at a number of different locations.

***ExampleHour of the Wren
Allowing the player to make an appointment, which is then kept.

§9.12. Actions as conditions

*ExampleNight Sky
A room which changes its description depending on whether an object has been examined.

***ExampleZero
A box which called "horribly heavy box" after the player has tried to take it the first time.

§9.13. The past and perfect tenses

*ExampleTense Boxing
An overview of all the variations of past and present tenses, and how they might be used.

**ExampleBruneseau's Journey
A candle which reacts to lighting and blowing actions differently depending on whether it has already been lit once.

**ExampleElsie
A door that closes automatically one turn after the player opens it.

§9.14. How many times?

*ExampleInfiltration
A room whose description changes depending on the number of times the player has visited.

§9.15. How many turns?

*ExampleAnnoyotron Jr
A child who after a certain period in the car starts asking annoying questions.


Chapter 10: Scenes

§10.2. Creating a scene

*ExamplePine 1
Pine: Using a scene to watch for the solution of a puzzle, however arrived-at by the player.

**ExampleEntrapment
A scene in which the player is allowed to explore as much as he likes, but another character strolls in as soon as he has gotten himself into an awkward or embarrassing situation.

§10.3. Using the Scene index

*ExampleAge of Steam
The railway-station examples so far put together into a short game called "Age of Steam".

§10.4. During scenes

*ExampleFull Moon
Random atmospheric events which last the duration of a scene.

**ExampleSpace Patrol - Stranded on Jupiter!
We'll be back in just a moment, with more exciting adventures of the... Space Patrol!

***ExampleBowler Hats and Baby Geese
Creating a category of scenes that restrict the player's behavior.

***ExampleDay One
A scene which plays through a series of events in order, then ends when the list of events is exhausted.

§10.5. Linking scenes together

***ExamplePine 2
Pine: Adding a conversation with the princess, in which a basic set of facts must be covered before the scene is allowed to end.

§10.6. More general linkages

*ExampleThe Prague Job
Scenes used to provide pacing while the player goes through his possessions.

***ExampleEntrevaux
Organizing the game by scenes, where each scene has a location and prop lists so that it can be set up automatically.

§10.7. Multiple beginnings and repeats

*ExampleNight and Day
Cycling through a sequence of scenes to represent day and night following one another during a game.

***ExamplePine 3
Pine: Allowing the player to visit aspects of the past in memory and describe these events to the princess, as a break from the marriage-proposal scene.

§10.8. Multiple endings

***ExamplePanache
Replacing the score with a plot summary that records the events of the plot, scene by scene.

***ExamplePine 4
Pine: Adding a flashback scene that, instead of repeating endlessly, repeats only until the Princess has understood the point.

§10.9. Why are scenes designed this way?

***ExampleCheese-makers
Scenes used to control the way a character reacts to conversation and comments, using a TALK TO command.


Chapter 11: Phrases

§11.3. Pattern matching

*ExampleAhem
Writing a phrase, with several variant forms, whose function is to follow a rule several times.

**ExampleFerragamo Again
Using the same phrase to produce different results with different characters.

§11.5. Conditions and questions

**ExampleProposal
Asking the player a yes/no question which he must answer, and another which he may answer or not as he chooses.

§11.7. Begin and end

*ExampleMatreshka
A SEARCH [room] action that will open every container the player can see, stopping only when there don't remain any that are closed, unlocked, and openable.

*ExamplePrincess and the Pea
The player is unable to sleep on a mattress (or stack of mattresses) because the bottom one has something uncomfortable under it.

§11.8. Otherwise

*ExampleNumberless
A simple exercise in printing the names of random numbers, comparing the use of "otherwise if...", a switch statement, or a table-based alternative.

§11.10. Repeat

*ExampleWonka's Revenge
A lottery drum which redistributes the tickets inside whenever the player spins it.

§11.11. Repeat running through

**ExampleStrictly Ballroom
People who select partners for dance lessons each turn.

§11.14. Phrase options

**ExampleEquipment List
Overview of all the phrase options associated with listing, and examples of how to change the inventory list into some other standard formats.

§11.15. Let and temporary variables

*ExampleM. Melmoth's Duel
Three basic ways to inject random or not-so-random variations into text.

§11.16. New conditions, new adjectives

***ExampleOwen's Law
OUT always means "move to an outdoors room, or else to a room with more exits than this one has"; IN always means the opposite.

§11.17. Phrases to decide other things

*ExampleWitnessed 2
A piece of ghost-hunting equipment that responds depending on whether or not the meter is on and a ghost is visible or touchable from the current location.

***ExampleA Haughty Spirit
Windows overlooking lower spaces which will prevent the player from climbing through if the lower space is too far below.

§11.18. The value after and the value before

*ExampleEntropy
All objects in the game have a heat, but if not kept insulated they will tend toward room temperature (and at a somewhat exaggerated rate).

***ExampleThe Hang of Thursdays
Turns take a quarter day each, and the game rotates through the days of the week.


Chapter 12: Advanced Actions

§12.3. Giving instructions to other people

*ExampleVirtue
Defining certain kinds of behavior as inappropriate, so that other characters will refuse indignantly to do any such thing.

***ExampleLatris Theon
A person who can accept instructions to go to new destinations and move towards them according to the most reasonable path.

§12.4. Persuasion

*ExampleThe Hypnotist of Blois
A hypnotist who can make people obedient and then set them free again.

*ExamplePolice State
Several friends who obey you; a policeman who doesn't (but who takes a dim view of certain kinds of antics).

§12.5. Unsuccessful attempts

**ExampleGeneration X
A person who goes along with the player's instructions, but reluctantly, and will get annoyed after too many repetitions of the same kind of unsuccessful command.

§12.6. Spontaneous actions by other people

*ExampleIQ Test
Introducing Ogg, a person who will unlock and open a container when the player tells him to get something inside.

****ExampleBoston Cream
A fuller implementation of Ogg, giving him a motivation of his own and allowing him to react to the situation created by the player.

§12.7. New actions

*ExampleRed Cross
A DIAGNOSE command which allows the player to check on the health of someone.

***ExampleFrizz
Liquid flows within containers and soaks objects that are not waterproof; any contact with a wet object can dampen our gloves.

***Example3 AM
A shake command which agitates soda and makes items thump around in boxes.

§12.9. Check, carry out, report

*ExampleThe Dark Ages Revisited
An electric light kind of device which becomes lit when switched on and dark when switched off.

**ExamplePaddington
A CUT [something] WITH [something] command which acts differently on different types of objects.

***ExampleDelicious, Delicious Rocks
Adding a "sanity-check" stage to decide whether an action makes any sense, which occurs before any before rules, implicit taking, or check rules.

***ExampleNoisemaking
Creating a stage after the report stage of an action, during which other characters may observe and react.

§12.10. Action variables

*ExampleRemoval
TAKE expanded to give responses such as "You take the book from the shelf." or "You pick up the toy from the ground."

*ExampleFurther Reasons Why All Poets Are Liars
The young William Wordsworth, pushing a box about in his room, must struggle to achieve a Romantic point of view.

*ExampleThe Second Oldest Problem
Adapting the going action so that something special can happen when going from a dark room to another dark room.

**ExamplePuff of Orange Smoke
A system in which every character has a body, which is left behind when the person dies; attempts to do something to the body are redirected to the person while the person is alive.

***ExampleCroft
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.

§12.11. Making actions work for other people

**ExampleThe Man of Steel
An escaping action which means "go to any room you can reach from here", and is only useful to non-player characters.

***ExampleTrying Taking Manhattan
Replacing the inventory reporting rule with another which does something slightly different.

****ExampleUnder Contract
Creating a person who accepts most instructions and reacts correctly when a request leads implicitly to inappropriate behavior.

§12.12. Check rules for actions by other people

*ExampleGet Axe
Changing the check rules to try automatically leaving a container before attempting to take it. (And arranging things so that other people will do likewise.)

***ExampleBarter Barter
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.

§12.13. Report rules for actions by other people

**ExampleThe Man of Steel Excuses Himself
Elaborating the report rules to be more interesting than "Clark goes west."

***ExampleFate Steps In
Fate entity which attempts to make things happen, by hook or by crook, including taking preliminary actions to set the player up a bit.

§12.15. Out of world actions

*ExampleSpellbreaker
P. David Lebling's classic "Spellbreaker" (1986) includes a room where the game cannot be saved: here is an Inform implementation.

***ExampleA point for never saving the game
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.

§12.16. Reaching inside and reaching outside rules

**ExampleCarnivale
An alternative to backdrops when we want something to be visible from a distance but only touchable from one room.

§12.17. Visible vs touchable vs carried

**ExampleEddystone
Creating new commands involving the standard compass directions.

***ExampleSlogar's Revenge
Creating an amulet of tumblers that can be used to lock and unlock things even when it is worn, overriding the usual requirement that keys be carried.

§12.18. Changing reachability

*ExampleMagneto's Revenge
Kitty Pryde of the X-Men is able to reach through solid objects, so we might implement her with special powers that the player does not have...

*ExampleWaterworld
A backdrop which the player can examine, but cannot interact with in any other way.

**ExampleDinner is Served
A window between two locations. When the window is open, the player can reach through into the other location; when it isn't, access is barred.

§12.19. Changing visibility

*ExampleFlashlight
Visibility set so that looking under objects produces no result unless the player has a light source to shine there (regardless of the light level of the room).

§12.20. Stored actions

*ExampleBosch
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.

*ExampleCactus Will Outlive Us All
For every character besides the player, there is an action that will cause that character to wither right up and die.

**ExampleActor's Studio
A video camera that records actions performed in its presence, and plays them back with time-stamps.

**ExampleAnteaters
The player carries a gizmo that is able to record actions performed by the player, then force him to repeat them when the gizmo is dropped. This includes storing actions that apply to topics, as in "look up anteater colonies in the guide".


Chapter 13: Relations

§13.2. What sentences are made up from

***ExampleFormal syntax of sentences
A more formal description of the sentence grammar used by Inform for both assertions and conditions.

§13.4. To carry, to wear, to have

*ExampleCeladon
Using the enclosure relation to let the player drop things which he only indirectly carries.

*ExampleInterrogation
A wand which, when waved, reveals the concealed items carried by people the player can see.

§13.6. Making reciprocal relations

***ExampleFour Cheeses
A system of telephones on which the player can call distant persons and have conversations.

§13.7. Relations in groups

*ExampleTransmutations
A machine that turns objects into other, similar objects.

***ExampleOtranto
A kind of rope which can be tied to objects and used to anchor the player or drag items from room to room.

§13.9. Defining new assertion verbs

*ExampleUnthinkable Alliances
People are to be grouped into alliances. To kiss someone is to join his or her faction, which may make a grand alliance; to strike them is to give notice of quitting, and to become a lone wolf.

***ExampleThe Unexamined Life
An adaptive hint system that tracks what the player needs to have seen or to possess in order to solve a given puzzle, and doles out suggestions accordingly. Handles changes in the game state with remarkable flexibility, and allows the player to decide how explicit a nudge he wants at any given moment.

§13.10. Defining new prepositions

*ExampleThe Abolition of Love
A thorough exploration of all the kinds of relations established so far, with the syntax to set and unset them.

*ExampleSwerve left? Swerve right? Or think about it and die?
Building a marble chute track in which a dropped marble will automatically roll downhill.

*ExampleBeneath the Surface
An "underlying" relation which adds to the world model the idea of objects hidden under other objects.

***ExampleBogart
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.

§13.11. Indirect relations

***ExampleThe Problem of Edith
A conversation in which the main character tries to build logical connections between what the player is saying now and what went immediately before.

§13.12. Relations which express conditions

*ExampleWainwright Acts
A technical note about checking the location of door objects when characters other than the player are interacting with them.

***ExampleA Humble Wayside Flower
Relations track the relationships between one character and another. Whenever the player meets a relative of someone he already knows, he receives a brief introduction.

§13.13. Relations involving values

*ExampleMeet Market
A case in which relations give characters multiple values of the same kind.

***ExampleFor Demonstration Purposes
A character who learns new actions by watching the player performing them.

§13.14. Relations as values in their own right

*ExampleNumber Study
The parity and joint magnitude relations explored.

§13.16. What are relations for?

**ExampleMurder on the Orient Express
A number of sleuths (the player among them) find themselves aboard the Orient Express, where a murder has taken place, and one of them is apparently the culprit. Naturally they do not agree on whom, but there is physical evidence which may change their minds...

**ExampleWhat Not To Wear
A general-purpose clothing system that handles a variety of different clothing items layered in different combinations over different areas of the body.

***ExampleMathematical view of relations
Some notes on relations from a mathematical point of view, provided only to clarify some technicalities for those who are interested.

***ExampleGraph-theory view of relations
Some notes on relations from the point of view of graph theory.


Chapter 14: Adaptive Text and Responses

§14.3. More on adapting verbs

**ExampleFun with Participles
Creating dynamic room descriptions that contain sentences such as "Clark is here, wasting time" or "Clark is here, looking around" depending on Clark's idle activity.

**ExampleVariety
Suppose we want all of our action responses to display some randomized variety. We could do this by laboriously rewriting all of the response texts, but this example demonstrates an alternative.

**ExampleVariety 2
This builds on the Variety example to add responses such as "You are now carrying the fedora" that describe relations that result from a given verb, as alternate responses.

***ExampleNarrative Register
Suppose we want all of our action responses to vary depending on some alterable quality of the narrator, so that sometimes they're slangy, sometimes pompous or archaic.

§14.6. Adapting demonstratives and possessives

*ExampleOlfactory Settings
Some adaptive text for smelling the flowers, or indeed, anything else.

§14.9. Verbs as values

**ExampleHistory Lab
We create phrases such as "the box we took" and "the newspaper Clark looked at" based on what has already happened in the story.

**ExampleRelevant Relations
An example of how to create room descriptions that acknowledge particular relations using their assigned verbs, rather than by the heavily special-cased code used by the standard library.

§14.11. Changing the text of responses

*ExampleResponsive
Altering the standard inventory text for when the player is carrying nothing.


Chapter 15: Numbers and Equations

§15.2. Numbers and real numbers

***ExampleAlias
A telephone with phone numbers of the standard American seven-digit length.

§15.8. Units

*ExamplerBGH
The player character's height is selected randomly at the start of play.

**ExampleLethal Concentration 1
A poisonous gas that spreads from room to room, incapacitating or killing the player when it reaches sufficient levels.

**ExampleWonderland
Hiking Mount Rainier, with attention to which locations are higher and which lower than the present location.

***ExampleLethal Concentration 2
Poisonous gas again, only this time it sinks.

§15.12. Making the verb "to weigh"

**ExampleDimensions
This example draws together the previous snippets into a working implementation of the weighbridge.

***ExampleLead Cuts Paper
To give every container a breaking strain, that is, a maximum weight of contents which it can bear - so that to put the lead pig into a paper bag invites disaster.

§15.15. The parts of a number specification

***ExampleZqlran Era 8
Creating an alternative system of time for our game, using new units.

§15.16. Understanding specified numbers

***ExampleSnip
A string which can be cut into arbitrary lengths, and then tied back together.

§15.17. Totals

***ExampleNickel and Dimed
A more intricate system of money, this time keeping track of the individual denominations of coins and bills, specifying what gets spent at each transaction, and calculating appropriate change.

§15.18. Equations

*ExampleWidget Enterprises
Allowing the player to set a price for a widget on sale, then determining the resulting sales based on consumer demand, and the resulting profit and loss.

§15.19. Arithmetic with units

*ExampleFrozen Assets
A treatment of money which keeps track of how much the player has on him, and a BUY command which lets him go shopping.

**ExampleMoney for Nothing
An OFFER price FOR command, allowing the player to bargain with a flexible seller.

***ExampleLemonade
Containers for liquid which keep track of how much liquid they are holding and of what kind, and allow quantities to be moved from one container to another.

***ExampleSavannah
Using the liquid implementation demonstrated in Lemonade for putting out fires.

§15.20. Multiplication of units

*ExampleDepth
Receptacles that calculate internal volume and the amount of room available, and cannot be overfilled.

**ExampleFabrication
A system of assembling clothing from a pattern and materials; both the pattern and the different fabrics have associated prices.

**ExampleThe Speed of Thought
Describing scientifically-measured objects in units more familiar to the casual audience.


Chapter 16: Tables

§16.3. Corresponding entries

***ExampleDubai
An elevator which connects any of 27 floors in a luxury hotel.

§16.6. Repeating through tables

**ExamplePort Royal 4
A cell window through which the player can see people who were in Port Royal in the current year of game-time.

§16.9. Blank rows

*ExampleIf It Hadn't Been For...
A sound recording device that records the noises made by player and non-player actions, then plays them back on demand.

§16.10. Adding and removing rows

**ExampleOdyssey
A person who follows a path predetermined and stored in a table, and who can be delayed if the player tries to interact with her.

§16.11. Sorting

**ExampleJokers Wild
A deck of cards which can be shuffled and dealt from.

§16.12. Listed in...

***ExampleNoisy Cricket
Implementing liquids that can be mixed, and the components automatically recognized as matching one recipe or another.

§16.13. Topic columns

*ExampleMerlin
A REMEMBER command which accepts any text and looks up a response in a table of recollections.

***ExampleQuestionable Revolutions
An expansion on the previous idea, only this time we store information and let characters answer depending on their expertise in a given area.

***ExampleThe Queen of Sheba
Allowing the player to use question words, and using that information to modify the response given by the other character.

§16.14. Another scoring example

***ExampleGoat-Cheese and Sage Chicken
Implementing a FULL SCORE command which lists more information than the regular SCORE command, adding times and rankings, as an extension of the example given in this chapter.

§16.15. Varying which table to look at

**ExampleFarewell
People who respond to conversational gambits, summarize what they said before if asked again, and provide recap of conversation that is past.

§16.16. Defining things with tables

**ExampleSweeney
A conversation where each topic may have multiple questions and answers associated with it, and where a given exchange can lead to new additions to the list.

***ExampleIntroduction to Juggling
Assortment of equipment defined with price and description, in a table.

§16.18. Table continuations

*ExampleFood Network Interactive
Using a menu system from an extension, but adding our own material to it for this game.

§16.19. Table amendments

**ExampleTrieste
Table amendment to adjust HELP commands provided for the player.


Chapter 17: Understanding

§17.1. Understand

*ExampleIndirection
Renaming the directions of the compass so that "white" corresponds to north, "red" to east, "yellow" to south, and "black" to west.

*ExampleXYZZY
Basics of adding a new command reviewed, for the case of the simple magic word XYZZY.

**ExampleXylan
Creating a new command that does require an object to be named; and some comments about the choice of vocabulary, in general.

§17.2. New commands for old grammar

*ExampleAlpaca Farm
A generic USE action which behaves sensibly with a range of different objects.

*ExampleAnchorite
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.

****ExampleCloak of Darkness
Implementation of "Cloak of Darkness", a simple example game that for years has been used to demonstrate the features of IF languages.

§17.3. Overriding existing commands

*ExampleThe Trouble with Printing
Making a READ command, distinct from EXAMINE, for legible objects.

**ExampleLanista 2
Randomized combat in which the damage done depends on what weapons the characters are wielding, and in which an ATTACK IT WITH action is created to replace regular attacking. Also folds a new DIAGNOSE command into the system.

§17.4. Standard tokens of grammar

*ExampleShawn's Bad Day
Allowing the player to EXAMINE ALL.

***ExampleThe Left Hand of Autumn
The possibility of using a [things] token opens up some interesting complications, because we may want actions on multiple items to be reported differently from actions on just one. Here we look at how to make a multiple examination command that describes groups in special ways.

§17.5. The text token

*ExampleIsh.
A (very) simple HELP command, using tokens to accept and interpret the player's text whatever it might be.

**ExampleNameless
ASKing someone about an object rather than about a topic.

§17.6. Actions applying to kinds of value

*ExampleSafety
A safe whose dial can be turned with SPIN SAFE TO 1131, and which will open only with the correct combination.

*ExampleTom's Midnight Garden
A clock kind that can be set to any time using "the time understood"; may be turned on and off; and will advance itself only when running. Time on the face is also reported differently depending on whether the clock is analog or digital.

**ExampleIbid.
A system which allows the author to assign footnotes to descriptions, and permits the player to retrieve them again by number, using "the number understood". Footnotes will automatically number themselves, according to the order in which the player discovers them.

§17.7. Understanding any, understanding rooms

*ExampleOne of Those Mornings
A FIND command that allows the player to find a lost object anywhere

**ExampleActaeon
A FOLLOW command allowing the player to pursue a person who has just left the room.

§17.9. Understanding kinds of value

*ExamplePages
A book with pages that can be read by number (as in "read page 3 in...") and which accepts relative page references as well (such as "read the last page of...", "read the next page", and so on).

**ExampleDown in Oodville
Offering the player a choice of numbered options at certain times, without otherwise interfering with his ability to give regular commands.

***ExampleStraw Into Gold
Creating a Rumpelstiltskin character who is always referred to as "dwarf", "guy", "dude", or "man" -- depending on which the player last used -- until the first time the player refers to him as "Rumpelstiltskin".

§17.10. Commands consisting only of nouns

*ExampleMisadventure
A going by name command which does respect movement rules, and accepts names of rooms as commands.

**ExampleSafari Guide
The same functionality, but making the player continue to move until he reaches his destination or a barrier, handling all openable doors on the way.

§17.11. Understanding values

*ExamplePalette
An artist's workshop in which the canvas can be painted in any colour, and where painterly names for pigments ("cerulean") are accepted alongside everyday ones ("blue").

***ExampleBaritone, Bass
Letting the player pick a gender (or perhaps other characteristics) before starting play.

§17.13. New tokens

*ExampleLies
Commands to allow the player to lie down in three different ways.

§17.15. Understanding things by their properties

*ExampleAspect
Understanding aspect ratios (a unit) in the names of televisions.

*ExampleHymenaeus
Understanding "flaming torch" and "extinguished torch" to refer to torches when lit and unlit.

**ExampleChannel 1
Understanding channels (a number) in the names of televisions.

**ExampleTerracottissima
The flowerpots once again, but this time arranged so that after the first breakage all undamaged pots are said to be "unbroken", to distinguish them from the others.

**ExamplePeers
The peers of the English realm come in six flavours - Baron, Viscount, Earl, Marquess, Duke and Prince - and must always be addressed properly. While a peerage is for life, it may at the royal pleasure be promoted.

***ExampleChannel 2
Understanding channels (a number) in the names of televisions, with more sophisticated parsing of the change channel action.

***ExampleTerracottissima Maxima
Flowerpots with textual names that might change during play.

***ExampleTilt 1
A deck of cards with fully implemented individual cards, which can be separately drawn and discarded, and referred to by name.

§17.16. Understanding things by their relations

*ExampleCinco
A taco shell that can be referred to (when it contains things) in terms of its contents.

*ExamplePuncak Jaya
When a character is not visible, responding to such commands as EXAMINE PETER and PETER, HELLO with a short note that the person in question is no longer visible.

*ExampleWhither?
A door whose description says where it leads; and which automatically understands references such as "the west door" and "the east door" depending on which direction it leads from the location.

**ExampleClaims Adjustment
An instant camera that spits out photographs of anything the player chooses to take a picture of.

§17.17. Context: understanding when

*ExampleQuiz Show
In this example by Mike Tarbert, the player can occasionally be quizzed on random data from a table; the potential answers will only be understood if a question has just been asked.

**ExampleBibliophilia
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.

§17.18. Changing the meaning of pronouns

*ExamplePot of Petunias
Responding sensibly to a pot of petunias falling from the sky.

§17.19. Does the player mean...

*ExampleMasochism Deli
Multiple potatoes, with rules to make the player drop the hot potato first and pick it up last.

§17.20. Multiple action processing

**ExampleThe Best Till Last
Reordering multiple objects for dramatic effect.

**ExampleWestern Art History 305
Allowing EXAMINE to see multiple objects with a single command.

§17.21. Understanding mistakes

*ExampleQuery
Catching all questions that begin with WHO, WHAT, WHERE, and similar question words, and responding with the instruction to use commands, instead.

*ExampleThe Gorge at George
If the player tries to TALK TO a character, suggest alternative modes of conversation.

***ExampleHot Glass Looks Like Cold Glass
Responding to references to a property that the player isn't yet allowed to mention (or when not to use "understand as a mistake").

§17.22. Precedence

*ExampleSome Assembly Required
Building different styles of shirt from component sleeves and collars.

***ExampleLakeside Living
Similar to "Lemonade", but with bodies of liquid that can never be depleted, and some adjustments to the "fill" command so that it will automatically attempt to fill from a large liquid source if possible.


Chapter 18: Activities

§18.1. What are activities?

*ExampleAnt-Sensitive Sunglasses
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.

§18.5. New activities

**ExampleAARP-Gnosis
An Encyclopedia set which treats volumes in the same place as a single object, but can also be split up.

***ExampleAftershock
Modifying the rules for examining a device so that all devices have some specific behavior when switched on, which is described at various times.

***ExampleCrusoe
Adding a "printing the description of something" activity.

§18.9. Deciding the concealed possessions of something

*ExampleHays Code
Clark Gable in a pin-striped suit and a pink thong.

§18.10. Printing the name of something

*ExampleShipping Trunk
A box of baking soda whose name changes to "completely ineffective baking soda" when it is in a container with something that smells funny.

**ExampleTrachypachidae Maturin 1803
Bottles with removable stoppers: when the stopper is in the bottle, the bottle is functionally closed, but the stopper can also be removed and used elsewhere. Descriptions of the bottle reflect its state intelligently.

****ExampleChronic Hinting Syndrome
Using name-printing rules to keep track of whether the player knows about objects, and also to highlight things he might want to follow up.

§18.11. Printing the plural name of something

**ExampleHudsucker Industries
Letters which are described differently as a group, depending on whether the player has read none, some, or all of them, and on whether they are alike or unlike.

§18.12. Printing a number of something

*ExampleProlegomena
Replacing precise numbers with "some" or other quantifiers when too many objects are clustered together for the player to count at a glance.

§18.13. Listing contents of something

*ExampleUnpeeled
Calling an onion "a single yellow onion" when (and only when) it is being listed as the sole content of a room or container.

§18.15. Issuing the response text of something

*ExampleWesponses
Parser messages that are delivered with a speech impediment.

§18.16. Printing room description details of something

*ExampleRules of Attraction
A magnet which picks up nearby metal objects, and describes itself appropriately in room descriptions and inventory listings, but otherwise goes by its ordinary name.

§18.18. Printing a refusal to act in the dark

***ExampleZorn of Zorna
Light levels vary depending on the number of candles the player has lit, and this determines whether or not he is able to examine detailed objects successfully.

§18.22. Printing the description of a dark room

**ExampleHohmann Transfer
Changing the way dark rooms are described to avoid the standard Inform phrasing.

***ExampleFour Stars 1
An elaboration of the idea that when light is absent, the player should be given a description of what he can smell and hear, instead.

§18.23. Constructing the status line

*ExampleWays Out
A status line that lists the available exits from the current location.

**ExampleGuided Tour
A status line that lists the available exits from the current location, changing the names of these exits depending on whether the room has been visited or not.

§18.24. Writing a paragraph about

*ExampleReflections
Emphasizing the reflective quality of shiny objects whenever they are described in the presence of the torch.

**ExampleEmma
Social dynamics in which groups of people form and circulate during a party.

****ExampleAir Conditioning is Standard
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.

§18.25. Listing nondescript items of something

*ExampleRip Van Winkle
A simple way to allow objects in certain places to be described in the room description body text rather than in paragraphs following the room description.

**ExampleHappy Hour
Listing visible characters as a group, then giving some followup details in the same paragraph about specific ones.

**ExampleThe Eye of the Idol
A systematic way to allow objects in certain places to be described in the room description body text rather than in paragraphs following the room description, and to control whether supporters list their contents or not.

§18.26. Printing the locale description of something

*ExamplePriority Lab
A debugging rule useful for checking the priorities of objects about to be listed.

§18.27. Choosing notable locale objects for something

*ExampleLow Light
An object that is only visible and manipulable when a bright light fixture is on.

***ExampleCasino Banale
Creating room descriptions and object descriptions that change as the player learns new facts and pieces things together.

§18.28. Printing a locale paragraph about

*ExampleKiwi
Creating a raised supporter kind whose contents the player can't see or take from the ground.

***ExampleCopper River
Manipulating room descriptions so that only interesting items are mentioned, while objects that are present but not currently useful to the player are ignored.

§18.29. Deciding the scope of something

*ExamplePeeled
Two different approaches to adjusting what the player can interact with, compared.

*ExampleFour Stars 2
Using "deciding the scope" to change the content of lists such as "the list of audible things which can be touched by the player".

**ExampleGinger Beer
A portable magic telescope which allows the player to view items in another room of his choice.

**ExampleRock Garden
A simple open landscape where the player can see between rooms and will automatically move to touch things in distant rooms.

***ExampleStately Gardens
An open landscape where the player can see landmarks in nearby areas, with somewhat more complex room descriptions than the previous example, and in which we also account for size differences between things seen at a distance.

§18.31. Asking which do you mean

*ExampleApples
Prompting the player on how to disambiguate otherwise similar objects.

*ExampleOriginals
Allowing the player to create models of anything in the game world; parsing the name "model [thing]" or even just "[thing]" to refer to these newly-created models; asking "which do you mean, the model [thing] or the actual [thing]" when there is ambiguity.

***ExampleWalls and Noses
Responding to "EXAMINE WALL" with "In which direction?", and to "EXAMINE NOSE" with "Whose nose do you mean, Frederica's, Betty's, Wilma's or your own?"

§18.32. Supplying a missing noun/second noun

*ExampleLatin Lessons
Supplying missing nouns and second nouns for other characters besides the player.

*ExampleMinimal Movement
Supplying a default direction for "go", so that "leave", "go", etc., are always interpreted as "out".

§18.33. Reading a command

**ExampleCloves
Accepting adverbs anywhere in a command, registering what the player typed but then cutting them out before interpreting the command.

**ExampleFragment of a Greek Tragedy
Responding to the player's input based on keywords only, and overriding the original parser entirely.

**ExampleNorth by Northwest
Creating additional compass directions between those that already exist (for instance, NNW) -- and dealing with an awkwardness that arises when the player tries to type "north-northwest". The example demonstrates a way around the nine-character limit on parsed words.

***ExampleComplimentary Peanuts
A character who responds to keywords in the player's instructions and remarks, even if there are other words included.

§18.34. Implicitly taking something

*ExampleThe Big Sainsbury's
Making implicit takes add a minute to the clock, just as though the player had typed TAKE THING explicitly.

*ExamplePizza Prince
Providing a pizza buffet from which the player can take as many pieces as he wants.

***ExampleLollipop Guild
Overriding the rules to allow the player to show something to another character without first taking it.

§18.35. Printing a parser error

*ExampleWXPQ
Creating a more sensible parser error than "that noun did not make sense in this context".

***ExampleXot
Storing an invalid command to be repeated as text later in the game.

§18.37. Printing the banner text

*ExampleBikini Atoll
Delaying the banner for later.

§18.38. Printing the player's obituary

*ExampleBattle of Ridgefield
Completely replacing the endgame text and stopping the game without giving the player a chance to restart or restore.

*ExampleFinality
Not mentioning UNDO in the final set of options.

*ExampleJamaica 1688
Adding a feature to the final question after victory, so that the player can choose to reveal notes about items in the game.

§18.39. Amusing a victorious player

**ExampleXerxes
Offering the player a menu of things to read after winning the game.

§18.40. Starting the virtual machine

*ExampleBlankness
Emptying the status line during the first screen of the game.


Chapter 19: Rulebooks

§19.2. Named rules and rulebooks

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

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

§19.3. New rules

*ExampleThe Crane's Leg 2
A description text generated based on the propensities of the player-character, following different rulebooks for different characters.

*ExampleStone
A soup to which the player can add ingredients, which will have different effects when the player eats.

**ExampleBribery
A GIVE command that gets rid of Inform's default refusal message in favor of something a bit more sophisticated.

§19.4. Listing rules explicitly

*ExampleSaint Eligius
Adding a first look rule that comments on locations when we visit them for the first time, inserting text after objects are listed but before any "every turn" rules might occur.

*ExampleUptempo
Adjust time advancement so the game clock moves fifteen minutes each turn.

*ExampleVerbosity 2
Making rooms give full descriptions each time we enter, even if we have visited before, and disallowing player use of BRIEF and SUPERBRIEF.

**ExampleSlouching
A system of postures allowing the player and other characters to sit, stand, or lie down explicitly or implicitly on a variety of enterable supporters or containers, or in location.

**ExampleSwigmore U.
Adding a new kind of supporter called a perch, where everything dropped lands on the floor.

§19.5. Changing the behaviour of rules

*ExampleAccess All Areas
The Pointy Hat of Liminal Transgression allows its wearer to walk clean through closed doors.

§19.8. New rulebooks

**ExampleSolitude
Novice mode that prefaces every prompt with a list of possible commands the player could try, and highlights every important word used, to alert players to interactive items in the scenery.

***ExampleIn Fire or in Flood
A BURN command; flammable objects which light other items in their vicinity and can burn for different periods of time; the possibility of having parts or contents of a flaming item which survive being burnt.

****ExamplePatient Zero
People who wander around the map performing various errands, and in the process spread a disease which only the player can eradicate.

§19.9. Basis of a rulebook

*ExampleFlotation
Objects that can sink or float in a well, depending on their own properties and the state of the surrounding environment.

§19.11. Success and failure

**ExampleKyoto
Expanding the effects of the THROW something AT something command so that objects do make contact with one another.

§19.12. Named outcomes

*ExampleBeing Peter
A set of rules determining the attitude a character will take when asked about certain topics.

§19.13. Rulebooks producing values

*ExampleFeline Behavior
A cat which reacts to whatever items it has handy, returning the result of a rulebook for further processing.

***ExampleTilt 2
A deck of cards with fully implemented individual cards; when the player has a full poker hand, the inventory listing describes the resulting hand accordingly.

§19.15. Two rulebooks used internally

*ExampleElectrified
Adding a rule before the basic accessibility rule that will prevent the player from touching electrified objects under the wrong circumstances.

*ExampleTimeless
A set of actions which do not take any game time at all.

**ExampleEndurance
Giving different actions a range of durations using a time allotment rulebook.

**ExampleEscape from the Seraglio
Replacing the usual response to TAKE ALL so that instead of output such as "grapes: Taken. orange: Taken.", Inform produces variable responses in place of "grapes:".


Chapter 20: Advanced Text

§20.4. Upper and lower case letters

*ExampleCapital City
To arrange that the location information normally given on the left-hand side of the status line appears in block capitals.

*ExampleRocket Man
Using case changes on any text produced by a "to say..." phrase.

§20.6. Regular expression matching

*ExampleAlpha
Creating a beta-testing command that matches any line starting with punctuation.

*ExampleAbout Inform's regular expression support
Some footnotes on Inform's regular expressions, and how they compare to those of other programming languages.

§20.7. Making new text with text substitutions

*ExampleIdentity Theft
Allowing the player to enter a name to be used for the player character during the game.

*ExampleMirror, Mirror
The sorcerer's mirror can, when held up high, form an impression of its surroundings which it then preserves.

**ExampleThe Cow Exonerated
Creating a class of matches that burn for a time and then go out, with elegant reporting when several matches go out at once.

§20.8. Replacements

*ExampleBlackout
Filtering the names of rooms printed while in darkness.

*ExampleFido
A dog the player can name and un-name at will.

*ExampleIgpay Atinlay
A pig Latin filter for the player's commands.

**ExampleMr. Burns' Repast
Letting the player guess types for an unidentifiable fish.

**ExampleNorthstar
Making Inform understand ASK JOSH TO TAKE INVENTORY as JOSH, TAKE INVENTORY. This requires us to use a regular expression on the player's command, replacing some of the content.

***ExampleCave-troll
Determining that the command the player typed is invalid, editing it, and re-examining it to see whether it now reads correctly.


Chapter 21: Lists

§21.3. Saying lists of values

*ExampleOyster Wide Shut
Replacing Inform's default printing of properties such as "(closed)", "(open and providing light)", etc., with our own, more flexible variation.

§21.5. Building lists

*ExampleRobo 1
A robot which watches and records the player's actions, then tries to repeat them back in the same order when he is switched into play-back mode.

§21.6. Lists of objects

*ExampleWhat Makes You Tick
Building a fishing pole from several component parts that the player might put together in any order.

**ExampleFormicidae
Manipulating the order in which items are handled after TAKE ALL.

§21.9. Accessing entries in a list

***ExampleRobo 2
A robot which watches and records the player's actions, then tries to repeat them back in the same order when he is switched into play-back mode.

§21.10. Lengthening or shortening a list

*ExampleLeopard-skin
A maze that the player can escape if he performs an exact sequence of actions.

**ExampleThe Facts Were These
Creating a variant GIVE action that lets the player give multiple objects simultaneously with commands like GIVE ALL TO ATTENDANT or GIVE THREE DOLLARS TO ATTENDANT or GIVE PIE AND HAT TO ATTENDANT. The attendant accepts the gifts only if their total combined value matches some minimum amount.

§21.11. Variations: arrays, logs, queues, stacks, sets, sieves and rings

*ExampleCircle of Misery
Retrieving items from an airport luggage carousel is such fun, how can we resist simulating it, using a list as a ring buffer?

*ExampleEyes, Fingers, Toes
A safe with a multi-number combination, meant to be dialed over multiple turns, is implemented using a log of the last three numbers dialed. The log can then be compared to the safe's correct combination.

*ExampleThe Fibonacci Sequence
The modest Leonardo Fibonacci of Pisa will be only too happy to construct his sequence on request, using an array.

*ExampleI Didn't Come All The Way From Great Portland Street
In this fiendishly difficult puzzle, which may perhaps owe some inspiration to a certain BBC Radio panel game (1967-), a list is used as a set of actions to help enforce the rule that the player must keep going for ten turns without hesitation, repetition, or deviating from the subject on the card.

*ExampleLugubrious Pete's Delicatessen
In this evocation of supermarket deli counter life, a list is used as a queue to keep track of who is waiting to be served.

*ExampleSieve of Eratosthenes
The haughty Eratosthenes of Cyrene will nevertheless consent to sieve prime numbers on request.

*ExampleYour Mother Doesn't Work Here
Your hard-working mother uses a list as a stack: urgent tasks are added to the end of the list, interrupting longer-term plans.


Chapter 22: Advanced Phrases

§22.2. Descriptions as values

*ExampleCurare
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.


Chapter 23: Figures, Sounds and Files

§23.13. Writing and reading tables to external files

*ExampleAlien Invasion Part 23
Keeping a preference file that could be loaded by any game in a series.

**ExampleLabyrinth of Ghosts
Remembering the fates of all previous explorers of the labyrinth.

***ExampleRubies
A scoreboard that keeps track of the ten highest-scoring players from one playthrough to the next, adding the player's name if he has done well enough.

§23.14. Writing, reading and appending text to files

*ExampleThe Fourth Body
Notebooks in which the player can record assorted notes throughout play.

**ExampleThe Fifth Body
An expansion on the notebook, allowing the player somewhat more room in which to type his recorded remark.

§23.15. Exchanging files with other programs

***ExampleFlathead News Network
Using external files, together with a simple Unix script running in the background, to provide live news headlines inside a story file.


Chapter 25: Releasing

§25.23. Titling and abbreviation

*ExampleBaedeker
Creating a floorplan of the cathedral using the locations from previous examples.

*ExamplePort Royal 5
Port Royal scenario given instructions for an EPS map.

*ExampleBay Leaves and Honey Wine
Creating a map of Greece using the locations from previous examples.


Chapter 27: Extensions

§27.5. A simple example extension

**ExampleModern Conveniences
Exemplifying the kind of source we might use in writing extensions for kitchen and bathroom appliances.

§27.7. Extensions and story file formats

**ExampleTilt 3
Displaying the card suits from our deck of cards with red and black colored unicode symbols.

§27.15. Defining phrases in Inform 6

***ExamplePink or Blue
Asking the player to select a gender to begin play.

§27.19. Longer extracts of Inform 6 code

*ExampleStatus line with centered text, the hard way
A status line which has only the name of the location, centered.

§27.28. Segmented substitutions

*ExampleChanel Version 1
Making paired italic and boldface tags like those used by HTML for web pages.

§27.30. To say one of

*ExampleBlink
Making a "by atmosphere" token, allowing us to design our own text variations such as "[one of]normal[or]gloomy[or]scary[by atmosphere]".

**ExampleUncommon Ground
Making a "by viewpoint" token, allowing us to design our own text variations such as "[show to yourself]quaint[to Lolita]thrilling[to everyone else]squalid[end show]" depending on the identity of the player at the moment.