| Chapter 10: Scenes |

| 10.8. Multiple endings

Interactive fictions vary considerably in the extent to which the player is allowed to influence the story-line. Sometimes the appearance of making choices is wholly bogus, as only one possible line is given more than lip service. But in other works, the player can radically change the outcome, and whole rafts of plot differ between one person's experience and another's. Inform allows multiple endings to its scenes to make this kind of branching story-line easy to achieve.

Any scene can have up to 8 alternate endings, differentiated by name. These are created as and when conditions are set for them:

> Brief Encounter ends happily when ...
> Brief Encounter ends wisely but sadly when ...

"Ends happily" and "ends wisely but sadly" behave just like "ends". We can have rules "When Brief Encounter ends happily, ..." and so forth, in addition to rules "When Brief Encounter ends, ..." - if a rule doesn't specify any particular ending, it applies to all of them.

We can also link rules together from these branches, so

> Stranger's Acceptance begins when Brief Encounter ends happily.
> Stranger's Rejection begins when Brief Encounter ends wisely but sadly.

With this set-up and that of the previous section, there are now two possible paths through the story:

> (i) Train Stop - Brief Encounter - Stranger's Acceptance - Bittersweet Ending
> (ii) Train Stop - Brief Encounter - Stranger's Rejection - Bittersweet Ending

We might later need to know which of these paths has been taken, and to help with this Inform provides conditions like so:

> if Brief Encounter ended happily ...
> if Brief Encounter ended wisely but sadly ...

(For a scene which repeats, note that these conditions apply only to the most recent repetition: and that such conditions are always false if the scene is currently going on.)

133
| Example Panache Replacing the score with a plot summary that records the events of the plot, scene by scene.

134
| Example Pine 4 Pine: Adding a flashback scene that, instead of repeating endlessly, repeats only until the Princess has understood the point.

Previous | Contents | Next