Who Inform 7 suits#
Inform 7 suits a story about a place: rooms to explore, objects to pick up, puzzles to solve. If you want the reader to choose from a short list of options instead of typing, ink or Twine fits better.
Start an Inform 7 story#
- Open Create a Story and sign in.
- Under Create from scratch, choose Inform 7.
- Give it a title. To bring in a story you already wrote, pick its
.i7source file under Import an existing .i7 file (1 MB at most). - Press Start writing (or Import & open). The story editor opens on your source.
A new story starts with a small source to build on: a title line, two rooms joined north and south, and a brass lamp. The story is private to you until you publish it.
Your first story#
Replace the starter with the story below and press Play. It has two rooms, a box of matches and a lighthouse lamp to light.
"Last Light" by "Your Name".
The Stairwell is a room. "Iron steps wind up into the dark. The lamp room is above."
The Lamp Room is above the Stairwell. "Salt crusts the windows. The great lens fills the middle of the room."
The great lens is scenery in the Lamp Room. The description of the great lens is "[if the great lens is lit]The beam turns, slow and steady.[otherwise]Rings of thick glass around a cold wick.[end if]"
A matchbox is in the Stairwell. The description of the matchbox is "Three matches rattle inside."
Instead of burning the great lens:
if the player carries the matchbox:
now the great lens is lit;
say "The wick catches. A beam swings out over the water.";
end the story finally saying "The ships come home";
otherwise:
say "You have nothing to light it with."The indented lines under the rule start with tab characters: one tab for the lines under Instead of, two for the lines under if and otherwise. Inform reads tabs as the shape of a rule, so keep them when you copy the example.
When the story opens, try these commands: take matchbox, up, examine lens, light lens. Inform understands light as another word for burn, so the rule for burning the lens answers both.
The syntax#
Inform reads two kinds of sentence. Statements say how the world is when play begins (The crate is in the Gazebo.). Rules say what happens when the reader does something (Instead of taking the crate, say "Too heavy."). Every sentence ends with a full stop, and a paragraph break also ends a sentence.
The title and headings#
The first paragraph, a quoted title with an optional author, names the story. Put the author in quotes when the name has punctuation in it.
"Last Light" by "Your Name".A line on its own that starts with Volume, Book, Part, Chapter or Section is a heading. Leave a blank line before and after it. Headings build the editor's outline.
Chapter 2 - The GalleryText in square brackets outside quotes is a comment: Inform skips it. [Write the storm scene next.]
See 2.5 Headings and 2.3 Punctuation in Writing with Inform.
Rooms and the map#
Name a room, then add its description as a quoted sentence right after it. The reader starts in the first room your source creates.
The Boathouse is a room. "Oars hang in rows along the wall."
The Jetty is west of the Boathouse. "Planks run out over the water."Rooms join in the eight compass directions (north, northeast, east, southeast, south, southwest, west, northwest), plus up, down, inside and outside. A room named only in a map sentence is a room too. When one room's name starts another's (Airport and Airport Road), write A room called the Airport is west of the Airport Road. so Inform makes two rooms.
See 3.1 Descriptions and 3.2 Rooms and the map in Writing with Inform.
Things, scenery and descriptions#
A thing placed in a room can be picked up unless you say otherwise. A quoted sentence after a new thing is how it looks in the room before anyone touches it; its description is what the reader sees on examine.
A brass key is in the Boathouse. "A brass key glints under the bench."
The description of the brass key is "Worn smooth by a thousand turns."
The workbench is scenery in the Boathouse.Scenery stays put and is left out of the room's list of things, so mention it in the room description yourself. The reader can type only the words you used in a thing's name: take key and take brass key work, take shiny key does not. To add a word, write Understand "shiny" as the brass key.
See 3.8 Scenery, 3.11 Two descriptions of things and 17.1 Understand in Writing with Inform.
Containers, supporters and doors#
Inform guesses a thing's kind from how you use it: something with a thing in it is a container, something with a thing on it is a supporter. Say the kind when there is nothing in it yet.
In the Boathouse is a container called the tackle box.
A crate is in the Jetty. On the crate is a lantern.
The Shed is a room. The green door is east of the Boathouse and west of the Shed. The green door is a door.
The green door is lockable and locked. The brass key unlocks the green door.A door sits between two rooms, so write the door into the map instead of the second room. Containers can lock the same way doors do.
See 3.5 Kinds, 3.12 Doors and 3.13 Locks and keys in Writing with Inform.
Actions and rules#
Everything the reader does is an action, written as a word ending in -ing: taking the key, going north, examining the door. A rule starts with when it applies, then a colon, then what to do. With a single instruction you can use a comma instead of the colon.
Instead of eating the brass key, say "It tastes of old pennies."
After taking the lantern, say "The handle is still warm."
Before going west:
say "The planks creak under you."An Instead rule replaces the action. An After rule runs once the action has worked and replaces the usual reply. A Before rule runs first and lets the action carry on. When play begins: runs once at the start, and Every turn, runs after each command.
See 7.1 Actions, 7.2 Instead rules, 7.5 After rules, 9.1 When play begins and 9.5 Every turn in Writing with Inform.
If, now and say#
Inside a rule, three phrases do most of the work: if checks a condition, now makes something true, and say prints text. Phrases in a rule are separated by semicolons.
Instead of opening the tackle box:
if the player carries the brass key:
now the tackle box is open;
say "The lid swings up.";
otherwise:
say "It is locked tight."Lines inside an if or otherwise are indented one tab further in. Inform counts tab characters only, so spaces that look the same do not count. If you prefer not to indent, write begin; after the condition and end if. at the close of the block.
See 2.2 Making rules, 8.11 Now, 11.6 If, 11.7 Begin and end and 11.8 Otherwise in Writing with Inform.
Properties and variables#
A property is a fact about a thing: open, locked, lit, edible, scenery. You can make your own.
A thing can be cursed or uncursed.
The tide is a number that varies. The tide is 3.
Every turn:
decrease the tide by 1;
if the tide is 0, say "The water reaches the jetty."A variable you declare without a value starts at its kind's default: a number starts at 0. increase and decrease change a number in one step.
See 4.7 New either/or properties, 4.12 Values that vary and 8.12 Increasing and decreasing in Writing with Inform.
Text that changes#
Inside quoted text, square brackets hold instructions instead of words. [if ...], [otherwise] and [end if] change a sentence by the state of the world. [one of] picks from a list each time the text is shown.
The description of the Jetty is "[if the lantern is lit]Light pools on the wet planks.[otherwise]You can hardly see the planks.[end if]"
Every turn, say "[one of]A gull cries.[or]Waves slap the posts.[purely at random]"See 5.1 Text with substitutions, 5.6 Text with variations and 5.7 Text with random alternatives in Writing with Inform.
New commands#
To teach the story a new verb, create an action and say which words the reader types for it.
Whistling is an action applying to nothing.
Understand "whistle" as whistling.
Report whistling: say "A thin note carries over the water."See 12.7 New actions, 12.9 Check, carry out, report and 17.1 Understand in Writing with Inform.
Ending the story#
end the story stops play with "The End". end the story saying "..." closes with your own words, and end the story finally marks the ending as the true one.
See 9.4 When play ends in Writing with Inform.
Extensions#
An extension adds ready-made rules to your story. Include one with a sentence that names it and its author:
Include Approaches by Emily Short.The editor's compiler carries six extensions: Approaches by Emily Short, Numbered Disambiguation Choices by Aaron Reed, Bulk Limiter by Eric Eve, Underside by Eric Eve, Poor Man's Mistype by Aaron Reed and Smarter Parser by Aaron Reed. Other extensions are not available to it.
See 2.11 Including extensions in Writing with Inform.
What the editor does for Inform 7#
The editor shows your source on one side and the build on the other. Everything below is on the story editor guide too, with each control's place on a phone.
- Play builds your story on our servers with Inform 7 version 10.1.2, then opens it on its play page in a new tab. The key reads Compiling… while it works. Building costs no credits.
- Output picks the story file format: Glulx (the default, and what the Inform manual recommends) or Z-machine. Your choice is kept with the story.
- Problems, under the source, lists what the compiler reported, with a count. Each problem quotes the sentence it is about. When the editor finds that sentence in your source, the problem is a key: press it to jump there. How to fix, beside a problem this guide covers, opens its section below in a new tab. The preview pane says how many problems are left.
- Outline, beside the source, lists your headings. Press one to jump to it. The fold key at its top narrows it to a strip, and this device remembers the choice.
- Extensions lists the six extensions the compiler carries, each with its author and licence. Insert Include line adds the
Includesentence under your title. TypingIncludein the source suggests their names too, and the author is credited in your compiled story. - AI co-writer, Suggestions and Lorebook help you write. Every suggestion the AI writes is compiled with your story before you see it, and nothing changes until you press Accept. Each AI action costs 1 credit on the free plan and 2 credits on a paid plan; a suggestion that does not compile is not charged. See the AI tools.
- Details holds the title, summary, tags, content rating, cover, audio, credits and publishing settings.
- Publish records a version of the story. Who can play it (Private, Unlisted or Public) is set under Details, in Publishing.
- Guide and Syntax, in the top bar, open this guide and its syntax section.
Your source saves as you type.
Fix common problems#
Inform reports a problem as a paragraph that quotes the sentence it is about. These ten are the ones writers meet most. Under each heading, the words in quotes are taken from the problem as Inform writes it.
A sentence with no verb#
"I can't find a verb that I know how to deal with." Inform could not read the sentence as a statement. Check for a missing is, a typo in the verb, or a full stop in the middle of what should be one sentence.
A rule that ends in a full stop#
"It looks as if it might be a rule definition, but if so then it is lacking the necessary colon (or comma)." Put a colon after the rule's opening (Before taking something:), or a comma when one instruction follows on the same line. A stray if on its own line ("an 'if' phrase which has slipped its moorings") has the same cause: a full stop or blank line ended the rule early, so join it back with a semicolon.
Tabs that do not line up#
"The tabs here seem to be misaligned, and I can't determine the structure." Each line in a block must sit exactly one tab further in than the if, otherwise or rule opening above it. Replace any run of spaces at the start of a line with tabs.
Two sentences that contradict each other#
"This looks like a contradiction." Two statements put the same thing in two places, or two rooms in the same direction. The problem quotes both sentences: change one of them.
Quoted text with nothing to describe#
"I can't decide to what room or thing you intend that text to belong." A quoted sentence on its own describes the room or thing named just before it. Move it right after its room or thing, or write The description of the Jetty is "...".
A property the thing cannot have#
"Is not allowed to exist, because you haven't said it is." The property does not suit that kind: a room cannot be portable. Check the kind of the thing, or create the property first with A thing can be ....
A phrase Inform does not know#
"This is a phrase which I don't recognise." Check the wording against the manual. The problem also points to a common cause: the sentence before it is missing its full stop.
Text in brackets Inform cannot read#
"It didn't look like any form of 'say' that I know." The words inside [...] in a quoted text are not a text substitution Inform knows. Check the spelling, or end the say phrase with its semicolon or full stop.
An extension the compiler cannot find#
"I can't find the extension requested by:". The editor's compiler carries six extensions, listed above under Extensions. Use the Extensions tool to insert the exact Include sentence.
No room to start in#
"There doesn't seem to be any location in this story." Inform knows a room only when you say ... is a room or join it to another room on the map. Add a room sentence.
The Inform 7 manual#
The full guide to the language is Writing with Inform, free online on the Inform website. Each chapter has worked examples you can paste into the editor and play. The compiler's source and its problem messages are in the Inform repository on GitHub.