Keep AdventureCreator's Global Variable changes happened during a Conversation

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
LostTrainDude
Posts: 74
Joined: Wed Mar 21, 2018 2:14 pm

Keep AdventureCreator's Global Variable changes happened during a Conversation

Post by LostTrainDude »

[Unity 2019.4.39f1 - AdventureCreator v1.75.3 - DS v2.2.27]

Hi Tony!

I have never had any particular issue so far with having all the AC Sync tickboxes ticked until now that I realized that, when in the middle of a Conversation, I enter the Options menu and change settings that alter Global Variables (e.g. subtitle size) linked to Options Data, once the Conversation is over, they revert back to their original values.

Right now I'm not really using any AC variable in my DS Conversations (so far I've been only using either plain Lua or ActionLists) so I think it is safe for me to untick syncing completely or just keep the DS -> AC ones, but I was wondering if this was expected behaviour even for Global Variables linked to Options Data, and how should I possibly tackle this whether at some point during production I may need to use actual AC variable references, therefore tick those boxes again.

Thanks a lot as always!
User avatar
Tony Li
Posts: 22148
Joined: Thu Jul 18, 2013 1:27 pm

Re: Keep AdventureCreator's Global Variable changes happened during a Conversation

Post by Tony Li »

Hi,

That's a good point. When the Sync checkbox is ticked, it does sync all AC variable values to DS when a conversation starts, and when a conversation ends it copies all of those values from DS back to AC.

If you don't want that to happen (e.g., if the Options menu can change AC variables in the middle of a conversation), untick the Sync option and use the AC Lua functions instead to access AC variables.

Alternatively, when the Options menu closes you could copy any AC variables that the Options menu changed back to DS so DS has up-to-date values.
LostTrainDude
Posts: 74
Joined: Wed Mar 21, 2018 2:14 pm

Re: Keep AdventureCreator's Global Variable changes happened during a Conversation

Post by LostTrainDude »

Thank you!

I did of course forget about the AC Lua functions :) I'll try to remember if I ever actually need to use them with DS.
User avatar
Tony Li
Posts: 22148
Joined: Thu Jul 18, 2013 1:27 pm

Re: Keep AdventureCreator's Global Variable changes happened during a Conversation

Post by Tony Li »

Glad to help!
Post Reply