I don't know if I'm missing something very simple, or if the system is designed to work this way, but I have set up a quest for the player to collect one object from another NPC by talking to them. It just uses one variable (WidgetFound) and sets it to 1 during the conversation.
The problem that I am having is that the NPC that gives the quest and the NPC that gives the item are in two different scenes. When you talk to NPC1, you get the quest, it gets set to active, and you can see that it starts to track it. When you walk to the scene portal, it loads the other scene so you can get to NPC2. As soon as the new scene loads, the quest is no longer tracked, and NPC2 talks as if the quest is not active.
If I manually set the quest to active, NPC2 will converse and give you the item, and the tracking shows as such. But then walking back to the scene with NPC1 causes the item count to go back to 0.
What am I missing? I have Don't Destroy on Load and Allow Only One Instance checked, and Include all Item and Quest Data checked. I have the Json Data Serializer, Dialogue System Saver, and Save System scripts on the Dialogue system object as well.
How can I get the quest tracking and variable values to persist between scene loads?
Quest status and variables reset to initial value on scene change
Re: Quest status and variables reset to initial value on scene change
Hi,
The Dialogue System's Demo (DemoScene1 & DemoScene2) work the same way you want your quest to work. Does the Demo work correctly in your project?
The Dialogue System's Demo (DemoScene1 & DemoScene2) work the same way you want your quest to work. Does the Demo work correctly in your project?
Re: Quest status and variables reset to initial value on scene change
Yes, the demo scenes appear to work as intended. If I kill 3 of the 5 enemies, and then change rooms, the tracking still shows 3/5. Although, when returning to the room with the enemies, they are all back alive and I can actually kill 8/5 by finishing them all off. But the tracking between scenes does work in the demo scenes.
I've tried copying the video tutorials and the demo scene set up as well as I can, but I can't figure out what I am missing or what I did wrong to make it not persist. Would it matter that I am using a disk save rather than playerprefs?
I've tried copying the video tutorials and the demo scene set up as well as I can, but I can't figure out what I am missing or what I did wrong to make it not persist. Would it matter that I am using a disk save rather than playerprefs?
Re: Quest status and variables reset to initial value on scene change
I didn't bother adding Destructible Savers to the enemies. That would keep enemies from coming back to life.runner049 wrote: ↑Thu Jun 06, 2019 1:39 pmYes, the demo scenes appear to work as intended. If I kill 3 of the 5 enemies, and then change rooms, the tracking still shows 3/5. Although, when returning to the room with the enemies, they are all back alive and I can actually kill 8/5 by finishing them all off. But the tracking between scenes does work in the demo scenes.
Scene changes don't use the saved game data storer component, so disk vs. PlayerPrefs doesn't matter.
If you have a Dialogue Manager in both scenes, are they both configured the same way? (In particular the Don't Destroy On Load and Allow Only One Instance checkboxes.)
Do you have any scripts that might reset or initialize counters when a scene starts?
Are there any errors or warnings the Console window?
Please feel free to send a reproduction project to tony (at) pixelcrushers.com. I'll be happy to take a look. You can just zip up the Assets and ProjectSettings folders. I won't need any other files or folders.
Re: Quest status and variables reset to initial value on scene change
I have tried it with a Dialogue Manager in both scenes, and with it in just the first scene. I have the same issue either way. When I use one in each scene, they are both from the same prefab, so they should be identical.
The only scripts that I have to modify the variable values are in the conversations.
I get no errors or warning messages in the console.
I'll try to get it zipped up and sent over. My internet connection is quite slow, so it will take a while to upload it.
Thank you so much for offering to help.
The only scripts that I have to modify the variable values are in the conversations.
I get no errors or warning messages in the console.
I'll try to get it zipped up and sent over. My internet connection is quite slow, so it will take a while to upload it.
Thank you so much for offering to help.
Re: Quest status and variables reset to initial value on scene change
Thanks for sending your project.
Inspect the Dialogue System Saver component, and tick Save Across Scene Changes.
In version 2.1.7+, this checkbox will be ticked by default.
Inspect the Dialogue System Saver component, and tick Save Across Scene Changes.
In version 2.1.7+, this checkbox will be ticked by default.
Re: Quest status and variables reset to initial value on scene change
Thanks so much! I knew it had to be something simple that I was overlooking!