| Chapter 10: Scenes |

| 10.3. Using the Scene index

But when we test the previous section's example, we find that after a brief wait, the train pulls up: but it never goes away again. We have given instructions on how the scene ends, but not when it ends, and as a result the scene goes on forever once started.

Even with simple story-lines, and this one could hardly be simpler, it is surprisingly easy to overlook something so that the whole story-line is derailed.

The Scene index is intended to help with this. At the top is a chart showing all the scenes and how they are to begin, along with a key to the symbols used on it. One scene always included is "Entire Game", a special scene which, as its name implies, is always being played out. But if we look at the Scene index for the previous example, we will also see our Train Stop scene, and find that it is marked with the red warning symbol for "never ends". Let us fix this:

> Train Stop ends when the time since Train Stop began is 3 minutes.

Note the useful value "time since Train Stop began". (This only makes sense if the scene has begun, of course.) The actual time, in case it is needed, can be obtained with "time when Train Stop began".

| The testing command SCENES causes Inform to monitor the beginning and ending of scenes, and report on them. For instance: >ask monk about lodging "Welcome a poor traveler for the night?" you ask, rubbing your fingers together to restore a little feeling. The monk looks you up and down for a moment and you sense his reaction hanging in the balance; then he slaps you on the back, hard enough to drive the air from your lungs. "In." [Scene 'Greeting' ends] The monk takes your elbow and pushes you imperiously toward dinner. [Scene 'Banquet' begins]

125
| Example Age of Steam The railway-station examples so far put together into a short game called "Age of Steam".

Previous | Contents | Next