The Dialogue System can tie into Inkle's Ink Integration for Unity.
Ink copyright © Inkle Studios.
Ink is a narrative scripting language created by Inkle Studios. You can read about Ink here:
https://www.inklestudios.com/ink/
Unlike the other third party file formats that use the Dialogue System's in-editor converter tools to create dialogue databases, when working with Ink the Dialogue System uses Ink as the engine that parses Ink files and runs them. Your Ink files can use the Dialogue System's ShowAlert and quest control functions, and the Dialogue System can get and set Ink global variable values.
The example scene lets you play two conversations.
You may want to add the following to the database:
You can use all of the Dialogue System's regular triggers, scripting API calls, and visual scripting actions to start Ink stories as conversations.
Since the stories are added at runtime, you'll need to enter their names manually in Conversation Triggers' Conversation title field. Or, if you prefer, you can create a dummy database containing empty conversations with the same titles as your stories, assign this database to your Conversation Trigger, and select the conversation from the dropdown menu. (Don't add this dummy database to the Dialogue Manager.)
For any given line, to specify the actor (speaker) or conversant (listener), use Actor=actorName and/or Conversant=actorName tags. For example, to make the actor Boromir speak a line to the conversant Elrond:
- One does not simply walk into Mordor. # Actor=Boromir # Conversant=Elrond
To make Dialogue System functions available to your Ink story, the Dialogue System integration will automatically add these external function definitions to the top of your Ink file at runtime:
EXTERNAL ShowAlert(x) // ShowAlert("message") EXTERNAL CurrentQuestState(x) // CurrentQuestState("quest") EXTERNAL CurrentQuestEntryState(x,y) // CurrentQuestEntryState("quest", entry#) EXTERNAL SetQuestState(x,y) // SetQuestState("quest", "inactive|active|success|failure") EXTERNAL SetQuestEntryState(x,y,z) // SetQuestEntryState("quest", entry#, "inactive|active|success|failure")
You may also want to add these fallback functions at the bottom of your file so you can test your story outside of the Dialogue System:
== function ShowAlert(x) == ~ return 1
== function CurrentQuestState(x) == ~ return "inactive"
== function CurrentQuestEntryState(x,y) == ~ return "inactive"
== function SetQuestState(x,y) == ~ return 1
== function SetQuestEntryState(x,y,z) == ~ return 1
These functions are available in the Dialogue System's Lua environment:
Function | Description | Example |
---|---|---|
SetInkBool("variable", value) | Sets a Boolean value in your Ink stories. | SetInkBool("teacup", true) |
SetInkNumber("variable", value) | Sets a number value in your Ink stories. | SetInkNumber("wagerAmount", 16000) |
SetInkString("variable", "value") | Sets a string value in your Ink stories. | SetInkString("surname", "Shortshanks") |