FormIds and GlobalFormIds
Reference: UESP Mod File Format, Form IDs.
FormId
A record’s FormId is only meaningful inside the plugin that stores it (BufferDecode.cs: FormId).
| Bits | Field | Meaning |
|---|---|---|
| 31 to 24 | MasterIndex | Index into this plugin’s MAST list, in declaration order |
| 23 to 0 | LocalId | Id within the plugin that defines the record |
A MasterIndex equal to the number of masters means the plugin defines the record itself. So
the same record, edited by three plugins, can appear with three different FormId values.
GlobalFormId
GlobalFormId.cs resolves a FormId to (OwningPlugin, LocalId), the same for every plugin of a
load order. Its text form is skyrim.esm:0B7736, which the CLI options also accept.
PluginMasters holds one plugin’s master list and resolves the FormIds it wrote:
var masters = new PluginMasters(pluginFileName, tes4);
if (masters.TryResolve(record.FormId, out var formId)) { ... }
GlobalFormId? menuArt = masters.Resolve(book.MenuArtFormId); // null when absent or unresolvable
A MasterIndex past the plugin itself doesn’t resolve. There is no safe fallback: callers drop
the record and report it (see Reported data problems).
Resolution needs the writing plugin’s master list, so it happens before records from different plugins are merged. Building a load order on top of this is the exporter’s job, see Load order and merging.