| Chapter 5: Text |

| 5.6. 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 saying "[line break]" forces a line break in the text, and "[paragraph break]" forces a paragraph break.

More subtly, saying "[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]";

55
| Example Examining everything at once Making the SEARCH command examine all the scenery in the current location.

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: 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 begin; say "[point of interest]: [run paragraph on]"; try examining the point of interest; end repeat. Understand "search" as studying the vicinity. 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.

Previous | Contents | Next