Tes4Mod:Mod File Format/TES4

The UESPWiki – Your source for The Elder Scrolls since 1995

Jump to: navigation, search

TES4 is the header record for the mod file. It contains info like author, description, file type, and masters list.

  • Unlike TES3, author and description fields are no longer of fixed size. If you edit their content, you'll almost certainly have to rewrite the entire file.
  • In Progress -- some info may be inaccurate.
C SubRecord Name Type/Size Info
+ HEDR header struct
  • Whether the file is an esm or esp is determined by Flags1 of TES4 record header. If Flags1 & 1, then file is a master. Otherwise, file is a plugin, regardless of what the file extension says.
version float 0.8
numRecords long Number of records and groups (not including TES4 record itself).
nextObjectId ulong Next available object id. ?But large variation has been seen?
- OFST typeOffsets? struct[*]
  • May be vestigial.
  • Appears in Oblivion.esm. Does not appear in esps. Is not required for esms.
  • You would think that this would be something like offset info.

If you look a little closer, the last two bytes of the first long are a counter that starts at zero for type NONE increasing to x38 for QUST. And that's about the last thing that makes sense:

offset?
ubyte[3] Unknown.
  • Not consistent at first, but later in file seem to increment consistently.
  • But is often zero, and if it's supposed to be an offset, it's too small.
typeNum
byte Count/number of following record type. Starts at 0 and increments by one with each type.
type
char[4] Type name? Except there are several "types" (TLOD, SNDG) that don't exist in the Oblivion.esm.
unknown
ulong Always 0, except for type CELL which is very large.
- DELE deleted?  ??

Unknown. List of deleted formids?

  • Only seen in Oblivion.esm?
  • Note: In Morrowind, DELE records were used to mark data records that had been marked as deleted. This looks different.
- CNAM author zstring
  • Max size: 512 bytes (including terminator).
  • For files regarded as masters, the CS4 Details view will display "Bethesda Game Studios" regardless of the actual content of this field. The Oblivion plugin loader will display "Bethesda Softworks".
- SNAM description zstring
  • Max size: 512 bytes (including terminator).
* MAST master zstring Master filename.
  • Each pair of MAST/DATA subrecords represent a single master of the mod file.
  • Master files are listed in load order at the time the mod was saved.
  • The modindex of formids in the mod file match the order of masters given here.
DATA
fileSize uint64
  • Always 0. Probably Vestigial.
  • In Tes3, the file size of the master was recorded here.
Sponsored Links
Personal tools