Inform 7 Home Page / Documentation


§9.4. When play ends

Short of something like a power cut, the story can only end when one of the two participants chooses to end it: either the player, by deciding that enough is enough, or us.

In story-telling, there are many kinds of ending: happy, sad, decisive, bittersweet, surprise. Inform doesn't try to interfere in that kind of artistic choice, but it does need to know one thing about the ending: is it final, or not? Many authors like to make additional menu items available if the player has completed the story right through, but not if she has reached an early or wrong ending. (See the activity "amusing a victorious player", for example.)

end the story

This phrase ends the story at the next opportunity (typically as soon as the current rule ends), with the closing message "The End." The end is not considered final.

end the story finally

This phrase ends the story at the next opportunity (typically as soon as the current rule ends), with the closing message "The End." The end is considered final, and any hidden menu options will be revealed.

end the story saying (text)

This phrase ends the story at the next opportunity (typically as soon as the current rule ends), with the closing message given in the text. The end is not considered final. Example:

end the story saying "You have been stymied"

end the story finally saying (text)

This phrase ends the story at the next opportunity (typically as soon as the current rule ends), with the closing message given in the text. The end is considered final, and any hidden menu options will be revealed. Example:

end the story finally saying "You have defeated Sauron"

The closing message is traditionally set out in asterisks:

*** The End ***

This style is traditional in IF, and goes back to 1980 if not earlier.

We can test the current state like so:

if story has ended:

This condition is true if an end has been declared using one of the "end the story..." phrases.

if story has not ended:

This condition is true if no end has been declared using one of the "end the story..." phrases.

if story has ended finally:

This condition is true if an end has been declared using one of the "end the story finally..." phrases, so that an ending has been reached which the author feels is a completion of the player's experience.

if story has not ended finally:

This condition is true if an end has been declared using one of the "end the story..." phrases, but not "finally", so the author feels that the player can get further experience by playing again and trying different approaches.

The rulebook "when play ends" is the matching bookend to "when play begins". It is followed when the story decides to end (not when the player simply gives up and quits), and before any epitaph like

*** You have been poisoned ***

appears. For example:

When play ends, say "Oh dear."

Surprisingly, the end is not always the end:

resume the story

This phrase causes an ended story to resume exactly as if no "end the story..." phrase had been used. Example:

When play ends:
    if the story has not ended finally:
        say "Oh dear. Still, here's another chance.";
        resume the story.

The phrase is likely to be sensible only as part of a "when play ends" rule. Other traditional uses include giving the player three lives, as in an old-school arcade machine.


arrow-up.png Start of Chapter 9: Time
arrow-left.png Back to §9.3. Introducing tables: rankings
arrow-right.png Onward to §9.5. Every turn

***ExampleBig Sky Country
Allowing the player to continue play after a fatal accident, but penalizing him by scattering his possessions around the game map.