Chapter 5: Text
5.7. Line breaks and paragraph breaks

Inform has an automatic mechanism which tries to ensure that paragraph breaks occur naturally when different rules produce text. Thus, if a rule says "Arnold suddenly rushed out of the room!", this will normally be set apart from the text preceding it by a paragraph break.

This mechanism is quite hard to fool, but not impossible, so text substitutions are provided to override it. Saying "[line break]" forces a line break, "[no line break]" prevents one. For instance:

"The chorus sing [one of]Jerusalem[or]Rule, Britannia![no line break][at random]."

Here the "[no line break]" stops Inform from thinking that the exclamation mark means a sentence ending - it's part of the name of the song "Rule, Britannia!".

"[paragraph break]" forces a paragraph break. More subtly, "[run paragraph on]" effectively makes the next paragraph run straight on from the current one. And saying "[conditional paragraph break]" marks a place where Inform can put a paragraph break if it needs one. (This is sometimes useful when producing a large amount of text which changes with the circumstances so that it is hard to predict in advance whether a paragraph break is needed or not.)

There is just one other form of paragraph break, used only in special circumstances: printing clarificatory text after a command, when we are telling the player that we are making a guess at what was meant. For instance:

(first opening the Wicket Gate)

Conventional spacing here is that text should immediately follow on the next line, unless we are going to a different room and looking around, in which case a line break should be added. We can get this spacing convention using the text substitution "[command clarification break]"; for instance:

say "(first opening [the noun])[command clarification break]";


66
** Example  Beekeeper's Apprentice
Making the SEARCH command examine all the scenery in the current location.

RB

We have to create a suitable action and say what it does, and to repeat what we do through all the scenery items. That needs material from subsequent chapters, but is quite ordinary Inform all the same:

"Beekeeper's Apprentice"

Studying the vicinity is an action applying to nothing.

Report studying the vicinity:
    if the location does not contain something which is scenery:
        say "There's little of interest in the [location]." instead;
    repeat with point of interest running through scenery in the location:
        say "[point of interest]: [run paragraph on]";
        try examining the point of interest.

Understand "search" as studying the vicinity.

The Yard is a room.

The hive and the honey are scenery things in the Yard. The description of the hive is "The honeycombed hive is all around you, thrumming with life." The description of the honey is "Wax-sealed honey has been cached in many of the hexagonal nurseries."

Test me with "search".

The reason for this example is to show the use of saying "[run paragraph on]". It means we have output such as:

>search
hive: The honeycombed hive is all around you, thrumming with life.

honey: Wax-sealed honey has been cached in many of the hexagonal nurseries.

Without the running on, the prompts "hive:" and "honey:" would be separated from the descriptions following them, which would look a little odd.


PreviousContentsNext