Transform/Position Issues When Loading Save With Custom GameObjects

Discuss modding questions and implementation details.
User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Re: Transform/Position Issues When Loading Save With Custom GameObjects

Post by Magicono43 »

Yeah I don't know why I thought this would not become an issue eventually. I guess mostly because initially I was destroying the loot-piles rather than deactivating them. But either way I think it is best that I just go with using "NextUID" when it comes to these chest objects, still need to screw around to get this working as I expect it, but hopefully this will lead to less confusion trying to deal with these "bugs" I've created, lol.

User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Re: Transform/Position Issues When Loading Save With Custom GameObjects

Post by Magicono43 »

Good news in terms of progress, I've found out why the custom loot-piles were not being reloaded properly when loading a save, thank goodness for the live-debugging feature in Visual Studio.

But basically the loot-pile that was created after opening a chest had just the right settings to be saved by the lootContainers serialization process, since they could be seen on the savedata file. BUT, they were being ignored/skipped by the actual loading process or the "RestoreLootContainerData," because the piles were not properly registered in the "SerializableLootContainers" dictionary AND they did not have the "customDrop" parameter as "true".

As can be seen in this method of the process:
Capture.PNG
Capture.PNG (31.05 KiB) Viewed 756 times
So with that in mind, I don't want these resultant containers to have attributes of "custom dropped" containers, similar to corpses and player-dropped loot. So I think what I'm going to do is just copy much of the process that Kab has done for the World of Daggerfall loot serialization, and properly register my loot-piles in the "SerializableLootContainers" dictionary, so they will hopefully keep their somewhat unique properties of being a non-corpse loot-pile that does not disappear when emptied, and not be ignored during the loading process. That's the hope atleast.

After I get this part working (hopefully), I'll still have to deal with the thing where loot-piles regenerate for some reason, but that should be easier to deal with now that my loot-piles and chests are not relying entirely on those other loot-piles LoadID and Positional data during the save/load process. So atleast getting somewhere now, after alot of head-scratching.

User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Re: Transform/Position Issues When Loading Save With Custom GameObjects

Post by Magicono43 »

So I think after a few days I finally found the closest to "perfect" solution that I've had so far atleast, when it comes to dungeons, I'll still need to likely change things around when non-dungeon interiors come into player, and even later if exteriors eventually do as well.

But here is a video of me attempting at explaining what I changed and why to get the result I currently have:


Post Reply