Saving between scenes.

Announcements, support questions, and discussion for Quest Machine.
om3n
Posts: 19
Joined: Mon Jan 31, 2022 8:29 am

Re: Saving between scenes.

Post by om3n »

Ah ok. That helps clarify some. I managed to get the quest state to save between scenes now, is there a saver I could add to the inventory objects for example and have their state persist through the changes as well? Inventory is my sticking point now. The current method of save seems easiest to manage, so I'd like to keep the systems together if at all possible.

Thanks again
User avatar
Tony Li
Posts: 21926
Joined: Thu Jul 18, 2013 1:27 pm

Re: Saving between scenes.

Post by Tony Li »

Hi,

How are you changing scenes?

If you're using TDE's methods, it should carry over the inventory.

If you're using a Scene Portal, add a DialogueSystemSaver to the Dialogue Manager GameObject (if not already present), and an InventoryEngineSaver to the inventory. If your project doesn't have an InventoryEngineSaver component, import Plugins / Pixel Crushers / Common / Third Party Support / Inventory Engine Support.
om3n
Posts: 19
Joined: Mon Jan 31, 2022 8:29 am

Re: Saving between scenes.

Post by om3n »

That script was exactly it. Thanks so much. One last inquiry if I could.

I've played with the name a few times. The scriptable object is the same as the ID listed in said scriptable object. However I still get this error:

InventoryEngine : Couldn't find any inventory item to load at Items/ named Assaultammo. Make sure all your items definitions names (the name of the InventoryItem scriptable objects) are exactly the same as their ItemID string in their inspector. Once that's done, also make sure you reset all saved inventories as the mismatched names and IDs may have corrupted them.
User avatar
Tony Li
Posts: 21926
Joined: Thu Jul 18, 2013 1:27 pm

Re: Saving between scenes.

Post by Tony Li »

Is Assaultammo inside a folder named "Items" that itself is inside a folder named "Resources"?

Does this happen on an old saved game, or when changing scenes?
om3n
Posts: 19
Joined: Mon Jan 31, 2022 8:29 am

Re: Saving between scenes.

Post by om3n »

after loading after the save. the location is assets/Survival/Items/Ammo/Definitions.

Is this determined by something? Should it be in a specific location/should I change something?
User avatar
Tony Li
Posts: 21926
Joined: Thu Jul 18, 2013 1:27 pm

Re: Saving between scenes.

Post by Tony Li »

It's an Inventory Engine thing. Can you move it to Assets/Resources/Items/Assaultammo?
om3n
Posts: 19
Joined: Mon Jan 31, 2022 8:29 am

Re: Saving between scenes.

Post by om3n »

Assets/Resources/Items did the trick. Thanks a lot I really appreciate the assistance!

If I entended my character definition like levels, stats etc, how might I include those in the save?
User avatar
Tony Li
Posts: 21926
Joined: Thu Jul 18, 2013 1:27 pm

Re: Saving between scenes.

Post by Tony Li »

Write a custom saver script. (How To: Write Custom Savers)

They pretty much only require light familiarity with scripting. They don't require any complex programming.
Post Reply