Inform 7 Home Page / Documentation


§14.2. Adaptive text

Paying attention to the tense and viewpoint is one reason why text might need to adapt. Another is that it might need to adapt according to whether nouns are singular or plural, or whether it talks about the player or some third party. For example, the following rule isn't ideal:

Instead of taking: say "[The noun] is pinned down by Dr Zarkov's force field."

Most of the time it's fine ("The V-ray is pinned down by Dr Zarkov's force field"), but then:

> GET ME
You is pinned down by Dr Zarkov's force field.
> GET CONDENSERS
The condensers is pinned down by Dr Zarkov's force field.

Which is a little unfortunate. But the correction is very easy:

Instead of taking: say "[The noun] [are] pinned down by Dr Zarkov's force field."

The result is much better: "The V-ray is pinned down..."; "You are..."; "The condensers are...". In fact, it's also convenient because it adapts to the story viewpoint and story tense: "The condensers will be pinned down..."; "He was pinned down...".

How does Inform do this? The answer is not that "[are]" is a specially-written text substitution. In fact Inform can do this with any verb that it has a definition of. For example,

"[The noun] [carry] too much static charge."

would also adapt itself - "The V-ray carries too much static charge", and so on. There aren't many verbs built in to Inform, but "[have]" and "[carry]" and "[wear]" and "[can]" may be useful, and "[can see]" and "[can touch]". Negative forms like "[are not]" are also available:

"[The noun] [cannot touch] the ionizer terminal."

might produce "The V-ray will not be able to touch the ionizer terminal.", for example.

As these examples hint, the verb adapts itself to the most recently printed object name. All of this only works if the previous object's name is printed from a substitution. So:

"[The condensers] [are] working."

will work -- correctly forming "The condensers are working.", "The condensers will be working." or "The condensers were working.", according to the story tense -- but

"The condensers [are] working."

probably won't work. Inform doesn't have any way to understand the raw text outside of the text substitution marks "[" and "]", and it doesn't recognise "The condensers" as being something's name.

Something else to be careful with is the use of lists. If we write this:

"[The condensers] and [the V-ray] [are] smashed by Voltan's birdmen."

then Inform is likely to print:

The condensers and the V-ray is smashed by Voltan's birdmen.

because it looks at the most recently named object - the V-ray, singular - to decide whether to use "is" or "are". On the other hand, Inform gets this right:

"[The list of things on the bench] [are] smashed by Voltan's birdmen."

Because Inform constructs the list itself, it's able to appreciate that the things listed are jointly the subject of the verb, and it uses that information to decide on "is" or "are". So:

The condensers and the V-ray are smashed by Voltan's birdmen.
The Atomic Furnace shovel is smashed by Voltan's birdmen.


arrow-up.png Start of Chapter 14: Adaptive Text and Responses
arrow-left.png Back to §14.1. Tense and narrative viewpoint
arrow-right.png Onward to §14.3. More on adapting verbs