Markup Based Story Scripting
From Pirates and Traders 2
The following page describes some ideas for a scripting language for writing interactive text narratives based on Markdown. The script language described here is inspired by Ficdown and Squiffy in addition to ideas and constructs from my own "StoryEngine".
Story, Scenes, and Passages
# [Story Title](/first-scene) Heading level 1 is used to define the story itself. The story title should be an anchor that links to the first scene. ## First Scene Heading level 2 is used to define the scene. ### A passage A passage is a line of text that is shown when a link is clicked, but which does otherwise not affect the story.
Scenes are referenced by a sanitized version of their names; all non-word characters are removed, and spaces are replaced with hyphens. Names can be truncated to 16 characters; so e.g. "a very long and convoluted scene name" can be referenced as "a-very-long-and-".
Linking Scenes
Links can be used to travel between scenes. Lists are used to create a list of links at the bottom of a scene.
## Second Scene This is scene number two. What would you like to do? - [Go back to the first scene](/first-scene) - [Repeat this one](/second-scene)
From the point of view of my game engine, a list of links at the end is the best way to handle this; but in theory there is no reason why such links could not be embedded anywhere in the text.
A link to a passage disappears after that passage has been shown. It returns if you return to the scene later.
Section and passage names are only unique within their story or section.
It should be possible to link across multiple stories. E.g.,
- [Link from another place](/story-title/first-scene/a-passage)