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.
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'
esx record set MyMod.esp edid:MyWeapon 'DNAM\Damage' 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.

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. 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.