5.3. Text which names things

| Chapter 5: Text |

| 5.3. Text which names things

We can put almost any description of a value in square brackets in text, and Inform will work out what kind of value it is and print something accordingly. (Only almost any, because we aren't allowed to use commas or more quotation marks inside a square-bracketed substitution.)

say "[sayable value]"
or: say "[number]"

This text substitution takes the value and produces a textual representation of it. Most kinds of value, and really all of the useful ones, are "sayable" - numbers, times, objects, rules, scenes, and so on. Example: The description of the wrist watch is "The dial reads [time of day]." Here "time of day" is a value - it's a time that varies, and time is a sayable kind of value, so we might get "The dial reads 11:03 AM."

The values we say most often are objects. If we simply put the name of what we want into square brackets, this will be substituted by the full printed name. We might find:

> "You admire [lantern]."
> = "You admire candle lantern."

But this reads oddly - clearly "the" or "a" is missing. So the following substitutions are used very often:

say "[a object]"
or: say "[an object]"

This text substitution produces the name of the object along with its indefinite article. Example: Instead of examining something (called the whatever): "You can only just make out [a whatever]." which might produce "You can only just make out a lamp-post.", or "You can only just make out Trevor.", or "You can only just make out some soldiers." The "a" or "an" in the wording is replaced by whatever indefinite article applies, if any.

say "[A object]"
or: say "[An object]"

This text substitution produces the name of the object along with its indefinite article, capitalised. Example: Instead of examining something (called the whatever): "[A whatever] can be made out in the mist." which might produce "A lamp-post can be made out in the mist.", or "Trevor can be made out in the mist.", or "Some soldiers can be made out in the mist." The "A" or "An" in the wording is replaced by whatever indefinite article applies, if any.

say "[the object]"

This text substitution produces the name of the object along with its definite article. Example: Instead of examining something (called the whatever): "You can only just make out [the whatever]." which might produce "You can only just make out the lamp-post.", or "You can only just make out Trevor.", or "You can only just make out the soldiers." The "the" in the wording is replaced by whatever definite article applies, if any.

say "[The object]"

This text substitution produces the name of the object along with its definite article, capitalised. Example: Instead of examining something (called the whatever): "[The whatever] may be a trick of the mist." which might produce "The lamp-post may be a trick of the mist.", or "Trevor may be a trick of the mist.", or "The soldiers may be a trick of the mist." The "The" in the wording is replaced by whatever definite article applies, if any.

This may not look very useful, because why not simply put "the", or whatever, into the ordinary text? The answer is that there are times when we do not know in advance which object will be involved. For instance, as we shall later see, there is a special value called "the noun" which is the thing to which the player's current command is applied (thus, if the player typed TAKE BALL, it will be the ball). So:

> After taking something in the Classroom:
> "You find [a noun]."

might produce replies like "You find a solid rubber ball.", "You find an ink-stained blouse.", "You find some elastic bands.", or even "You find Mr Polycarp." (the school's pet hamster, perhaps).

Previous | Contents | Next