Tes5Mod:Mod File Format/REFR

The UESPWiki – Your source for The Elder Scrolls since 1995
Jump to: navigation, search

REFR records are over 90% of all records. They are simply references, but they are references to anything at any point in time (relatively speaking, whether triggered or otherwise), at any location in the game, doing something specified, or nothing. They can have extra items, or extra flags attached to them to identify them as containers, important places/locations.

Though there are a lot of fields for modifying various aspects of different things, the only fields required are a NAME (this is the main object we are referring to) and DATA (locational information).

Record header flags:

0x200 - Hidden From Local Map
0x400 - Persistent Reference (? not shown in the CK)
0x800 - Initially Disabled
0x10000 - Is Full LOD
0x2000000 - No AI Acquire
0x10000000 - Reflected By Auto Water
0x20000000 - Don't Havok Settle
0x40000000 - not Respawns
C V Field Name Type/Size Info
- EDID Editor ID zstring editor id
- VMAD script info VMAD scripting info
+ NAME basic object formid Formid of anything as the base object.
- XMBO model bounds? float[3] X, Y, Z bounds, usually same as XPRM bounds (CK 1.8+ throws error if not equal)
- XPRM primitive struct 32 byte struct
float[3] - x,y,z Bounds / 2
float[3] - r,g,b Color / 255
float - unknown: 0.15, 0.2, 0.25, 1.0 seen; same for any given base object
uint32 - unknown: 1-4 seen
- XPOD portal destination formid[2] origin/dest REFR
- XRMR reference marker struct
ubyte - count of following XLRM
ubyte[3] - seems to be flags 0x10000 - seen in 0x000C6B47, 48
- LNAM lighting template formid
- INAM image space formid INAM is used differently in a different context (see below)
- SCHR Old Script SCHR Old scripting field.
* XLRM location room marker formid REFR usually to a STAT
- XRGD rgb data? struct large (28-1204 bytes) struct, looks like a heap of floats seen on
CONT, BOOK (56 bytes seems constant for BOOK), ALCH (112)
- XRDS Radius float ~1.25 (radiance?)
- XEMI emitted light formid LIGH
- XLIG light data struct 16- or 20-byte struct
float - FOV Offset from Base Object (°)
float - Fade Offset from Base Object
float - End Distance Cap
float - Shadow Depth Bias
unknown - (4 bytes, not a float, seen in Dawnguard and Hearthfire)
- XESP enable parent struct 8-byte struct
formid - Parent reference (Object to take enable state from)
uint32 - Flags (records with no flags set have random values in high bits)
0x0001 = Set Enable State Opposite Parent
0x0002 = Pop In
- XALP Alpha Cutoff ubyte[2] 2-byte struct
ubyte - Current Alpha Cutoff
ubyte - Default Alpha Cutoff

Note: sometimes default displayed in CK instead of current; unclear when that occurs

- XNDP door pivot? struct 8-byte struct
formID - NAVM
uint32 - unknown (sint16/sint16 ?)
- XTEL door teleport struct 32-byte struct
formid - destination DOOR
float[3] - x/y/z position
float[3] - x/y/z rotation (radians)
uint32 - flag: 0x01 No alarm
- XSCL scale float setScale
- XAPD activation parent flags ubyte 0x01 - Parent Activate Only
- XAPR activation parent struct 8-byte struct
formid - REFR usually to a STAT
float - Delay
- XLIB leveled item base formid LVLI of objects using this as a base
- XLKR location route struct 8-byte struct
formid 0 or KYWD (usually LinkCarryStart/End)
formid REFR usually to a STAT (FURN also)
- XLOC lock information (door/cont) struct 20 bytes
byte Level
-1 - Requires Key
0 - Novice
1 - Novice also, same as 0 (source)
25 - Apprentice
50 - Adept
75 - Expert
100 - Master
ubyte[3] - flags?
formid KEYM (Key)
ubyte flags
0x04 - Leveled
ubyte[3] - flags?
ubyte[8] - 0s
* XLRT location ref type formid LCRT
- XOWN owner formid usually FACT but horse/dog has NPC_
- XCNT item count uint32 if more than 1 (eg arrows)
- XCVL float[3] X, Y, Z - Water Current Linear Velocity (only found in one instance)
- XCVR float[3] X, Y, Z - Water Current Rotational Velocity (no instance found)
- XEZN formid Encounter Zone
- XFVC Favor Cost float
- FNAM Marker Flags uint8
{0x01} - Visible
{0x02} - Can Travel To
{0x04} - "Show All" Hidden
- FULL ingame name lstring Name of the Marker
- TNAM Marker Type uint16 The Icon for the Map Marker - Enum
- XHTW Head-Tracking Weight Float
- XIS2 zero length, present if "Ignored By Sandbox" is checked
- XLCM type? uint32? only values seen are 0x00, 0x02, 0x03
- XMBR formID MultiBound Reference
* XPWR formID Reflected by
- XTRI uint32 Primitive: Collision Layer, selected by matching BNAM field of COLL form
- ONAM zero length, appears together with XACT if "Open by Default" is set
- XACT uint32 always value 0x0d, appears together with ONAM if "Open by Default" is set
- 43 XATR attach ref formID
- XWCN uint32 Size of XWCU/16
- XWCU struct[] Water Current, series of 16 byte structures seems to be 3 structures always
float X
float Y
float Z
float? unknown

First structure seems to be "Linear Velocity", second "Angular Velocity", with a structure of all zeroes following - but see CELL.XWCU

- 37 XPRD Patrol Data float Patrol Data Idle Time
- 37 XPPA Marker 0-length Marker, XPRD/XPPA/PDTO/INAM are a set
- 37 PDTO Patrol Data Topic struct Same as PDTO field in PACK record
- 37 INAM Idle Name? formid? Probably an IDLE link, as seen in PACK record
- XLRL formid LCTN, not found in .esms, added by CK 1.8 when edited
- DATA locational data struct 24 byte
float[3] - x/y/z position
float[3] - x/y/z rotation (radians)

Note: Floor(X or Y / 4096) gives the cell location