Setting Variables in Dialogue Databases

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
JonGear
Posts: 6
Joined: Mon Jul 15, 2024 8:04 am

Setting Variables in Dialogue Databases

Post by JonGear »

Context:

I am using multiple databases, each one is used separately for one character.

In them, each have a variable called "OfferedHelp".

In the documentation, I noticed the SetVariable method, however, I did not see whether it is possible to set a specific database the variable:

Code: Select all

DialogueLua.SetVariable("OfferedHelp", true);
Question:

If I have multiple databases, how should I specify in which database to set the variable to?
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Setting Variables in Dialogue Databases

Post by Tony Li »

Hi,

Are you loading all databases at runtime, for example using an Extra Databases component or C# method DialogueManager.AddDatabase()? If so, these databases are merged in memory into a single master runtime database. This means OfferedHelp is merged into a single variable in the master runtime database. If you mean for them to be separate variables, you'll need to give them unique names. Please see Working With Multiple Databases for more info and tips, such as ensuring internal IDs are unique across the databases.
JonGear
Posts: 6
Joined: Mon Jul 15, 2024 8:04 am

Re: Setting Variables in Dialogue Databases

Post by JonGear »

Thanks!
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Setting Variables in Dialogue Databases

Post by Tony Li »

Happy to help!
Post Reply