Page 1 of 1

Setting Variables in Dialogue Databases

Posted: Thu Jul 18, 2024 1:19 am
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?

Re: Setting Variables in Dialogue Databases

Posted: Thu Jul 18, 2024 8:14 am
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.

Re: Setting Variables in Dialogue Databases

Posted: Mon Jul 22, 2024 2:41 am
by JonGear
Thanks!

Re: Setting Variables in Dialogue Databases

Posted: Mon Jul 22, 2024 7:39 am
by Tony Li
Happy to help!