Save/Load Problem

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
ricjonsu098
Posts: 45
Joined: Sat Jul 30, 2016 8:37 am

Save/Load Problem

Post by ricjonsu098 »

Hi. I'm using the menu template, I'm having a problem when saving and loading.

So I have a gameobject that after the conversation, it will deactivate. No quest and variables are affected/touched

So this is the problem, I saved the game after conversing with that gameobject, so that gameobject will get deactivated. And then I tried to load the game, and when the game loads, the gameobject is active.

I tried using the persistent active data component, attached it to that gameobject, but still the gameobject remains active when the game is loaded.

I have an idea that when using persistent active data, you must have a quest that will indicate if the gameobject is active. Am I right?

My game is pretty much finished, I only have a problem with saving and loading
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Save/Load Problem

Post by Tony Li »

Hi,

When using Persistent Active Data, you need to provide a Condition that tells the Dialogue System whether the Target should be active or inactive. Usually you'll use a Dialogue System variable or quest state.

Here's an example. Let's say the player talks to a Genie, and then the Genie disappears.

1. Add a Dialogue System variable named something like "Genie_Is_Present". Set its Type to Boolean and its Initial Value to True.

2. In the Genie's conversation, set "Genie_Is_Present" to false. For example, the Script field could contain:

Code: Select all

Variable["Genie_Is_Present"] = false
3. Add a Persistent Active Data component to the Genie. Set the Condition > Lua Conditions to:

Code: Select all

Variable["Genie_Is_Present"] == true
One other thing to note: Persistent Active Data must be on a GameObject that starts active in the scene. If the GameObject starts inactive and is later activated by some player action, put Persistent Active Data on a different, active GameObject (e.g., an empty GameObject) and point its Target field to the inactive GameObject.
ricjonsu098
Posts: 45
Joined: Sat Jul 30, 2016 8:37 am

Re: Save/Load Problem

Post by ricjonsu098 »

Thanks gonna try this. Will give a feedback once I got results
Post Reply