frontispiece / packages / ink-scriptwriter / README.md
README.md
Raw

ink-scriptwriter

Command line tool that can run through an ink story, using ink-processor to handle commands and other logic, and then produce a full script of the result.

This is mostly useful for generating 'linear' versions of stories, if you want to publish a single playthrough on a medium that doesn't allow interaction.

Usage

You'll have to include ink-scriptwriter into your own Node.JS script to create a custom tool:

import fs from 'fs'
import { createScript } from '@a-morphous/frontispiece-ink-scriptwriter'
import { Compiler } from 'inkjs'

const storyText = fs.readFileSync('./story.ink', 'utf-8')
const story = new Compiler(storyText).Compile()

const main = async() => {
	const finalString = await createScript(story, {
		verbose: true
	})
	fs.writeFileSync('./log.txt', finalString)
}

main()

There are options available for creating your own parsers for handling lines and choices; none of that is currently documented, however.