I am using Dialogue System with Ink.
Is there a way to read and write the global variables to and from Ink from a script?
Is there a way to through a generic event from the Ink Script like the predefined external functions? (show alert, etc.)
Thank you!!
Variables and Events for Ink integration
Re: Variables and Events for Ink integration
Hi!
The Ink integration lets you set Ink variables in Lua or C#. In C#, do it like this example:
I'm working on the next release. I can add corresponding functions to read Ink variables, and Ink external functions to read and write Dialogue System variables.
Are you talking about Dialogue System global variables, or Ink global variables?
The Ink integration lets you set Ink variables in Lua or C#. In C#, do it like this example:
Code: Select all
DialogueSystemInkIntegration.SetInkBool("variableName", true);
Re: Variables and Events for Ink integration
Thank you, that was helpful.
How about raising events from within Ink Script? Something like
I would like to fire some string events that I can catch from within C#. So you know how I could go about that?
How about raising events from within Ink Script? Something like
Code: Select all
EXTERNAL ShowAlert(x)
Re: Variables and Events for Ink integration
I'm so sorry; for some reason I didn't get a notification that you had replied! I was just returning to this thread to let you know that the Extras page now has an updated Ink Support package with the additions you requested. This package is also in version 2.0.8, which will be released tomorrow.
To raise an event from within an Ink Script, you need to bind a C# function to Ink. For example, this is how DialogueSystemInkIntegration.cs does it with ShowAlert:
(The variable 'story' is a reference to your Ink story.)
To raise an event from within an Ink Script, you need to bind a C# function to Ink. For example, this is how DialogueSystemInkIntegration.cs does it with ShowAlert:
Code: Select all
story.BindExternalFunction("ShowAlert", (string message) => { DialogueManager.ShowAlert(message); });
Re: Variables and Events for Ink integration
Fantastic, thank you!
Re: Variables and Events for Ink integration
Glad to help!
If I ever don't respond within 24 hours, feel free to ping me. I always try to reply within 24 hours.
If I ever don't respond within 24 hours, feel free to ping me. I always try to reply within 24 hours.