Inform 7 Home Page / Documentation

§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;

arrow-up.png Start of Chapter 8: Change
arrow-left.png Back to §8.10. Removing things from play
arrow-right.png Onward to §8.12. Increasing and decreasing

*ExampleBee Chambers
A maze with directions between rooms randomized at the start of play.

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.

***ExampleTechnological Terror
A ray gun which destroys objects, leaving their component parts behind.