Adventure Creator and Dialogue System variable sync
Adventure Creator and Dialogue System variable sync
A few questions related to variable syncing.
* How do I access Adventure Creator variables from Dialogue System Database? (Something like Variable["name"] = 10 from the Entries in the Conversation tab)
* Do I need to define the global variables in the Dialogue Database to be able to use them?(I did it and the values are not syncing. I have a variable defined in both Global and Dialogue Database, but after the conversation ends, it doesn't sync. This is how the Adventure Creator Bridge is set up.
***
* Can I access variables defined in DialogueSystem from Adventure Creator?
* Can I change Adventure Creator Local variables from Dialogue System Database?
* How do I access Adventure Creator variables from Dialogue System Database? (Something like Variable["name"] = 10 from the Entries in the Conversation tab)
* Do I need to define the global variables in the Dialogue Database to be able to use them?(I did it and the values are not syncing. I have a variable defined in both Global and Dialogue Database, but after the conversation ends, it doesn't sync. This is how the Adventure Creator Bridge is set up.
***
* Can I access variables defined in DialogueSystem from Adventure Creator?
* Can I change Adventure Creator Local variables from Dialogue System Database?
Re: Adventure Creator and Dialogue System variable sync
Hi,
Yes. In Sync Settings, have you ticked Copy AC Variables To Dialogue System and Copy Dialogue System To AC Variables?
Re: Adventure Creator and Dialogue System variable sync
Yes I have
I have this [c]DialogueSystemEnvironment[/c] Global variable in AC which only contains all the variables defined as Global Variable in AC.
I have this [c]DialogueSystemEnvironment[/c] Global variable in AC which only contains all the variables defined as Global Variable in AC.
Re: Adventure Creator and Dialogue System variable sync
With those settings, it should be copying the AC values to DS when a conversation starts, and then copying the DS values back to AC when the conversation ends.
Please try this:
1. Add a Lua Console to the Dialogue Manager.
2. Play the scene and start a conversation. This will copy AC's variables to DS.
3. Press ~+L to open the Lua Console. Enter this:
It should list the values of variables copied from AC.
4. Choose a variable and change it by entering a command like this into the Lua Console:
5. Click the 'X' button to close the Lua Console.
6. End the conversation. This will refresh AC's variables from the values in DS.
7. In AC's editor, check the current value of the variable. Its value should be what you set it to in the Lua Console.
If it isn't, please let me know if there are any warnings or errors in the Unity editor console, and what versions of Unity, AC, and DS you're using.
Please try this:
1. Add a Lua Console to the Dialogue Manager.
2. Play the scene and start a conversation. This will copy AC's variables to DS.
3. Press ~+L to open the Lua Console. Enter this:
Code: Select all
return Variable
4. Choose a variable and change it by entering a command like this into the Lua Console:
Code: Select all
Variable["Found_sword"] = true
6. End the conversation. This will refresh AC's variables from the values in DS.
7. In AC's editor, check the current value of the variable. Its value should be what you set it to in the Lua Console.
If it isn't, please let me know if there are any warnings or errors in the Unity editor console, and what versions of Unity, AC, and DS you're using.
Re: Adventure Creator and Dialogue System variable sync
Okay it works. The values are just not updated in the Variable Tab of AC
Also, will variables defined in DS (that are not defined in AC) be available in AC? If yes, how can I access them?
Also, will variables defined in DS (that are not defined in AC) be available in AC? If yes, how can I access them?
Re: Adventure Creator and Dialogue System variable sync
Hi,
You need to enable live runtime view in AC's editor window.
To access DS variables that aren't in AC, use the Third Party: Dialogue System Lua action.
Re: Adventure Creator and Dialogue System variable sync
So the usual Variable["name"] will work there?
Re: Adventure Creator and Dialogue System variable sync
Yes. If your variable name has blank spaces, replace them with underscores ( _ ).
Re: Adventure Creator and Dialogue System variable sync
Thanks.
And correct me f I'm wrong, but there is no way to access local AC variables from DS right?
And correct me f I'm wrong, but there is no way to access local AC variables from DS right?
Re: Adventure Creator and Dialogue System variable sync
The bridge copies over local variables, too.
If a local variable and a global variable have the same name, such as MyAwesomeVar, you can tick the bridge's Prepend Global Variables checkbox to distinguish them in the Dialogue System. In DS, the global variable version will have "global_" in front, such as Variable["global_MyAwesomeVar"] for the global and Variable["MyAwesomeVar"] for the local.
If a local variable and a global variable have the same name, such as MyAwesomeVar, you can tick the bridge's Prepend Global Variables checkbox to distinguish them in the Dialogue System. In DS, the global variable version will have "global_" in front, such as Variable["global_MyAwesomeVar"] for the global and Variable["MyAwesomeVar"] for the local.