Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jschomay/elm-narrative-engine
A tool for building interactive fiction style stories in Elm.
https://github.com/jschomay/elm-narrative-engine
elm-lang elm-narrative-engine game-engine interactive-fiction
Last synced: about 1 month ago
JSON representation
A tool for building interactive fiction style stories in Elm.
- Host: GitHub
- URL: https://github.com/jschomay/elm-narrative-engine
- Owner: jschomay
- License: other
- Created: 2016-06-21T04:40:54.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-08-18T21:18:20.000Z (over 1 year ago)
- Last Synced: 2024-12-07T19:11:51.201Z (about 2 months ago)
- Topics: elm-lang, elm-narrative-engine, game-engine, interactive-fiction
- Language: Elm
- Homepage: https://enegames.itch.io/elm-narrative-engine
- Size: 1.1 MB
- Stars: 135
- Watchers: 8
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Elm Narrative Engine
A tool for building non-linear interactive story games.
## Usage
```elm
worldModel =
parseWorldModel
[ entity "PLAYER.fear=1"
, entity "TORCH.item.illumination=7.current_location=PLAYER"
, entity "CAVE.location.dark"-- etc...
]rules =
parseRules
[ rule "entering dark places"
"""
ON: *.location.dark
"""
"It's too dark to go in there!"
, rule "entering the cave with a light source"
"""
ON: CAVE
IF: *.item.illumination>5.current_location=PLAYER
DO: PLAYER.current_location=CAVE.fear+2
"""
"You enter the cave, {PLAYER.fear>4? your heart pounding | bravely}..."-- etc...
]inventoryView =
query "*.item.current_location=PLAYER" worldModel |> List.map item_view
```Clone https://github.com/jschomay/elm-interactive-story-starter to get started.
See the [visual editor](https://enegames.itch.io/elm-narrative-engine) to easily author you content and import it into your custom game.