Preserve quest status over scene change

Announcements, support questions, and discussion for Quest Machine.
Post Reply
Passero
Posts: 32
Joined: Thu Jan 18, 2018 1:19 pm

Preserve quest status over scene change

Post by Passero »

I was wondering how I can preserve the quest states from one scene to another?

I'm making a 2D space game where each solar system is a different scene and often you will get a quest in one scene but the goal is in another scene.

On the Quest Journal I did mark the checkbox "Save across scene changes" but when I change scene, the journal is empty.
Also when I get back to the original scene, I have to accept the quest again.

What config do I need to do to make sure the quests are preserved across scenes?
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Preserve quest status over scene change

Post by Tony Li »

Hi,

Add a SaveSystem component to your Quest Machine GameObject if it doesn't already have one.

Then change the scene using a ScenePortal component or PixelCrushers.SaveSystem.LoadScene() in C#.

This will make the "Saver" components in the original scene save their info to Quest Machine's save system before loading the new scene. After the new scene is loaded, the Saver components in the new scene will retrieve their saved info, if any, from Quest Machine's save system. The player's Quest Journal will act as a Saver component if "Save Across Scene Changes" is ticked.
Passero
Posts: 32
Joined: Thu Jan 18, 2018 1:19 pm

Re: Preserve quest status over scene change

Post by Passero »

Awesome, thx! Works like a charm.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Preserve quest status over scene change

Post by Tony Li »

Happy to help!
Post Reply