a revelation
 
 
 
Go to file
Dozens B. McCuzzins 6941e6e415 add twee and html
turns out twee, the plain text twine format, is dead simple. a little
sed and a recfmt template, and now we have twine support! installed
tweego[1] and now i have a little html pipeline! and with the twison
format library[2] i also get a json object of the whole game in case i
want to embedd it in some other framework or something. the only kind of
annoying part is that instead of generating json, it generates a
preformatted html tag full of the json object that is created on the fly
with javascript. so you can't just dump the contents. you have to open a
browser and copy the contents of the div to a file. unless you use like,
a headless browser or something.

[1]: https://www.motoslave.net/tweego/docs/
[2]: https://github.com/lazerwalker/twison
2023-11-28 21:51:33 -07:00
assets 🌽 dither it! 2023-10-24 22:22:39 -06:00
db 🛠️ 2023-10-23 09:14:55 -06:00
doc 📝 2023-10-23 09:34:57 -06:00
lib 🗄️🔧 2023-10-16 22:16:35 -06:00
out add twee and html 2023-11-28 21:51:33 -07:00
templates add twee and html 2023-11-28 21:51:33 -07:00
tmp 🌽 dither it! 2023-10-24 22:22:39 -06:00
Makefile 🛠️ 2023-10-23 09:14:55 -06:00
README 📝 2023-10-23 09:34:57 -06:00
cornbeast.eps 🌽 dither it! 2023-10-24 22:22:39 -06:00
justfile add twee and html 2023-11-28 21:51:33 -07:00
tags 🌽 2023-10-23 07:16:13 -06:00

README

CORNQUEST

> a revelation

## about

this is a choose your own adventure game

![example](doc/example.png)

i am writing it with the goal of submitting it to volume ~~6~~ 7 of the tilde.town zine

## requirements

- recutils v1.9: database, querying, and templates

- mustache v4.2.0: more different templating

- just v1.4.0: command runner

- graphviz v5.0.1: to make a graph!

## getting started

the whole game is in a recfile.
see: `db/game.rec`.

each record has an `id`.

each record has a `text` field that is the narrative text of the section, including branching choices.

branches should refernece the `name` of another field in {{mustachequotes}}.

to build the output, we will build a `data` object mapping all names to ids (with recsel and sed; see the just/makefile for details).
next, mustache will use that data object to replace the {{template strings}} in the recfile with id numbers.
finally the expanded recfile will be piped through recfmt, which will dump the text of the game.

you can also create a graph of the story nodes with `just graph` if you have graphviz installed.
this is handy for visualing your story paths, studying the shape of your story, and seeing if you have any islands or orphan nodes.
it does pretty much the same thing as `just build`, except it outputs a DOT file, and then creates `graph.png`.