Ink Dialogue System Integration
Posted: Mon Feb 26, 2024 10:34 am
Hi there,
I'm using the Dialogue System Integration with Ink and I've noticed that the code initializes Lua variables that match and observe the global variables in Ink. I notice that if I start with my variables initialized on the Ink side that they don't appear to be read correctly until their first value change from my Ink script.
Any idea what I'm missing?
I'm using the Dialogue System Integration with Ink and I've noticed that the code initializes Lua variables that match and observe the global variables in Ink. I notice that if I start with my variables initialized on the Ink side that they don't appear to be read correctly until their first value change from my Ink script.
Code: Select all
void OnEnable()
{
textField.text = DialogueLua.GetVariable(variableName).asString; // Receives the value "nil" until first change from Ink.
DialogueManager.AddLuaObserver($"Variable['{variableName}']", LuaWatchFrequency.EveryUpdate, OnChanged);
}
Code: Select all
public void InitializeVariables() // Executed after Start Conversation in the DialogueSystemInkTrigger script.
{
// Does not appear to trigger the observer, however this value is definitely available in the Ink script
DialogueSystemInkIntegration.SetInkString(variableName, "Worm");
}