| Chapter 12: Advanced Actions |

| 12.9. Check, carry out, report

The normal behaviour of an action is specified by its three associated rulebooks - check, carry out and report. In the case of our "photographing" example, these rulebooks will be:

> Check photographing. Here, for instance, we need to verify that the player has the camera. If any of our checks fail, we should say why and stop the action. If they succeed, we say nothing.

> Carry out photographing. At this stage no further checking is needed (or allowed): the action now definitively takes place. At this point we might, for instance, deduct one from the number of exposures left on the film in the camera, or award the player points for capturing something interesting for posterity. But we should say nothing.

> Report photographing. At this stage no further activity is needed (or allowed): whatever effect the action had, it has happened and is now over. All we can do is to say what has taken place.

So far we have not really gone into the business of what rulebooks are, and we don't do so here either - suffice to say that we can now create whatever rules we need:

> A check photographing rule: if the camera is not carried then say "You can hardly photograph without a camera, now can you?" instead.

In fact, writing "a check photographing rule" is over-formal. We can more simply label our rules like so:

> Check photographing: if we have photographed the noun then say "You've already snapped [the noun]." instead.

> Report photographing: say "Click!"

For the sake of brevity, photography has no interesting consequence (no points to be won, no film to use up), so there are no carry out rules here. Note the way we used the word "instead" once again to stop actions in their tracks.

We can continue to add rules at any point, and a classic thing that happens when testing a new work is that the designer realises there is a case which has not been thought of:

> Check photographing: if the noun is the camera then say "That would require some sort of contraption with mirrors." instead.

162
| Example Waxwork Containers and supporters that report their contents when you EXAMINE them.

163
| Example The Dark Ages Revisited An electric light kind of device which becomes lit when switched on and dark when switched off.

This will be explored more in subsequent examples, but one of the things we can do with carry out rules is extend the function of existing commands so that they do more, or have special effects in specific situations. For instance, suppose we want to have a class of electric light: "The Dark Ages Revisited" An electric light is a kind of device. Carry out switching on an electric light: now the noun is lit. Carry out switching off an electric light: now the noun is unlit. This will not affect the behavior of any other devices when switched; it will also not change the way in which switching lights on and off is reported. The player will still see "You switch the sodium lamp on." or the like. In this case that is probably what we want. If we wanted a special way of describing turning on electric lights as opposed to all other devices, we could also add an after rule for the electric light class. Adding this rule to the carry out train does guarantee, though, that in no case will we manage to make the lamp lit without actually making it switched on (or vice versa). The Stooped Corridor is a room. "A low, square-cut corridor, running north to south, stooping you over." The sodium lamp is an electric light in the Stooped Corridor. "[if switched on]The sodium lamp squats on the ground, burning away.[otherwise]The sodium lamp squats heavily on the ground.[end if]". The description is "It is a heavy-duty archaeologist's lamp, [if switched off]currently off.[otherwise]blazing with brilliant yellow light.[end if]" Instead of burning the sodium lamp, try switching on the lamp. So far so easy. Since we've built the description of its light or darkness into the lamp's description, though, we may want to get rid of the "...is switched on" line that automatically follows when we look at something. For this we do need to borrow from a later chapter: The examine described devices rule is not listed in the carry out examining rules. Test me with "x lamp / switch lamp on / look / x lamp".

164
| Example Removal TAKE expanded to give responses such as "You take the book from the shelf." or "You pick up the toy from the ground."

165
| Example Paddington A CUT [something] WITH [something] command which acts differently on different types of objects.

Previous | Contents | Next