8.11. Now...

| Chapter 8: Change |

| 8.11. Now...

"Now" has already appeared several times in this chapter, being used like a Swiss army knife to change values of all kinds:

> now the score is 100;

In fact, "now" is by far the most flexible phrase known to Inform.

now (a condition)

This phrase makes the condition become true. Examples: now the score is 100; now the player is Kevin; now the front door is open; now Mr Darcy is wearing the top hat; now all the doors are open; now all of the things in the sack are in the box; Inform issues a problem message if the condition asks to do the impossible ("now 3 is an even number") or is vague ("now the duck is not in the Lily Pond") or not in the present tense ("now the front door had been open").

We've now seen all three things which can be done with a condition S which describes the world:

> S. - The relation holds at the start of play.
> if S, ...; - Does the relation hold right now?
> now S; - Make the relation hold from now on.

For instance,

> The apple is in the basket.
> if the apple is in the basket, ...;
> now the apple is in the basket;

125
| Example Bee Chambers A maze with directions between rooms randomized at the start of play. |
RB

Mazes are a traditional element of interactive fiction, often consisting of apparently identical rooms with exits that do not work reciprocally and which cause confusion. The methods of mapping mazes are now fairly well understood and mazes themselves tend to be regarded as tiresome rather than enjoyable by a large portion of the playing audience. However, if we did want to ignore the common wisdom and create a maze, randomly generated at the start of play, here would be one way to go about it: "Maze of Gloom" A Bee Chamber is a kind of room. The printed name of a Bee Chamber is usually "Hexagonal Room". The description of a Bee Chamber is usually "Waxy, translucent walls surround you on six sides; the floor and ceiling are made of the same material, gently uneven. There are exits in every direction, cut into the faces or the corners." Bee1, Bee2, Bee3, Bee4, Bee5, Bee6, Bee7, Bee8, Bee9, and Bee10 are Bee Chambers. When play begins: now right hand status line is "[number of visited rooms]/[number of rooms]"; repeat with place running through Bee Chambers: now a random Bee Chamber is mapped north of place; now a random Bee Chamber is mapped northwest of place; now a random Bee Chamber is mapped west of place; now a random Bee Chamber is mapped southwest of place; now a random Bee Chamber is mapped south of place; now a random Bee Chamber is mapped southeast of place; now a random Bee Chamber is mapped east of place; now a random Bee Chamber is mapped northeast of place; now a random Bee Chamber is mapped above place; now a random Bee Chamber is mapped below place; now a random Bee Chamber is mapped inside place; now a random Bee Chamber is mapped outside place. Test me with "in / out / up / down / n / ne / nw / e / w / sw / se / s".

126
| Example Hatless It's tempting to use "now..." to distribute items randomly at the start of play, but we need to be a little cautious about how we do that. |
RB

127
| Example Technological Terror A ray gun which destroys objects, leaving their component parts behind. |
RB

Previous | Contents | Next