Quick question: is there a way to retrieve a dialogue description in a script? I would like to use the description in a custom UI.
I know I can use DialogueLua.GetVariable to get a variable value, but I don't see a way to convert the Lua.Result to a DialogueSystem.Variable which would presumably give me access to the description via the fields attribute.
Getting variable description in script
Re: Getting variable description in script
Hi,
If you know the conversation's title or ID, you can do this:
If you know the conversation's title or ID, you can do this:
Code: Select all
string description = DialogueManager.masterDatabase.GetConversation(conversationTitle).Description;
-
- Posts: 47
- Joined: Wed May 05, 2021 1:57 pm
Re: Getting variable description in script
Sorry, I mistyped in my original post. I meant retrieve a variable description, not a dialogue description as I wrote originally.
Re: Getting variable description in script
Hi,
It's similar:
It's similar:
Code: Select all
string description = DialogueManager.masterDatabase.GetVariable(variableName).Description;
-
- Posts: 47
- Joined: Wed May 05, 2021 1:57 pm
Re: Getting variable description in script
Oh, I didn't know you could access variables via masterDatabase. I've always done it via DialogueLua. Is there a benefit to using DialogueLua for it?
Anyway, thanks for the help!
Anyway, thanks for the help!
Re: Getting variable description in script
Hi,
Use DialogueLua to get and set the runtime values of variables.
When you read from the masterDatabase, you're reading the static info that you entered at design time, not the runtime values. Since variables' Descriptions aren't put into the runtime environment, it's okay to read them from the masterDatabase.
Use DialogueLua to get and set the runtime values of variables.
When you read from the masterDatabase, you're reading the static info that you entered at design time, not the runtime values. Since variables' Descriptions aren't put into the runtime environment, it's okay to read them from the masterDatabase.
-
- Posts: 47
- Joined: Wed May 05, 2021 1:57 pm
Re: Getting variable description in script
Got it, thanks.
Re: Getting variable description in script
Glad to help!