[Solved] Invector Inventory Scene Changes

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
KingCeryn
Posts: 70
Joined: Sun Aug 23, 2020 5:12 pm

[Solved] Invector Inventory Scene Changes

Post by KingCeryn »

Sorry again for all the issues, but suddenly I can't get my equipped inventory to save between scenes. It was working this morning but suddenly its not, and I don't think I changed anything related to the Invector Inventory Saver.

It works fine with loading and saving, but moving between scenes its no longer equipping the same clothing I had in previous scenes. I'm using a Dialogue System trigger to move between, with the LoadLevel command.
Is there anything I should look for to double check this?

EDIT: I checked and it looks like the inventory itself isnt saving anymore. I picked up some items to double check if it was just the equipping, and it looks like the inventory itself isnt transferring anymore. I swear this was just working, and i cant figure out whats making it not work.
Loading saves from different scenes properly re-equips the inventory, its just moving back and forth between scenes that suddenly dont work.
Last edited by KingCeryn on Mon Jan 24, 2022 5:33 pm, edited 2 times in total.
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Invector Inventory Scene Changes

Post by Tony Li »

Hi,

Do the saver components on your player have unique Keys? (e.g., InvectorStatsSaver Key set to "playerStats", InvectorInventorySaver Key set to "playerInventory", PositionSaver Key set to "playerPosition", etc.)

The keys should be unique on the different savers, but each saver should use a consistent key for the player GameObjects in every scene. If scene 1's PositionSaver Key is set to "playerPosition", then scene 2's PositionSaver Key should also be "playerPosition".

Are there any errors or warnings in the Console window?

Is the Scripting Define Symbol "USE_INVECTOR_INVENTORY" still defined in Edit > Project Settings > Player > Other Settings?

Is the player GameObject configured to survive changes? If so, turn that off. Each scene should use its own instance of the player GameObject.
KingCeryn
Posts: 70
Joined: Sun Aug 23, 2020 5:12 pm

Re: Invector Inventory Scene Changes

Post by KingCeryn »

Yeah all that is set up properly. The saving function is still working properly, i.e. If I save Scene A with certain items equipped, and got to Scene B, then reload that save, it moves me back to Scene A with those items equipped,

But If I use a LoadLevel command to move from Scene A to Scene B, the inventory doesnt transfer- and if I move back to Scene A, the inventory is also not saved.

So the Inventory IS saving, but its not transferring when I use LoadLevel.
KingCeryn
Posts: 70
Joined: Sun Aug 23, 2020 5:12 pm

Re: Invector Inventory Scene Changes

Post by KingCeryn »

EDIT: Ah, it looks like this only happens with a DialogueSystemTrigger! Using the ScenePortal component, it works properly!
Is there something I may have left out on the DialogueSystemTrigger that could be causing this?

EDIT: AH, finally found it lol, im not sure why but i was "autosaving" to SaveSlot(0) whenever i left a scene, and for some reason THAT was preventing the load in the next scene. removing that/having it auto save after a few seconds when scenes are loaded fixed that. Thanks again as usual!
Post Reply