| Chapter 8: Change |

| 8.10. Now...

As Chapter 5 has already discussed, Inform looks at a whole range of "relations" between objects, many of which we can change. The general rule is as follows. Suppose S is a sentence about a relationship between things. Then there are three things we can do with S:

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

The effect of "now the apple is in the basket" is identical to "move the apple to the basket", so this appears to offer nothing new; and "now" duplicates other things already available, too, because "now the oaken door is open" does the same thing as "change the oaken door to open". But "now" is more general and more flexible. For instance,

> now the top hat is worn by Mr Darcy;

will make the hat worn, rather than simply carried, by Darcy: this is something which could not be done with the "move" phrase. We can also apply "now" to many things at once:

> now all the doors are open;
> now all of the things in the sack are in the box;

The second of these moves the entire contents of the sack to the box.

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

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

"Technological Terror" The Decomposition Ray Gun is a thing carried by the player. First we need to define our shooting action: Shooting it with is an action applying to two things. Check shooting something with something: if the player is not carrying the Ray Gun, say "You are pathetically unarmed!" instead; if the second noun is not the Ray Gun, say "[The second noun] does not fire." instead; if the noun is the Ray Gun, say "Nice trick if you can do it!" instead; if the noun is the player, say "That would be disastrous!" instead. Next, some grammar to allow the player to use this action: Understand "shoot [gun] at [something ungunlike]" as shooting it with (with nouns reversed). Definition: a thing is ungunlike if it is not the gun. Understand "shoot [something ungunlike] with [gun]" as shooting it with. Understand "shoot [something] with [something]" as shooting it with. Understand "shoot [something] at [something]" as shooting it with (with nouns reversed). Understand "fire [gun] at [something ungunlike]" as shooting it with (with nouns reversed). Understand "fire at [something ungunlike] with [gun]" as shooting it with. Understand "fire at [something] with [something]" as shooting it with. Strictly speaking, we only need these last grammar lines (with "understand shoot something...") in order to define an action that the player can take. Adding more grammar lines means that Inform will try to match the most specific ones first, which is useful when the player types something ambiguous and there is one choice that obviously fits this action better than the others. See the chapter on Understanding for a further discussion. Here we get to use "now..." to give it its destructive effect: Carry out shooting something with something: say "ZAP! [The noun] twinkles out of existence! [if something is part of the noun][The list of things which are part of the noun] clatter to the ground! [end if][paragraph break]"; now every thing which is part of the noun is in the location; remove the noun from play. The Deathbot Assembly Line is a room. "Here is the heart of the whole operation, where your opponents are assembled fresh from scrap metal and bits of old car." The dangerous robot is a thing in the Assembly Line. "One dangerous robot looks ready to take you on!" A robotic head, a drill arm, a needle arm, a crushing leg and a kicking leg are parts of the dangerous robot. Instead of examining something when something is part of the noun: say "[The noun] consists of [a list of things which are part of the noun]." Test me with "x robot / shoot robot / fire at kicking leg / shoot gun at drill arm / look".

Previous | Contents | Next