I wanted to make a Twine story format for the idea of a story/game I had so here it is. I'm also learning how to make a Twine story format.
Option 1 (Twine): View the raw format.js file, and copy the URL into Twine > Story Format > Add
Option 2 (CLI compilers like tweego): Download format.js from dist and place them in a proper directory (i.e. storyformats for tweego).
yarn build-formatThis will:
- Build the Typescript used to make up the format code (i.e.
/src/index.js). - Inject that js into the HTML source (via handlebars:
/src/index.mustache) - Inject that HTML into the
sourceattribute in the format JSON and finally, - Write out that JSON (wrapped in a
window.storyFormatJSON-P style call) todist/format.js
yarn serveWill start a dev server at http://localhost:3000 hosting tests/test-stories/basic.twee, for testing. Will automatically rebuild when any ts, scss, or hbs file is changed. Will not autoreload your browser, sorry, but I can't do everything for you.