| Chapter 2: The Source Text |

| 2.16. Review of Chapter 2: The Source Text

1. The content of the text.

(a) Assertions. An assertion is a sentence describing the initial state of the world. These are all assertions:

> The Twinkie is a thing.
> The description of the Twinkie is "A confection made of gelatin and preservatives."
> Two hands are part of every person.
> The prevailing wind is a direction that varies.

Assertions are the main subject of the next two chapters.

(b) Rules. Rules tell Inform how the interactive fiction is to behave under certain circumstances. A rule may be fairly short, as

> When play begins, say "Welcome aboard, Mr Bond."

or may contain a longer sequence of instructions, as in

> Instead of attacking the donkey:
> remove the donkey from play;
> if the donkey carries something, now everything carried by the donkey is in the location;
> say "The donkey bolts, of course."

Rules will be covered in much more detail later, but for now note the punctuation: a rule is a list of "phrases". Each phrase except the last ends with a semi-colon to show that the rule is not finished yet.

We may only use "if..." (such as "if the donkey carries something...") within a rule, where Inform can be sure of exactly when the condition is to be considered. (As we shall see later, "Instead of attacking the monkey" tells Inform when the rule is applied.) So the following is not allowed:

> The Rain Forest is a room. If the player is in the Rain Forest, say "Rain falls steadily on your hat and rucksack."

(If the idea is to apply this test all of the time, it needs to be wrapped up in a rule making this clear. "Every turn: if the player is..." would do the trick, as we shall see in the chapter on Time.)

(c) Headings. Headings are typed in their own paragraphs (with a skipped line above and below) and start with one of the words Volume, Book, Part, Chapter or Section. (When typed, they immediately become bold in the source panel.) Headings are useful because they help us to organise and find our way around a large source text. They also make problem messages clearer.

(d) Comments. Comments enclosed in square brackets [like this] allow us to insert our own remarks about the source text. Inform ignores them: they're for our own benefit only.

(e) Tables of information. These have not yet appeared, but look like tables printed in books. They will be the subject of a later chapter.

(f) A few special sentences. A few sentences are read by Inform as instructions on how we want the source text to be understood. For instance, we can say "Use American dialect" or tell Inform to "Include Locksmith by Emily Short" (or some other extension set of rules, by some other author).

2. Testing and Troubleshooting

(a) What's where? Sometimes, during play, we want to see where everything now is. Inform contains a number of testing commands giving us a look behind the scenes: one of these is SHOWME. For instance, if there is a helmet somewhere, SHOWME HELMET tells us about it. Typing SHOWME alone tells us about the current location.

(b) Making our own test commands. We can for instance write:

> Test helmet with "wear helmet / listen / x helmet / doff helmet".

This creates a short sequence of commands which we can replay during the game at any time in order to test whether the helmet does what we intended. (Like all testing commands, these will be omitted from any finished games we create with the Release button. We can exclude other testing-purposes-only material, too, by placing it under a heading which includes the words "not for release".)

(c) Limits. There are several formats in which we can release a finished game. The advantage of the smallest "z5" format is that it is highly portable and can be played on the widest selection of machines, including various kinds of handheld computer. Inform uses this format for any newly-begun project. If we should run out of space, Inform will advise on the options, but the only way to gain a large amount of extra room is to use the Settings panel to switch to a larger format.

Previous | Contents | Next