Page 5 of 5

Re: Need Assist on Saving Data to Save File

Posted: Tue Feb 04, 2020 5:49 pm
by Ralzar
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

Re: Need Assist on Saving Data to Save File

Posted: Wed Feb 05, 2020 11:31 am
by Hazelnut
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.

Re: Need Assist on Saving Data to Save File

Posted: Wed Feb 05, 2020 11:58 am
by Ralzar
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.

Re: Need Assist on Saving Data to Save File

Posted: Wed Feb 05, 2020 4:28 pm
by Ralzar
Oh for...

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

Re: Need Assist on Saving Data to Save File

Posted: Sun Mar 08, 2020 8:38 pm
by l3lessed
Was this solved?

Re: Need Assist on Saving Data to Save File

Posted: Sun Mar 08, 2020 9:27 pm
by Ralzar
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.