How does the Active Saver works

Announcements, support questions, and discussion for Save System for Opsive Character Controllers.
Post Reply
GDev_23
Posts: 15
Joined: Fri May 28, 2021 1:12 pm

How does the Active Saver works

Post by GDev_23 »

Hello!

Again, I don't know if I am in the good section for save system, but I'll go with my question!

I am trying to test simple actions with the save/load system and I don't understand the logic behind the Active Saver.
I put the component on an object (let's call it Key) that is active from the start. When I go near the object and press my "action" button, the character takes it and the object becomes inactive and disappears.

I then save the game then load... and the Key is now active while it is supposed to be inactive after loading... How does the Active Saver work? I tried many things with the checkboxes and I really don't get it. How do I keep objects inactive while loading the game?

Thanks!
User avatar
Tony Li
Posts: 22203
Joined: Thu Jul 18, 2013 1:27 pm

Re: How does the Active Saver works

Post by Tony Li »

Hi,

Put the Active Saver on a different GameObject that's active. Then assign the Key to it.

You can put multiple Active Savers on this GameObject and/or use a Multi Active Saver to track the active state of multiple GameObjects.
GDev_23
Posts: 15
Joined: Fri May 28, 2021 1:12 pm

Re: How does the Active Saver works

Post by GDev_23 »

Hi Tony!

Sorry I didn't respond earlier about the topic. Thank you, your answer helped me a lot and I could figure out a solution!

But it led me to another problem while loading my game :cry:

In the DIalogue System, I have a character that gives the player a mission (with let's say Conversation 1). Once it is done, it will give a second mission to the player, leading to another conversation completely (let's call it Conversation 2). If I save my game while in Conversation 2 and load it, the game will load Conversation 1 instead of 2, which restart the first mission. I don't know how to force Dialogue System to go directly to a specific conversation when the game loads...

Is there a way to tell the object (the character) to go directly to Conversation 2 when loading?

Thanks again!
User avatar
Tony Li
Posts: 22203
Joined: Thu Jul 18, 2013 1:27 pm

Re: How does the Active Saver works

Post by Tony Li »

Hi,

Do either of these conversations start when the scene starts -- for example, if the Dialogue System Trigger is set to OnStart? If so, you'll need to wait a number of frames to allow the save system to apply its save data first. Inspect the Dialogue System Trigger GameObject, and add a TimedEvent component. If the SaveSystem's Frames To Wait Before Apply Data is 1, then set Mode to Frames and set Frames to 2. Configure OnTimeReached() to call the DialogueSystemTrigger's OnUse method.

You may also need to add a Conversation State Saver component to your Dialogue Manager or Save System GameObject. If a conversation is active when the player saves the game, it will remember this. When you load the game, it will resume the conversation at that point. Make sure you assign unique Key values to the saver components.
GDev_23
Posts: 15
Joined: Fri May 28, 2021 1:12 pm

Re: How does the Active Saver works

Post by GDev_23 »

Excellent, thank you!
I really appreciate the fact that you give many possible outcomes for the solutions and it helps understand the mechanics of Dialogue System.

Thanks again and good day!
User avatar
Tony Li
Posts: 22203
Joined: Thu Jul 18, 2013 1:27 pm

Re: How does the Active Saver works

Post by Tony Li »

Glad to help! Have a good day!
Post Reply