Saving with Adventure Creator

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Kole90
Posts: 43
Joined: Wed Nov 08, 2017 4:51 am

Saving with Adventure Creator

Post by Kole90 »

Hi Tony

So I'm trying to save Dialogue System with Adventure Creator. I have done what manual says like checking "Include Sim Status" on both Adventure Creator Bridge and DS controller. Basically all the steps in the manual part Third party support\Adventure creator\Saving and Loading. So what's the next step for saving stuff from DS like answers already chosen, variables, etc..? I was thinking about making bool variables for every dialogue entry and then checking if that entry was already said, but it feels like there is a better option.

Also I found somewhere on the forum that you recommended this line of code to change AC variables through DS Script fields but it doesn't seem to work for me, keeps throwing an error:

Script:

Code: Select all

SetBool("VariableName", true)
I've tried a different one but it works only for DS variable:

Script:

Code: Select all

Variable["VariableName"] = true
User avatar
Tony Li
Posts: 22061
Joined: Thu Jul 18, 2013 1:27 pm

Re: Saving with Adventure Creator

Post by Tony Li »

Make sure your PersistentEngine prefab has a Dialogue System Saver component with these values:
  • Set: Manual
  • Retain in prefab? ticked
  • ID: Some unique value such as 99999
The Dialogue System Saver component hooks the Dialogue System into AC's save system. When AC saves a game, AC will tell Dialogue System Saver to save the DS state (DS variables, SimStatus, etc.) to an AC global variable.

Here are two ways to verify that it's working:

1. In AC, create a global string variable named "DialogueSystemEnvironment". After saving, use the AC Game Editor to check the value of this variable.

2. On the Dialogue Manager, change Debug Level to Info. When saving a game, you should see messages like:

"Saving Dialogue System state to Adventure Creator."

and when loading a game, you should see:

"Restoring Dialogue System state from Adventure Creator."
Kole90 wrote: Mon Dec 11, 2017 3:59 am Also I found somewhere on the forum that you recommended this line of code to change AC variables through DS Script fields [SetBool] but it doesn't seem to work for me, keeps throwing an error...
There was probably some other context in that forum post for SetBool(). It isn't a built-in function. This is how variable synchronization works:

On the Dialogue System's Adventure Creator Bridge component:
  • If "To Dialogue System (On Conversation Start) > Copy AC Variables to Dialogue System" is ticked, then when a conversation starts it will copy all AC variable values into the Dialogue System.
  • During the conversation, you can change DS variable values.
  • If "Back To AC (On Conversation End) > Copy Dialogue System to AC Variables" is ticked, then when a conversation ends it will set all AC variable values to the current values of the corresponding DS variables.
User avatar
Kole90
Posts: 43
Joined: Wed Nov 08, 2017 4:51 am

Re: Saving with Adventure Creator

Post by Kole90 »

Hi Tony thanks for a detailed response as always. So the saving works after I checked it out with your method, so what is the approach to filtering the answers already used? Making bool variables for answers and marking them true if the answer is used? Or is there an easier way of getting info about what answers have already been used?
User avatar
Tony Li
Posts: 22061
Joined: Thu Jul 18, 2013 1:27 pm

Re: Saving with Adventure Creator

Post by Tony Li »

If you want to show already-used answers in a different color:

1. Inspect the Dialogue Manager.
2. Tick Include Sim Status.
3. Set Input Settings > Em Tag For Old Responses.

If you want to exclude already-used answers from the response menu, set the response node's Conditions field. For example, say the node's ID is 42. Set Conditions to:

Code: Select all

Dialog[42].SimStatus ~= "WasDisplayed"
(You don't have to type this manually. You can use the wizard by click the "..." button.)

If you want to track answers in your own code / AC actionlists, you can check the value of Conversation[id].Dialog[id].SimStatus, or define a bool variable as you suggested. I prefer bool variables. Although it takes a little more work to set them in the Script field and check them in the Conditions field, I think they're easier to read.

If that doesn't answer your question, please let me know what you're looking to do.
User avatar
Kole90
Posts: 43
Joined: Wed Nov 08, 2017 4:51 am

Re: Saving with Adventure Creator

Post by Kole90 »

That was exactly what I needed to know. Thanks Tony, your answers are always spot on, purchasing Dialogue System was one of the best Asset Store purchases for sure.
User avatar
Tony Li
Posts: 22061
Joined: Thu Jul 18, 2013 1:27 pm

Re: Saving with Adventure Creator

Post by Tony Li »

Thanks! Glad to help!
Post Reply