Page 1 of 1
Saving with Adventure Creator
Posted: Mon Dec 11, 2017 3:59 am
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:
I've tried a different one but it works only for DS variable:
Script:
Re: Saving with Adventure Creator
Posted: Mon Dec 11, 2017 10:04 am
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.
Re: Saving with Adventure Creator
Posted: Tue Dec 12, 2017 9:49 am
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?
Re: Saving with Adventure Creator
Posted: Tue Dec 12, 2017 10:55 am
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.
Re: Saving with Adventure Creator
Posted: Wed Dec 13, 2017 6:13 am
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.
Re: Saving with Adventure Creator
Posted: Wed Dec 13, 2017 8:21 am
by Tony Li
Thanks! Glad to help!