Starting Scene with SaveSystem.LoadScene() disables default UIS Loadout.

Announcements, support questions, and discussion for Save System for Opsive Character Controllers.
Post Reply
vectorfrog
Posts: 86
Joined: Mon May 02, 2022 12:16 am

Starting Scene with SaveSystem.LoadScene() disables default UIS Loadout.

Post by vectorfrog »

Sorry for the long title, this is an interesting one so I'll try to explain the best I can.

I have a menu scene that I use to load the main game scene where the player character is already instantiated.

The player character is a UCC/UIS character with a Default Loadout of just the Body (Melee). This default Body doesn't take an equipment slot.

Here is where it gets interesting. If I have the Save System components in the main game scene, and use SceneManager.LoadScene() from my menu scene to load the game, everything works fine. Saving and loading works, etc. The player character Body is available and able to be used. It does not take a slot, so it's always available.

If I have the Save System components in the menu scene and use SaveSystem.LoadScene(), then the player character Body is not available, and cannot be used. I can see where it initially loads the scene, the Body equipment indicator is there, after the scene fully loads, it's gone. Almost like it's disabling it somehow.

Any ideas?

edit:

I have a saved game from when I had it configured with the Save System components in the game scene. If I load that game with it configured with the Save System components in the menu scene, the body works.

I know it's confusing, and I know I'm not explaining it well so please if you have any questions. Ask away. I will not be able to send a repro project for this one.
User avatar
Tony Li
Posts: 20705
Joined: Thu Jul 18, 2013 1:27 pm

Re: Starting Scene with SaveSystem.LoadScene() disables default UIS Loadout.

Post by Tony Li »

If it's there for a split second and then disappears, it's probably disappearing as a result of applying save data. Technically "split second" in this case is the number of frames specified by the SaveSystem component's Frames To Wait Before Apply Data.

You'll want to identify what's going on with the UCCSaver and UISSaver components in the scene. For example, maybe there's a UCCSaver in the main menu scene that's recording Body-less data. Or maybe the UCCSaver's "Save Inventory" checkbox is unticked (as it should be, with UIS) but the UISSaver isn't working properly.

If you get stuck, feel free to send a reproduction project to tony (at) pixelcrushers.com
vectorfrog
Posts: 86
Joined: Mon May 02, 2022 12:16 am

Re: Starting Scene with SaveSystem.LoadScene() disables default UIS Loadout.

Post by vectorfrog »

I think I figured it out but I'll have to do more testing. Based on your reply, I started looking at what components I had on what objects and in which scene. I'm sure this all due to my lack of understanding of the systems still. I had to move a couple components around and it appears to be working now. Basically I had the UIS saver in the wrong place and the Inventory System Manager Item Saver in the wrong place. I'll know more for sure after testing some more.

As always, thank you very much for your help!
User avatar
Tony Li
Posts: 20705
Joined: Thu Jul 18, 2013 1:27 pm

Re: Starting Scene with SaveSystem.LoadScene() disables default UIS Loadout.

Post by Tony Li »

Glad to help! Hopefully that does the trick. If not, you're still welcome to send a repro project.
Post Reply