LogoPixi’VN

ink (Inkle) integration

Write visual novels using ink, Inkle's scripting language for branching stories (used in 80 Days and Heaven's Vault), integrated with the Pixi’VN visual novel engine.

Pixi’VN lets you write interactive narratives using ink, a scripting language designed for branching stories.

The ink + Pixi’VN integration uses inkjs and PixiVNJson to parse ink code and generate JSON that Pixi’VN can interpret. This means JavaScript/TypeScript and ink share the same storage and canvas, and you can launch ink knots (or labels) from JavaScript/TypeScript and vice versa. You get the best of both worlds: write narration in ink, and use JavaScript/TypeScript for minigames or advanced animations.

file_type_ink
ink/start.ink
=== start ===
We arrived into London at 9.45pm exactly.

* "There is not a moment to lose!"[] I declared.
 -> hurry_outside

* "Monsieur, let us savour this moment!"[] I declared.
 My master clouted me firmly around the head and dragged me out of the door.
 -> dragged_outside

* [We hurried home] -> hurry_outside

=== hurry_outside ===
We hurried home to Savile Row -> as_fast_as_we_could

=== dragged_outside ===
He insisted that we hurried home to Savile Row
-> as_fast_as_we_could

=== as_fast_as_we_could ===
<> as fast as we could.
-> start

Installation

Templates

Starting a new Pixi’VN project? Use a template that already includes ink.

To install the ink package in an existing JavaScript project, use one of the following commands:

npm install @drincs/pixi-vn @drincs/pixi-vn-ink

Initialize

After installing, use importInkText to load your ink script:

main.ts
import { importInkText } from '@drincs/pixi-vn-ink'

const inkText = `
=== start ===
Hello
-> END
`

importInkText([inkText, ...])

Now you can run an ink knot (or label) using Pixi’VN functions:

main.ts
import { narration } from "@drincs/pixi-vn";

narration.call(`start`, {});

Upcoming features

These features are in development.

If you are interested, feel free to write in the chat below!

  • CHOICE_COUNT()
  • TURNS()
  • TURNS_SINCE()
  • SEED_RANDOM()
  • LIST_RANDOM()
  • LIST_COUNT()
  • LIST_INVERT()
  • LIST_ALL()
  • LIST_RANGE()
  • LIST_MIN()
  • LIST_MAX()
  • LIST_VALUE()

Syntax ignored by Pixi’VN

Some ink syntax is ignored by Pixi’VN. You can use these in your ink script (e.g., for testing in Inky editor), but Pixi’VN will ignore them.

Other features

On this page