Page 1 of 1

Global variables?

Posted: Mon Aug 09, 2021 3:20 pm
by SealDev
I have a currency int variable.
Can I have it across multiple databases?

I have a SendMessage that can increase the currency amount. (DialogueLua.GetVariable) What if I want to run a conversation from an extra database tho?

Can I still add a condition if currency is above certain amount?

Will DialogueLua.GetVariable still work? What if each database has a variable with the same name? How does it know which one to pick?

Re: Global variables?

Posted: Mon Aug 09, 2021 3:48 pm
by Tony Li
Hi,

Variables should be unique across databases. If two databases define the same variable name, only one variable will be created at runtime.

Re: Global variables?

Posted: Mon Aug 09, 2021 8:31 pm
by SealDev
Should actors and conversation names also be unique across multiple databases?

Re: Global variables?

Posted: Mon Aug 09, 2021 8:41 pm
by Tony Li
Yes. For more information about multiple databases, including how to keep IDs unique, please see:

Working With Multiple Databases