SaveScum / skyrim-plugin-decoding-project

Automatically exported from code.google.com/p/skyrim-plugin-decoding-project
0 stars 0 forks source link

Editing an ESM with ONAM subrecords can corrupt the ONAM subrecords with bad form IDs. #149

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Load two of the Unofficial Patch betas into TES5Edit.
2. Proceed to change anything you want, no matter how minor, in the SECOND 
patch file that's been loaded.
3. Save the files. Then reload the second patch file by itself.

What is the expected output?
ONAM subrecords should be intact.

What do you see instead?
ONAM subrecords that are referencing the plugin's master will instead be listed 
as belonging to the plugin and show up as unresolved references.

What version of the product are you using? On what operating system?
TES5Edit, release version 3.0.31.

Please provide any additional information below.
Screenshot showing the problem after it's happened is attached.

Loading only one ESM and performing edits on it comes out fine as far as I can 
tell, even if it uses Update.esm as a master.

Original issue reported on code.google.com by arthmoor on 7 Oct 2013 at 7:13

Attachments:

GoogleCodeExporter commented 9 years ago
I've made a copy of UHFP and loaded them both, edited the second one (copy), 
saved, reloaded - no problems.
If you edit them in "compare to" mode, not loaded as a separate plugins, then 
it can probably cause issues since refs are checked by FileID (high byte in 
FormID). But I don't recommend to edit loaded file in "compare to" mode. 
"ONAMs" is not the only issue when editing loaded compared file, there are 
other problems with that like removing records causing asserts.

Original comment by zila...@gmail.com on 7 Oct 2013 at 12:43

GoogleCodeExporter commented 9 years ago
It was being edited in normal mode. I'm aware of oddities when trying to edit 
in compare mode and never do so in one of the existing files.

I've been able to reproduce this every time I've tried it. I only reported it 
after I was sure it wasn't something I was doing wrong, it's already happened 
to me about 5 or 6 times now.

Every time it's always with the USKP loaded in the 3rd slot (02 index) and then 
with one of the DLC patches after that, so that the DLC is in 03 and the next 
patch is in 04. That's why I suspect it generated a bunch of 03 ONAMs, because 
somehow Edit is assigning the wrong index for the plugin.

Original comment by arthmoor on 7 Oct 2013 at 5:50

GoogleCodeExporter commented 9 years ago
Ok I see where is the problem, it uses load order index instead of fixed 
internal masters index for formids when building ONAMs. So if esm has several 
masters and something else is loaded between them, order of internal indexes 
won't match load order indexes.
I don't know why Elminster did it this way, just hope that my changes won't 
mess something else.
I'll upload a version to test on afkmods. Please try to test it on some other 
esms in different conditions, not only unofficial patches since it affects 
saving process of all master files for all games (except TES4 obviously).

Original comment by zila...@gmail.com on 7 Oct 2013 at 6:52

GoogleCodeExporter commented 9 years ago
I have not been able to break anything with the 1428 update no matter what 
position it's in. Probably safe to go ahead and close this one as done. Thanks 
:)

Original comment by arthmoor on 8 Oct 2013 at 3:27

GoogleCodeExporter commented 9 years ago

Original comment by zila...@gmail.com on 8 Oct 2013 at 5:47