Mutagen-Modding / Mutagen.Bethesda.Serialization

Library for generating serialization code between Bethesda plugin files to other formats
GNU General Public License v3.0
3 stars 2 forks source link

Starfield: New ESH / "Half" Plugins (header 0x400) overridden Forms not constructed correctly #8

Open JasonJShuler opened 1 month ago

JasonJShuler commented 1 month ago

The file SFBGS006.esm included with the latest Starfield patch is a new type of plugin that works similar to ESLs, but supports more objects. All plugins with the 0x400 are this new type, the xEdit team is calling "half" / ESH as opposed to Light / ESL.

These ESH plugins are loaded into the FDxxxxxx form prefix, and when overriding or referencing records in another ESH, rather than using the Master index as a prefix, 'FD' must be used.

I don't have much more detail than this - Using Spriggit I was able to create the .esm with the necessary modifications, but I then had to use a hex editor to change the leading '02's to 'FD's.

Here is the header from a the plugin I created that is able to override SFBGS006.esm:

SpriggitSource:
  PackageName: Spriggit.Yaml.Starfield
  Version: 0.20.0
ModKey: 1k_filter_empty_habs.esm
GameRelease: Starfield
ModHeader:
  Flags:
  - Master
  - 0x400
  Version: 2109579
  FormVersion: 559
  Stats:
    NumRecords: 46
    NextFormID: 4278194176
  Author: JMPZ11
  MasterReferences:
  - Master: Starfield.esm
  - Master: BlueprintShips-Starfield.esm
  - Master: SFBGS006.esm
  BNAM: 0x4465765F4D61696E00
  CHGL: 0x45F93C01

NextFormID is that same value on all three of the new plugins. Not sure why.

Example of (repaired) formlist override:

image

The highlighted bytes are the corrected values for formid when overriding an ESH record:

The record in yaml looks like : "000341:SFBGS006.esm"

When translated to .esm, it is stored as '02000341', when it should be 'FD000341' (little-endianness always confuses me lol)

Also, not super important, but BNAM in the header appears to be a string - it almost looks like a branch name...

image

Hope this makes sense - I'm not familiar with how ESL's work, but I gather it is similar, but with the FE prefix instead, right?

Thanks!

Noggog commented 1 month ago

Mutagen libraries have been updated, and it should be fixed once a new version is released. Reopen if it's not fixed after Spriggit v0.21 is out

Noggog commented 1 month ago

Quick question: are you constructing your mods with xedit?

Noggog commented 1 month ago

Have to reimplement this a bit. CK is out, so hopefully will be easier