Oblivion Mod:Mod File Format/REFR

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

An REFR record represents a placed object in a cell. It has a lot of possible sub records depending on its type and state.

Also some of its properties (seen in the tescs) depends on the CELL the REFR is in (coordinates, 'persistent ref', 'visible when distant', etc ...)


The flags1 field (ubyte[4]) so far contains the following flags :

  • Disabled by default : 0x00080000


(most unknown sub-records taken from GhostWheel: Tes4.xml)

C SubRecord Name Type/Size Info
+ NAME FormID formid Base Object FormId
- EDID EditorID zstring Record Editor ID
- XMRK Map Marker 0 Is present when the reference is a map marker (uses the base static object MapMarker, 0x10).
- FNAM Map Flags ubyte[1] Holds map flags if the reference is a map marker.
  • 0x01 = Visible
  • 0x02 = Can Travel To
- XOWN unknown formid Owner (NPC or faction)
- XRNK unknown long Faction rank (if owner is faction)
- XGLB unknown formid Global variable (if owner is NPC)
- XSCL Scale data float Present only if scale <> 1.0
- XTEL unknown ubyte[28] Teleport information
  • Destination Door Reference ID (formid)
  • Destination Location (float X, Y, Z)
  • Destination Angle in Radians? (float AX, AY, AZ)
- XTRG unknown formid Target Reference (REFR, ACHR or ACRE)
- XSED unknown  ? unknown
- XLOD unknown ubyte[12] unknown
- XPCI unknown  ? unknown
- XLOC unknown ubyte[12] or
Lock information (only present if object is a DOOR or CONT, and if object is locked). Only partially understood:
  • First byte is base lock level for lock (0-100; 100 means key required)
  • Bytes 5-8 are the formid of the KEYM that opens this lock (00000000 if there is no key)
  • Last 4 bytes (i.e., bytes 9-12 if 12 bytes long, or bytes 13-16 if 16 bytes long) appear to be flags
    • 0x00000004 = Is lock leveled
- XESP unknown  ? unknown
- XLCM unknown ubyte[4] unknown
- XRTM unknown formid CELL reference ?
- XACT unknown ubyte[4] unknown
- XCNT Count long Only present if count is greater than 1
- FULL Full Name zstring Full name
- TNAM Marker Data ubyte[2] Present when the reference is a map marker.
  • 0x00 = None?
  • 0x01 = Camp
  • 0x02 = Cave
  • 0x03 = City
  • 0x04 = Elven Ruin
  • 0x05 = Fort Ruin
  • 0x06 = Mine
  • 0x07 = Landmark
  • 0x08 = Tavern
  • 0x09 = Settlement
  • 0x0A = Daedric Shrine
  • 0x0B = Oblivion Gate
  • 0x0C = Unknown? (door icon)
- ONAM Open by Default 0 Present only if the object is "open by default"
  • object must be a door
+ DATA Object data float[6] Object coordinates : X , Y, Z, rX, rY, rZ.
  • angles are in radian
  • angles actually represent negative rotations. For example, a roation of 90 degrees about the x-axis would mean that when looking toward the origin from a positive coordinate on the x-axis, the rotation would appear to be clockwise rather than counterclockwise. (Most coordinate systems define positive roations as counterclockwise.)
  • the rotation about the z axis is applied first, followed by the y rotation, and the x rotation is applied last