Best approach to dynamically load dialogue DBs at start

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
mandi
Posts: 77
Joined: Wed Sep 16, 2015 4:05 am

Best approach to dynamically load dialogue DBs at start

Post by mandi »

Hi Tony,
what is the best approach to dynamically load dialogues DBs at level start? I wrote myself a component that finds Dialogue Manager and sets the DB to the one I choose, but it fails to work.

Best
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Best approach to dynamically load dialogue DBs at start

Post by Tony Li »

Hi,

Add an Extra Databases component:

Image

Set the Add Trigger to OnStart, and assign your databases to the Databases section.
mandi
Posts: 77
Joined: Wed Sep 16, 2015 4:05 am

Re: Best approach to dynamically load dialogue DBs at start

Post by mandi »

Hi Tony,
splendid! I'm sure I've read about it, but there's so many features in DS, I must have forgotten about this one...

And it doesn't matter what is the Initial Database set in Dialogue Manager? Or should I set this to null?

Best,
Artur
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Best approach to dynamically load dialogue DBs at start

Post by Tony Li »

Hi Artur,

You can set it to null and ignore the warning that no initial database is assigned.

Instead, I prefer to assign a global database to the Initial Database. This database contains all the data that persists across scene changes, such as global variables, global quests, etc. -- basically anything that needs to be in a saved game file.

Then in each scene I use Extra Databases to load databases that are only needed in that scene. The Add Trigger is OnStart, and the Remove Trigger is OnDestroy.
mandi
Posts: 77
Joined: Wed Sep 16, 2015 4:05 am

Re: Best approach to dynamically load dialogue DBs at start

Post by mandi »

Hi Tony,
that makes perfect sense. Thank you for advice!
Artur
Post Reply