A better way to save prefabs

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Lucian1899
Posts: 20
Joined: Wed Dec 13, 2023 9:23 am

A better way to save prefabs

Post by Lucian1899 »

Hi,
I put Quest Log Window prefab into every scene of my game, and they worked well, when new quests/descriptions appear, all the Quest Log Windows will update.

Now I made a map for my game, and I also put the map prefab into every scene, there are two locations at first, new locations will unlock in the map after specfic conversations.

My solution to save the map information is using Dialogue System Trigger's OnSavedDataApplied in every scene, but I think in this way, the map objects in the scenes are all "independent"? And this solution is kind of cumbersome. So is there any easier way to save my own prefab, make it act like Quest Log Window?I've tried Scene-independent Events in dialogue database but failed and I don't know if it is the right way. Thank you for help!
User avatar
Tony Li
Posts: 22886
Joined: Thu Jul 18, 2013 1:27 pm

Re: A better way to save prefabs

Post by Tony Li »

Hi,

It's fine to put an instance of your map prefab in every scene. But it will make it easier to add a custom saver component to it that updates the map when you load a saved game or change scenes. See: How To: Write Custom Savers
Post Reply