Hi,
There's a part in my game where an NPC changes versions (after completing a quest and returning) so that some animation can be played out. The new version of the NPC is using Dialogue System Trigger with the relevant Quest Condition and an action that enables an important gameObject. This works perfectly provided the player doesn't change scenes and come back or save and reload. If the player does, the gameObject is no longer enabled.
The gameObject is tied to a quest (defeatOverlord). I've tried various ways to ensure that the gameObject state continues to be enabled when defeatOverlord is active but none seem to work. Do you have a suggestion?
Thanks very much for your help in advance.
[SOLVED]Save a Quest Enabled Object between Scenes and Load Game
-
- Posts: 118
- Joined: Thu Dec 19, 2019 7:38 am
[SOLVED]Save a Quest Enabled Object between Scenes and Load Game
Last edited by mschoenhals on Thu Dec 31, 2020 2:50 pm, edited 1 time in total.
Re: [HELP]Save a Quest Enabled Object between Scenes and Load Game
Hi,
Make sure your Dialogue Manager GameObject has a Dialogue System Saver component.
For discussion, let's say the two versions of the NPC are NPC1a and NPC1b. NPC1a starts active in the scene. When the player completes a quest NPC1a is deactivated and NPC1b is activated.
Add a Multi Active Saver component to an active GameObject in the scene. (It can be an empty GameObject.) Assign NPC1a and NPC1b to it, and set a unique Key. When the scene is saved -- either by a saved game or by leaving the scene -- the Multi Active Saver will record which version is active and which is inactive. When the scene is loaded -- either by loading a saved game or by re-entering the scene -- the Multi Active Saver will activate one and deactivate the other.
Make sure your Dialogue Manager GameObject has a Dialogue System Saver component.
For discussion, let's say the two versions of the NPC are NPC1a and NPC1b. NPC1a starts active in the scene. When the player completes a quest NPC1a is deactivated and NPC1b is activated.
Add a Multi Active Saver component to an active GameObject in the scene. (It can be an empty GameObject.) Assign NPC1a and NPC1b to it, and set a unique Key. When the scene is saved -- either by a saved game or by leaving the scene -- the Multi Active Saver will record which version is active and which is inactive. When the scene is loaded -- either by loading a saved game or by re-entering the scene -- the Multi Active Saver will activate one and deactivate the other.
-
- Posts: 118
- Joined: Thu Dec 19, 2019 7:38 am
Re: [HELP]Save a Quest Enabled Object between Scenes and Load Game
Ok, that did take care of the missing GameObject. However, now both NPC1a and NPC1b show up in the scene if the player leaves and then comes back.
Re: [HELP]Save a Quest Enabled Object between Scenes and Load Game
When the player leaves the scene, which version(s) are active?
-
- Posts: 118
- Joined: Thu Dec 19, 2019 7:38 am
Re: [HELP]Save a Quest Enabled Object between Scenes and Load Game
NPC1b is active. NPC1a is inactive.
Re: [HELP]Save a Quest Enabled Object between Scenes and Load Game
Hi,
Can you share a screenshot of your Multi Active Saver component?
Can you share a screenshot of your Multi Active Saver component?
-
- Posts: 118
- Joined: Thu Dec 19, 2019 7:38 am
Re: [HELP]Save a Quest Enabled Object between Scenes and Load Game
Hi Tony,
I got it working. I ended up just using the Multi Active Saver component on the one gameObject and not on either of the NPC's. Looks like its working now.
Thanks for all your help! Happy New Year!
I got it working. I ended up just using the Multi Active Saver component on the one gameObject and not on either of the NPC's. Looks like its working now.
Thanks for all your help! Happy New Year!
Re: [SOLVED]Save a Quest Enabled Object between Scenes and Load Game
Glad you got it working! Happy New Year!