Guides/01
Records and paths
Name a record. Select one element inside it.
Many commands take a RECORD argument and a PATH argument.
Name a record
| Form | Meaning |
|---|---|
0001F4A2 or 0x1F4A2 |
Load order FormID. The high byte is the plugin index. |
[WEAP:0001F4A2] |
Same as above, in the xEdit style. |
Fallout4.esm:01F4A2 |
Object ID in one plugin. It does not depend on load order. |
edid:MyWeapon |
Editor ID. |
self:000800 |
A record of the target plugin by its object ID. Use it for a record without an editor ID. |
MyWeapon |
Editor ID. Use it when the text is not a hex number. |
If more than one plugin has the record, esx uses the version in the target plugin.
Otherwise it uses the winning override. Run esx record overrides to list all versions.
Select an element
A path selects an element inside a record. It works like ElementByPath in xEdit.
Separate the parts with \ or /. Each part can be one of these:
| Part | Meaning |
|---|---|
DATA |
A subrecord signature. |
Damage |
An element name. |
'DNAM - Data' |
A display name. |
[2] |
The element at index 2 of an array. |
.. |
The parent element. |
Record Header\Record Flags |
A field of the record header. |
esx record get MyMod.esp edid:MyWeapon 'DNAM\Damage - Base'
esx record set MyMod.esp edid:MyWeapon 'DNAM\Damage - Base' 42
esx record show MyMod.esp edid:MyWeapon --path 'KWDA\[0]'
If a path does not exist, the error lists the names that exist at the failing level.
See each path of a record
record show --compact gives one line for each value of a record, with its path:
esx record show Fallout4.esm edid:ClothesMinutemanHat --compact --format text
values:
EDID: ClothesMinutemanHat
FULL: Militia Hat
Male\World Model\MOD2: Armor\MinutemanUnderArmor\hatGO.nif
BOD2\First Person Flags: 30 - Hair Top, 46 - Headband
Keywords\KWDA\[0]: DogmeatNoVisualsOnRetrieve [KYWD:0007820B]
Models\[0]\MODL: AAClothesMinutemanHat [ARMA:000E517C]
DATA\Value: 15
Each path is a path that record get, record set and batch take.
For this record the full form has 294 lines of text and the compact form has 36. For the weapon 10mm the numbers are 1884 and 428.
In JSON, values is a map from the path to the display value.
The compact form leaves out these parts, and omitted has the number of each:
- The texture hash lists of the models (
MODT,MO2Tand so on). - The unused fields and the padding fields.
- The counts that only repeat the length of a list, such as
KSIZbeforeKWDA. esx writes them from the list. - The fields of the record header, except
Record Flags. Therecordpart has the FormID, the signature and the editor ID.
Use --path with --compact to see one part, for example --path DNAM.
Entry selectors
record get, record set and batch also take entry selectors. Rhai’s ElementByPath does not.
| Part | Meaning |
|---|---|
[Property=Keywords] |
The one entry whose field Property has the value Keywords. |
[*] |
Every entry. |
[*Property=Keywords] |
Every entry whose field Property has the value Keywords. |
[.=edid:MyKeyword] |
The entry itself has the value. Use it for a list of keywords. |
A value matches the edit value or the display value. Letter case does not matter.
edid:Name matches a reference to the record with that editor ID.
A selector that matches no entry is an error.
[Field=Value] must match exactly one entry; to select several, use [*Field=Value].
record set changes every selected element.
A path with [*] always returns a list, even when it selects one element.
esx record get MyMod.esp edid:MyMod 'DATA\Properties\[*Property=Keywords]\Value 1'
esx record set MyMod.esp edid:MyMod 'MNAM\[*]' edid:MyFamily
References by editor ID
In record set and batch, the value edid:Name in a FormID field is the record with that editor ID.
esx looks in the target plugin first, then in the other plugins, last loaded first.
self:000800 is the record of the target plugin with that object ID, and Fallout4.esm:01F66B
is a record of a loaded plugin. A note in parentheses after an object ID is not read:
Fallout4.esm:01F66B (Ammo308Caliber). plugin export-records writes these forms.
In a text field, such as FULL, edid:Name is text.
Find records
esx search MyMod.esp --sig WEAP --where 'DNAM\Damage=^1[0-9]$'
esx record refs MyMod.esp edid:MyKeyword
esx defs show WEAP
defs show prints the definition of a record type. It lists the subrecords, fields, enums and flags.