Need Assist on Saving Data to Save File

Discuss modding questions and implementation details.
User avatar
Ralzar
Posts: 991
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Need Assist on Saving Data to Save File

Post by Ralzar » Tue Feb 04, 2020 5:49 pm

Ralzar wrote:
Sun Feb 02, 2020 4:46 pm
Figured it out :)
I take it back.

I have a problem that's probably above my meagre skill level.

If I save a game with the new mod. It works fine.
I load the savegame. It works fine.
I load other savegames. That works fine.

I load back and forth between different savegames a few times:
The game takes a long time to load and runs through about About 5000 cycles of my mod according to my debug logs.
The world finally fades in with a long spam of text produced by my mod. Usually about how my feet are freezing. Which I assume is because the mod was running while the inventory hadn't been loaded yet.

Any grownups want to take a look at my code and tell me where I went wrong?

The intention is to save the two counters: "wetCount" and "attCount", so you do not remove wetness effects and attribute debuffs by loading. Everything else in the mod is re-checked each OnNewMagicRound so does not need to be saved.

https://github.com/Ralzar81/Climate-and-Cloaks
My released mods

"I feel like Ralzar specifically wrote those mods for me and then said "Use them". Just so he could watch me die more."
-FuzzyBeanPlays

User avatar
Hazelnut
Posts: 2139
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Need Assist on Saving Data to Save File

Post by Hazelnut » Wed Feb 05, 2020 11:31 am

My guess would be that it's not connected to the save data code, have you tried the same experiment with a version before you added it?

Wondering if I would see a similar think with the magic round code in R&R, maybe that was what I added playerEntity.EntityBehaviour.enabled to the conditional for, but then removed as you found it didn't do anything and I also couldn't figure out or remember why I had added it.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Ralzar
Posts: 991
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Need Assist on Saving Data to Save File

Post by Ralzar » Wed Feb 05, 2020 11:58 am

The saving/loading works, so the code seems to be somewhat working at least. I'm planning to do some testing with older versions of the mod later today.

I still have playerEntity.EntityBehaviour.enabled in my conditional and I tried yesterday to add a BUNCH of different conditionals to stop this behaviour, but nothing worked.
Normally, loading takes about 3-5 seconds when running the game through the unity editor, but after skipping back and forth between saves a few times the load time suddenly shoots up to about 60 seconds. During that time, it seems OnNewMagicRound is just cycling like crazy.

I might try to make a tiny mod that just does debug log every magic round and nothing else, and then test if this behaviour continues.
My released mods

"I feel like Ralzar specifically wrote those mods for me and then said "Use them". Just so he could watch me die more."
-FuzzyBeanPlays

User avatar
Ralzar
Posts: 991
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Need Assist on Saving Data to Save File

Post by Ralzar » Wed Feb 05, 2020 4:28 pm

Oh for...

This has nothing to do with mod save data. I'm making a support thread.
My released mods

"I feel like Ralzar specifically wrote those mods for me and then said "Use them". Just so he could watch me die more."
-FuzzyBeanPlays

l3lessed
Posts: 258
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: Need Assist on Saving Data to Save File

Post by l3lessed » Sun Mar 08, 2020 8:38 pm

Was this solved?
My Skyrim Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

User avatar
Ralzar
Posts: 991
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Need Assist on Saving Data to Save File

Post by Ralzar » Sun Mar 08, 2020 9:27 pm

Yeah, I can't remember what it was now. But there was some code flaw in the DFU code that got fixed. It ran through a bunch of magic rounds if you loaded different saves. And since my mod uses those rounds you could wind up freezing or burning to death before you completed loading in. It was fixed in a build update.
The actual savegame stuff I got to work as intended.
My released mods

"I feel like Ralzar specifically wrote those mods for me and then said "Use them". Just so he could watch me die more."
-FuzzyBeanPlays

Post Reply