Hi again!
This time I'm trying to figure out how to create a UI system like the quest log window but one that stores variable information. For example, a window that would display information about people as you meet them. I have bool variables set up that are basically "person a met" that I set to true once the player has a conversation with them, and the description is information about that person. I was kind of trying to reverse-engineer the quest window UI in the basic pre-fab, but I can't seem to tell where the fields are gathering the quest information from the dialogue manager.
Are variables public? Is there a way to call them from other scripts? And if so, how?
Thank you!
Creating UI tracker for variables
Re: Creating UI tracker for variables
Hi,
Yes, variables are public. You can get their current values using DialogueLua.GetVariable(). To enumerate all of the variables in your database, examine DialogueManager.masterDatabase.variables. Example:
Yes, variables are public. You can get their current values using DialogueLua.GetVariable(). To enumerate all of the variables in your database, examine DialogueManager.masterDatabase.variables. Example:
Code: Select all
foreach (Variable variable in DialogueManager.masterDatabase.variables)
{
if (variable.Type == FieldType.Boolean)
{
Debug.Log($"Variable[{variable.Name}] = {DialogueLua.GetVariable(variable.Name).asBool}");
}
}
-
- Posts: 95
- Joined: Sun May 03, 2020 2:17 pm
Re: Creating UI tracker for variables
Ahh thank you so much! I knew they were stored somewhere I just wasn't sure where to look for them <3
Re: Creating UI tracker for variables
Glad to help!