Question about Extra Databases component

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
EpicMcDude
Posts: 14
Joined: Fri Sep 22, 2023 5:05 pm

Question about Extra Databases component

Post by EpicMcDude »

Hello,

I'm having an issue with getting the Dialogue System variables to load properly when loading a saved game from a different scene (Main Menu for example) and with the Extra Databases component.

When I choose the save file to load from the Main Menu (or any other different scene), and the scene is loaded using Load Game From Slot, every Saver component and everything else works fine except for the variables in the Dialogue system that don't get set.
But if I load the save file again AFTER I'm already in the scene, then the dialogue variables get set properly.

I'm using the Extra Databases component which loads the extra dialogue database OnStart and is synced with my Global Database which holds constant variables related to the Player.
Once I disabled the Extra Databases component the variables then also got set properly once I loaded the game.

However, if I disable the Extra Databases component and go to the scene without a save file, then the NPCs lose their connection to the Dialogue Database since it never got loaded.

What can I do here? I thought I could use Apply Saved Game Data but that action has a problem that creates a duplicate of any Spawned object every time it's called even when the spawned object is already in the scene

Thank you
User avatar
Tony Li
Posts: 21059
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about Extra Databases component

Post by Tony Li »

Hi,

Try setting your Save System component's Frames To Wait Before Apply Data to 1 or higher.
EpicMcDude
Posts: 14
Joined: Fri Sep 22, 2023 5:05 pm

Re: Question about Extra Databases component

Post by EpicMcDude »

Tony Li wrote: Sat Feb 03, 2024 10:04 pm Hi,

Try setting your Save System component's Frames To Wait Before Apply Data to 1 or higher.
I've put it up to 30 frames to see if it would do anything but it doesn't, the variables still don't get set. I can try loading the Database just before the first conversation, do you know if that would make a difference considering 30 frames didn't? Since also disabling the Extra Database component to load the database sets the variables correctly.
I'll try tomorrow!
EpicMcDude
Posts: 14
Joined: Fri Sep 22, 2023 5:05 pm

Re: Question about Extra Databases component

Post by EpicMcDude »

Okay, I found a fix.
Using the PM action "Add Dialogue Database" fixed the issue, variables are now set properly when loading the scene from another scene. I don't know what exactly the difference between this and adding the database with Extra Databases component is, but well, it's working now.
User avatar
Tony Li
Posts: 21059
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about Extra Databases component

Post by Tony Li »

Hi,

Extra Databases will load its databases in Start(). If the scene starts paused (e.g., Time.timeScale=0), Start() won't run. Maybe that was the issue. Anyway, I'm glad you found a solution!
EpicMcDude
Posts: 14
Joined: Fri Sep 22, 2023 5:05 pm

Re: Question about Extra Databases component

Post by EpicMcDude »

Tony Li wrote: Sun Feb 04, 2024 8:49 am Hi,

Extra Databases will load its databases in Start(). If the scene starts paused (e.g., Time.timeScale=0), Start() won't run. Maybe that was the issue. Anyway, I'm glad you found a solution!
Gotcha, thanks for clarifying!
Post Reply