11.6. Ending The Story

| Chapter 11: Out Of World Actions and Effects |

| 11.6. Ending The Story

Play can end in many ways, at the writer's discretion:

> end the story;
> end the story finally;
> end the story saying "You have reached an impasse, a stalemate";
> end the story finally saying "You have succeeded.";

The phrase "end the story" by itself will finish play, printing "*** The End ***". Using one of the phrases with "saying..." allows us to specify some other text with which to conclude. Including "finally" means that the player has earned access to AMUSING text and other notes, if any of these are provided.

We can eliminate the asterisked headline entirely by removing the rule that prints it, thus:

> The print obituary headline rule is not listed in any rulebook.

The next step is to print the player's score and, if applicable, the rank he achieved. If there is no score in the game, we can prevent a score being listed here with

> Use no scoring.

Or, if we want to allow a score but alter the way it is reported, we may remove or modify the print final score rule, as in

> The print final score rule is not listed in any rulebook.

or perhaps something like

> The chatty final score rule is listed instead of the print final score rule in for printing the player's obituary.

> This is the chatty final score rule: say "Wow, you achieved a whole [score in words] point[s] out of a possible [maximum score in words]! I'm very proud of you. This was a triumph. I'm being so sincere right now."

What happens next is normally that the player is invited to RESTART, RESTORE (from a saved game), QUIT or UNDO the last command. The presence of the question can somewhat undercut a tragedy, and Battle of Ridgefield shows another way to go out.

If we do leave the question in, the text is formed by the Table of Final Question Options, which by default looks like this:

> Table of Final Question Options

> final question wording | only if victorious | topic | final response rule | final response activity
> "RESTART" | false | "restart" | immediately restart the VM rule | --
> "RESTORE a saved game" | false | "restore" | immediately restore saved game rule | --
> "see some suggestions for AMUSING things to do" | true | "amusing" | -- | amusing a victorious player
> "QUIT" | false | "quit" | immediately quit rule | --
> "UNDO the last command" | false | "undo" | immediately undo rule | --

Because this is a table, we may alter the behavior by changing entries or continuing the table. Finality shows how we might take out the option to UNDO the last command, for instance.

Using an ending phrase that includes "finally" tells Inform to include the options that are marked "only if victorious". One common use is to let the player read some special bit of additional text, perhaps describing easter eggs he might have missed in the story or presenting some authorial notes. Xerxes demonstrates a simple AMUSING command to read final information, while Jamaica 1688 shows how to add completely new elements to the list of options.

Old-school adventures expected their adventurers to die early and die often. Labyrinth of Ghosts shows how the residue of such past attempts can be preserved into subsequent attempts, using an external file. Big Sky Country shows how a player can be resurrected by, let us say, some beneficent god, so that a player can even die more than once in the same attempt.

370
| Example Battle of Ridgefield Completely replacing the endgame text and stopping the game without giving the player a chance to restart or restore. |
WI

369
| Example Finality Not mentioning UNDO in the final set of options. |
WI

372
| Example Xerxes Offering the player a menu of things to read after winning the game. |
WI

371
| Example Jamaica 1688 Adding a feature to the final question after victory, so that the player can choose to reveal notes about items in the game. |
WI

430
| Example Labyrinth of Ghosts Remembering the fates of all previous explorers of the labyrinth. |
WI

138
| Example Big Sky Country Allowing the player to continue play after a fatal accident, but penalizing him by scattering his possessions around the game map. |
WI

Some older games allowed the player to be resurrected after a death, but punished him by distributing his possessions far and wide. Here we emulate that effect. "Big Sky Country" When play begins: say "There's a bit of a drive over from Anaconda, Montana, and then through a couple or three ghost towns, but finally you find what you're looking for, and strike out on foot..." Entrance to Devil's Canyon is a room. "You are at the top of a steep road, which proceeds down into the canyon proper." A sign is in Devil's Canyon. It is fixed in place. "An ominous sign has been put up by the local sheriff's office." The description is "PROCEED AT OWN RISK - NO RESCUES!" Instead of going down when a random chance of 1 in 3 succeeds: say "Whoooops, your footing is not as secure as you thought..."; end the story. Dusty Path is below Entrance. "A dusty path, with grey-brown thorny bushes on either side. Immediately to your right is a sheer drop; far below you can see the rusting remains of a Model T that some fool tried to drive by here." Hairpin is below Dusty Path. "A sharp bend in the road, doubling back down towards the bottom of the canyon. Just north of here there is also a small cavern of some kind[if the stick pin is in the cavern], which attracts your eye with some glittery thing[end if]." The Cavern is north of Hairpin. "Really not much more than a little hollow in the side of the canyon." In the cavern are a snake and a diamond stick pin. The snake is an animal. The description of the snake is "You're no expert, but it looks like a rattler." Instead of taking the diamond stick pin in the presence of the snake: say "Turns out the snake is partial to that there pin, and takes exception to your intending to make off with it."; end the story. In a fuller implementation of this game, we might make it possible to get by the snake, but in this version, it's just going to remain troublesome. Crooked Path is below Hairpin. "You're about two thirds of the way down to the bottom of the cavern at this point." At the Spot is below Crooked Path. "This'll be it: a bare patch of ground that might as well have an X painted right on it." Rule for supplying a missing noun while digging: now noun is the location. Understand "dig" or "dig hole/here" or "dig in ground/dirt/earth" as digging. Digging is an action applying to one thing. Instead of digging at the spot: say "You dig and dig, and after a half hour or so, sure enough, you do turn up a big box of gold! You're going to be richer than God and Bill Gates put together."; increase the score by 5; end the story finally. Instead of digging at the spot when the player does not carry the shovel: say "What, without your shovel? That won't work too well." The player carries a walking stick. The player wears a hat, a whistle, and a daypack. The daypack contains a mylar blanket, a granola bar, a cellular phone, a water bottle, a folding shovel, and a photocopied map. The granola bar is edible. Instead of drinking the water, say "You quench your thirst, for the time being." The description of the map is "The map shows the winding path of Devil's Canyon, with a large X down by the south end. That would be where your uncle Jesse buried the gold from the train robbery." The maximum score is 5. When play ends when the story has not ended finally: say "Oh dear, that ought to be fatal! However, if you like I can get you out of it... Shall I? >"; if the player consents: repeat with item running through things had by the player: move the item to a random visited room; say "A strong wind picks you up and sets you back at [the location], though perhaps minus a few of your things."; resume the story; try looking. "If the player consents" is just a convenient way to ask a yes/no question that the player must answer before going on with the game.

Previous | Contents | Next