Hi there,
I'd be interested in a PlayMaker action to iterate through all variables in a database and build a (PlayMaker) array with their names.
My ultimate objective would be to parse through the contents of the resulting array in search of specific text patterns, getting the DS variable names that meet that criteria.
So, I'm wondering if there's some code I could use to make a custom PlayMaker action for that purpose?
Thank you.
PlayMaker: iterate through DS variables?
PlayMaker: iterate through DS variables?
Unity 2019.4.9f1
Dialogue System 2.2.15
Dialogue System 2.2.15
Re: PlayMaker: iterate through DS variables?
Hi,
If you don't mind digging into C# a bit, this code will iterate through all variables defined in your dialogue database:
If you want to get their current values:
If you don't mind digging into C# a bit, this code will iterate through all variables defined in your dialogue database:
Code: Select all
using PixelCrushers.DialogueSystem; // Put at top of script.
...
foreach (var variable in DialogueManager.masterDatabase.variables) {
Debug.Log("Variable: " + variable.Name);
}
Code: Select all
foreach (var variable in DialogueManager.masterDatabase.variables) {
Debug.Log(variable.Name + " is " + DialogueLua.GetVariable(variable.Name).asString);
}
Re: PlayMaker: iterate through DS variables?
Thank you, I'll try with those and see if I can put an action together.
Unity 2019.4.9f1
Dialogue System 2.2.15
Dialogue System 2.2.15