Accessing Variables in Dialogue Tree Templates Procedurally
Posted: Sun Sep 01, 2024 7:28 pm
Given I have hundreds of characters and quests, was wondering if there's an easy way to procedurally get a particular quest associated with a character. For instance, in my Google Sheets database, I could easily have an entry that says which quest that character is tied to, or in the Actor database even. And possibly have the Google database contain various counts and items and variables.
I can import all that through JSON into Unity just fine, and hook up new fields (apart from Quest Status, which doesn't seem to be a FieldType unlike the others) but I don't know enough about LUA or the backend of the Dialogue System to parse the correct syntax for what I want. Ultimately, I'd like to make a template using generic commands and triggers since all the NPCs have more or less the same structure.
For instance, when the quest is accepted, show something like:
Instead, I only know how to apply these literally:
Similarly, for checks, I'd like to be able to set a generic quest's status to check and set conditions for:
And then in the Google Database, be able to write:
And just assign them procedurally through code when the Actor, Item, Quest, Variable, etc. is created in a C# script and save all the generics within a JSON Dialogue Template. How can I do that? Am I on the right track?
I can import all that through JSON into Unity just fine, and hook up new fields (apart from Quest Status, which doesn't seem to be a FieldType unlike the others) but I don't know enough about LUA or the backend of the Dialogue System to parse the correct syntax for what I want. Ultimately, I'd like to make a template using generic commands and triggers since all the NPCs have more or less the same structure.
For instance, when the quest is accepted, show something like:
Code: Select all
SetQuestState(Actor.Quest, "active");
ShowAlert("New Quest: [Actor.Quest.DisplayName]")
Code: Select all
SetQuestState("My Quest Name", "active");
ShowAlert("New Quest: Shorthand Name")
Code: Select all
Variable[Actor.Quest.Condition]
Code: Select all
Crates >= 3
Code: Select all
Variable["Crates.Count"] >= 3