TIL Ink Fungus Combo

Sunder Iyer - Mar 24 '21 - - Dev Community

2021-03-23

Ink is a scripting language for interactive storytelling and Fungus is a story toolkit for Unity with a visual editor and other features. Personally, I like Ink and I've often found Visual Scripting interfaces for branching dialog to be counter-intuitive. What I do like however is the ability to visually preview interactive fiction scripts. That's why I prototyped this. But I digress.

The thing about Ink is its Unity integration is rather barebones. However, Fungus has a lot of dialog UI and other hooks, ready to be used. So what if Ink could be read by Fungus...it should be possible to parse/convert Ink into Fungus-Lua. I once converted a Ren'Py story into Fungus-Lua so converting Ink to Fungus-Lua should be doable. Fortunately this is not necessary because the Ink-Fungus Gateway exists! With it, a Gateway system is used to make both systems work with each other.

Here's a basic setup process.

  1. Create your Ink file. You should have both Fungus and Ink Unity Integration installed in your Unity project, so you can right-click any Project folder and Create an Ink asset. Create an Ink file
  2. Make a new scene and use the Fungus Tools menu to create:
    • Ink-Fungus Gateway
    • Fungus Say Dialog
    • Fungus Menu Dialog
  3. Add the JSON version of the Ink file to the Basic Settings > Ink property of the Narrative Director of the Gateway object. Assigning the text asset
  4. Assign the Fungus dialogs to the Narrative Director.
  5. You need to start the Narrative Director with Fungus so add a new Fungus Flowchart, open it and set up a Start block that can Resume Narrative. Setting the Block

After performing the steps, your Ink file should be immediately playable thru a Fungus interface.
Result Ink Fungus Combo
I'm curious to explore this workflow further. It should be possible to use Ink to drive more complex Unity interactions with Fungus!

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .