A framework for telling interactive stories, based on specific design principles:
For the readers/players:
For authors:
See https://github.com/jschomay/elm-interactive-story-starter.git for everything you need to get started, including an example story you can modify with your own content.
Step 1: Define your "story interactables" (items, locations, and characters)
type MyItem
= Umbrella
...
items : MyItem -> ItemInfo
items item =
case item of
Umbrella ->
itemInfo "Umbrella" "Your trusty umbrella, you bring it everywhere with you."
...Step 2: Define your declarative "story rules," broken up into "scenes"
scene1 : List (Story.Rule MyItem MyLocation MyCharacter MyKnowledge)
scene1 =
[ { interaction = withCharacter Harry
, conditions = [ inLocation Garden ]
, changes = [ moveCharacter Harry Marsh, addInventory NoteFromHarry ]
, narration = [ "He gives you a note, then runs off.", "I wonder what he wants?" ]
}
, { interaction = withInventory NoteFromHarry
, conditions = []
, changes = [ addLocation Marsh ]
, narration = [ "It says, \"*Meet me in the marsh.*\"" ]
}
]Step 3: Load your story interactables and rules into the framework
Story.load info world setup