Page 2 of 2

Re: Loaded Conversation Displays Wrong Entry if the Former Game State had a Conversation Running

Posted: Mon Dec 21, 2020 3:59 pm
by CodePrincess
Do you need AC and DS to all have the exact same variables for synching to work smoothly, or can one system have some that the other doesn't?

Re: Loaded Conversation Displays Wrong Entry if the Former Game State had a Conversation Running

Posted: Mon Dec 21, 2020 4:41 pm
by Tony Li
Hi,

Here's how it works:
  • If the Adventure Creator Bridge component's Sync Settings > Copy AC Variables to Dialogue System checkbox is ticked, then when a conversation starts the bridge will copy the values of all AC variables to corresponding DS variables, creating those DS variables if they don't already exist. If the DS variables do exist, the bridge will overwrite them with the current values of the AC variables.
  • If the Adventure Creator Bridge component's Sync Settings > Copy DS To AC Variables checkbox is ticked, then when a conversation ends the bridge will copy the retrieve the values of all AC variables from their corresponding DS variables. So if the conversation has changed a DS variable that corresponds to an AC variable, at the end of the conversation the AC variable will receive the current value of the DS variable.
So, if you're using these checkboxes, you can have extra DS variables that don't correspond to AC variables. But all AC variables will be synced back and forth with the Dialogue System.

The advantage of doing it this way is that you can work with AC/DS variables as normal in the Dialogue Editor -- for example, using the "..." dropdown menus in nodes' Conditions and Script fields.

Other integrations take a different approach and provide special Lua functions to get and set external variables. If I were to add this to the AC integration, you could untick all of those Sync Settings checkboxes and use Lua functions such as acGetBool(), acSetBool(), acGetInt(), acSetInt(), acGetItemCount(), etc. This way you wouldn't have to worry about sync issues when starting and ending conversations. But the drawback is that you'd have to use the functions instead of working with DS variables the typical way.

Would you be interested in using special Lua functions? It might get around the sync issues you're seeing with ConversationStateSaver.

Re: Loaded Conversation Displays Wrong Entry if the Former Game State had a Conversation Running

Posted: Mon Dec 21, 2020 7:27 pm
by CodePrincess
Would you be interested in using special Lua functions? It might get around the sync issues you're seeing with ConversationStateSaver.
That sounds like a cool idea! Could you use the Lua commands in the Dialogue System Conversation interface and Adventure Creator's Action List Editor's Third Party commands?

Re: Loaded Conversation Displays Wrong Entry if the Former Game State had a Conversation Running

Posted: Mon Dec 21, 2020 8:10 pm
by Tony Li
Hi,

There are already Adventure Creator actions to get and set Dialogue System variables.

This would provide the other half: Dialogue System Lua functions to get and set Adventure Creator variables.

I'll aim to get them added by end of day Thursday.

Re: Loaded Conversation Displays Wrong Entry if the Former Game State had a Conversation Running

Posted: Tue Dec 22, 2020 8:28 am
by Tony Li
Hi,

The Dialogue System Extras page has an updated AC integration inside the "Updated for 2.2.14" foldout. (direct download) (Future readers: This addition is in DS version 2.2.15+.)

It adds these Lua functions:

Code: Select all

Lua Function                        | Description
------------------------------------|------------
acGetBoolean("variableName")        | Returns a Boolean variable's value*.
acGetInteger("variableName")        | Returns an Integer variable's value*.
acGetFloat("variableName")          | Returns a Float variable's value*.
acGetText("variableName")           | Returns a Text variable's value*.
acSetBoolean("variableName", value) | Sets a Boolean variable's value*.
acSetInteger("variableName", value) | Sets a Integer variable's value*.
acSetFloat("variableName", value)   | Sets a Float variable's value*.
acSetText("variableName", "value")  | Sets a Text variable's value*.
acGetItemCount("itemName")          | Returns the amount of an item in the player's inventory.
acSetItemCount("itemName", value)   | Sets the amount of an item in the player's inventory.
acSetItemCount("itemName", value)   | Increments the amount of an item in the player's inventory.
Untick your Adventure Creator Bridge component's Sync Settings checkboxes, and use these Lua functions when to get and set variables and item counts in conversations.

If you use the "..." dropdowns in conversations' Conditions and Script fields, the functions are accessible in the Custom/AC submenu.

Re: Loaded Conversation Displays Wrong Entry if the Former Game State had a Conversation Running

Posted: Wed Dec 23, 2020 2:04 am
by CodePrincess
Goodness, you're fast!
Thank you for caring so much about my game. About all our games. ^_^
I'll update my save routines tomorrow. I'll tell you how things turn out then!

Re: Loaded Conversation Displays Wrong Entry if the Former Game State had a Conversation Running

Posted: Thu Dec 24, 2020 1:46 am
by CodePrincess
Everything works perfectly! Hallelujah!

I'm giving my sister a working game engine for Christmas!
Woooo!

Thank you so much, Tony!

Re: Loaded Conversation Displays Wrong Entry if the Former Game State had a Conversation Running

Posted: Thu Dec 24, 2020 8:50 am
by Tony Li
Whew! Glad to help! :-)