I'm going a little bit deeper with my Ink/Dialogue System use in Ink and I noticed that the current behaviour attempts to set the List value using only a string object (which fails). I've investigated a little bit, and so far this is my current fix, which at least appears to set the InkList correctly.
DialogueSystemIntegration.cs
Code: Select all
public static void SetInkList(string variableName, string value)
{
// This is good but doesn't account for adding/removing/replacing lists.
Story story = instance.stories[0];
string[] arr = value.Split(',');
InkList newList = story.variablesState[variableName] as Ink.Runtime.InkList ?? new InkList();
foreach (string a in arr)
{
string itemName = a.Trim();
if (itemName.Trim().Contains('.'))
newList.AddItem(new InkListItem(itemName));
else
newList.AddItem(new InkListItem(variableName, itemName));
}
if (m_instance != null) m_instance.SetInkVariableValue(variableName, newList);
}
Firstly, am I correct that setting lists was implemented, but probably not working correctly? (So far, I think I am correct, but I could be missing something).
Is the intention/assumption of the DialogueSystemIntegration that all interactions in Ink should go through the DialogueSystemIntegration layer so that the Lua script is correctly notified or is this not necessary?
In DialogueSystemIntegration.cs, I've noticed that most Set/Get functions have the following loop:
Code: Select all
foreach (var story in stories)
My thought process is that SetInkList functionality should probably be replaced by Add, Subtract and Intersect behaviour as documented in the Ink.Runtime.InkList class, unless the intention is to interface directly with InkLists as needed. If so I'll probably write that for my own use and drop that here, but your insights are really appreciated so that I know that I'm going in the right direction.