cell

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

CELL records contain information about cells (both interior and exterior).

Code generated by generator/gen.go; DO NOT EDIT.

Index

Constants

View Source
const AMBI esm.SubrecordTag = "AMBI"

AMBI is a 16 byte struct for Ambient light (ambient, sunlight, fog colors, and fog density).

View Source
const ANAM esm.SubrecordTag = "ANAM"

NPC ID, if applicable (NPC-only).

View Source
const BNAM esm.SubrecordTag = "BNAM"

Global variable name.

View Source
const CELL esm.RecordTag = "CELL"

Cell handles https://en.uesp.net/wiki/Morrowind_Mod:Mod_File_Format/CELL

View Source
const CNAM esm.SubrecordTag = "CNAM"

Name of the cell the reference was moved to (interior cells only) or Faction ID (not light, NPC, or static).

View Source
const CNDT esm.SubrecordTag = "CNDT"

Coordinates of the cell the reference was moved to (exterior cells only).

View Source
const DATA esm.SubrecordTag = "DATA"

DATA is a 12 byte struct containing flags and position.

View Source
const DATAFormReference esm.SubrecordTag = "DATA"

Reference position (Rotations are in radians).

View Source
const DNAM esm.SubrecordTag = "DNAM"

Cell name for previous DODT, if interior.

View Source
const DODT esm.SubrecordTag = "DODT"

Cell Travel Destination (Rotations are in radians).

View Source
const FLTV esm.SubrecordTag = "FLTV"

Lock difficulty (uint32).

View Source
const FRMR esm.SubrecordTag = "FRMR"

Reference ID for a Form Reference.

View Source
const INDX esm.SubrecordTag = "INDX"

Faction rank (uint32).

View Source
const INTV esm.SubrecordTag = "INTV"

Remaining usage. uint32 - health remaining (weapons and armor). uint32 - uses remaining (locks, probes, repair items). float32 - time remaining (lights).

View Source
const KNAM esm.SubrecordTag = "KNAM"

Key name.

View Source
const MVRF esm.SubrecordTag = "MVRF"

Reference ID (always the same as the attached FRMR value).

View Source
const NAM0 esm.SubrecordTag = "NAM0"

Count of Temporary Children.

View Source
const NAM5 esm.SubrecordTag = "NAM5"

Map color (exterior and like-exterior only).

View Source
const NAM9 esm.SubrecordTag = "NAM9"

Value (uint32).

View Source
const NAME esm.SubrecordTag = "NAME"

Cell Name. Unlike other NAME fields, this is the localized, human-readable name of the cell, not a language-agnostic ID string. Exterior regions are mostly empty strings; for these, the region name is used in the Construction Set.

View Source
const RGNN esm.SubrecordTag = "RGNN"

Region name (exterior and like-exterior only).

View Source
const TNAM esm.SubrecordTag = "TNAM"

Trap name.

View Source
const UNAM esm.SubrecordTag = "UNAM"

Reference blocked flag (always 0, present if Blocked is set in the header).

View Source
const WHGT esm.SubrecordTag = "WHGT"

Water height (interior only).

View Source
const XCHG esm.SubrecordTag = "XCHG"

Enchantment charge (charged items with non-zero charges), a float32.

View Source
const XSCL esm.SubrecordTag = "XSCL"

Reference's scale, if applicable and not 1.0.

View Source
const XSOL esm.SubrecordTag = "XSOL"

ID of soul in gem (soul gems only).

View Source
const ZNAM esm.SubrecordTag = "ZNAM"

Reference is disabled flag (always 0, present if the relevant flag is set in the header).

Variables

This section is empty.

Functions

This section is empty.

Types

type AMBIField

type AMBIField struct {
	AmbientColor [3]uint8
	Sunlight     [3]uint8
	FogColor     [3]uint8
	FogDensity   float32
}

func (*AMBIField) Marshal

func (s *AMBIField) Marshal() (*esm.Subrecord, error)

func (*AMBIField) Tag

func (s *AMBIField) Tag() esm.SubrecordTag

func (*AMBIField) Unmarshal

func (s *AMBIField) Unmarshal(sub *esm.Subrecord) error

type ANAMField

type ANAMField struct{ Value string }

NPC ID, if applicable (NPC-only).

func (*ANAMField) Marshal

func (s *ANAMField) Marshal() (*esm.Subrecord, error)

func (*ANAMField) Tag

func (t *ANAMField) Tag() esm.SubrecordTag

func (*ANAMField) Unmarshal

func (s *ANAMField) Unmarshal(sub *esm.Subrecord) error

type BNAMField

type BNAMField struct{ Value string }

Global variable name.

func (*BNAMField) Marshal

func (s *BNAMField) Marshal() (*esm.Subrecord, error)

func (*BNAMField) Tag

func (t *BNAMField) Tag() esm.SubrecordTag

func (*BNAMField) Unmarshal

func (s *BNAMField) Unmarshal(sub *esm.Subrecord) error

type CNAMField

type CNAMField struct{ Value string }

Name of the cell the reference was moved to (interior cells only) or Faction ID (not light, NPC, or static).

func (*CNAMField) Marshal

func (s *CNAMField) Marshal() (*esm.Subrecord, error)

func (*CNAMField) Tag

func (t *CNAMField) Tag() esm.SubrecordTag

func (*CNAMField) Unmarshal

func (s *CNAMField) Unmarshal(sub *esm.Subrecord) error

type CNDTField

type CNDTField struct{ X, Y int32 }

Coordinates of the cell the reference was moved to (exterior cells only).

func (*CNDTField) Marshal

func (s *CNDTField) Marshal() (*esm.Subrecord, error)

func (*CNDTField) Tag

func (t *CNDTField) Tag() esm.SubrecordTag

func (*CNDTField) Unmarshal

func (s *CNDTField) Unmarshal(sub *esm.Subrecord) error

type CellRecord

type CellRecord struct {
	NAME               *NAMEField
	DATA               *DATAField
	RGNN               *RGNNField
	NAM5               *NAM5Field
	WHGT               *WHGTField
	AMBI               *AMBIField
	MovedReferences    []*MoveReference
	PersistentChildren []*FormReference
	// Count of temporaray children
	NAM0              *NAM0Field
	TemporaryChildren []*FormReference
}

CellRecord represents a full CellRecord record composed of subrecords.

func ParseCELL

func ParseCELL(rec *esm.Record) (*CellRecord, error)

ParseCELL builds a CELL record from a list of subrecords.

func (*CellRecord) OrderedRecords

func (c *CellRecord) OrderedRecords() ([]*esm.Subrecord, error)

type DATAField

type DATAField struct {
	Flags uint32
	GridX int32
	GridY int32
}

func (*DATAField) Marshal

func (s *DATAField) Marshal() (*esm.Subrecord, error)

func (*DATAField) Tag

func (s *DATAField) Tag() esm.SubrecordTag

func (*DATAField) Unmarshal

func (s *DATAField) Unmarshal(sub *esm.Subrecord) error

type DATAFormReferenceField

type DATAFormReferenceField struct {
	PosX float32
	PosY float32
	PosZ float32
	RotX float32
	RotY float32
	RotZ float32
}

Reference position (Rotations are in radians).

func (*DATAFormReferenceField) Marshal

func (s *DATAFormReferenceField) Marshal() (*esm.Subrecord, error)

func (*DATAFormReferenceField) Tag

func (*DATAFormReferenceField) Unmarshal

func (s *DATAFormReferenceField) Unmarshal(sub *esm.Subrecord) error

type DNAMField

type DNAMField struct{ Value string }

Cell name for previous DODT, if interior.

func (*DNAMField) Marshal

func (s *DNAMField) Marshal() (*esm.Subrecord, error)

func (*DNAMField) Tag

func (t *DNAMField) Tag() esm.SubrecordTag

func (*DNAMField) Unmarshal

func (s *DNAMField) Unmarshal(sub *esm.Subrecord) error

type DODTField

type DODTField struct {
	PosX float32
	PosY float32
	PosZ float32
	RotX float32
	RotY float32
	RotZ float32
}

Cell Travel Destination (Rotations are in radians).

func (*DODTField) Marshal

func (s *DODTField) Marshal() (*esm.Subrecord, error)

func (*DODTField) Tag

func (t *DODTField) Tag() esm.SubrecordTag

func (*DODTField) Unmarshal

func (s *DODTField) Unmarshal(sub *esm.Subrecord) error

type FLTVField

type FLTVField struct{ Value uint32 }

Lock difficulty (uint32).

func (*FLTVField) Marshal

func (s *FLTVField) Marshal() (*esm.Subrecord, error)

func (*FLTVField) Tag

func (t *FLTVField) Tag() esm.SubrecordTag

func (*FLTVField) Unmarshal

func (s *FLTVField) Unmarshal(sub *esm.Subrecord) error

type FRMRField

type FRMRField struct{ Value uint32 }

Reference ID for a Form Reference.

func (*FRMRField) Marshal

func (s *FRMRField) Marshal() (*esm.Subrecord, error)

func (*FRMRField) Tag

func (t *FRMRField) Tag() esm.SubrecordTag

func (*FRMRField) Unmarshal

func (s *FRMRField) Unmarshal(sub *esm.Subrecord) error

type FormReference

type FormReference struct {
	// Reference ID.
	// Type: uint32
	// Required.
	FRMR *FRMRField
	// Object ID or "PlayerSaveGame".
	// zstring
	// Required.
	NAME *NAMEField
	// Reference blocked (value is always 0; present if Blocked is set in the reference's record header, otherwise absent).
	// uint8
	// Optional.
	UNAM *UNAMField
	// Reference's scale, if applicable and not 1.0.
	// float32
	// Optional.
	XSCL *XSCLField
	// NPC ID, if applicable (NPC-only).
	// zstring
	// Optional, exclusive with BNAM.
	ANAM *ANAMField
	// Global variable name
	// zstring
	// Optional, exclusive with ANAM.
	BNAM *BNAMField
	// Faction ID (not light, NPC, or static)
	// zstring
	// Optional, if present then INDX must also exist.
	CNAM *CNAMField
	// Faction rank.
	// uint32
	// Optional, if present then CNAM must also exist.
	INDX *INDXField
	// ID of soul in gem (soul gems only)
	// zstring
	// Optional.
	XSOL *XSOLField
	// Enchantment charge (charged items with non-zero charges).
	// float32
	// Optional.
	XCHG *XCHGField
	// Depends on the object type.
	//   uint32 - health remaining (weapons and armor)
	//   uint32 - uses remaining (locks, probes, repair items)
	//   float32 - time remaining (lights)
	// Optional.
	INTV *INTVField
	// Value (in gold)
	// uint32
	// Optional.
	NAM9 *NAM9Field
	// Cell Travel Destination (Rotations are in radians)
	//   float32 - Position X
	//   float32 - Position Y
	//   float32 - Position Z
	//   //   float32 - Rotation X
	//   float32 - Rotation Y
	//   float32 - Rotation Z
	// Optional.
	DODT *DODTField // Cell name for previous DODT, if interior.
	// zstring
	// Optional, must accompany DODT if present.
	DNAM *DNAMField
	// Lock difficulty
	// uint32
	// Optional.
	FLTV *FLTVField
	// Key name
	// zstring
	// Optional.
	KNAM *KNAMField
	// Trap name
	// zstring
	// Optional.
	TNAM *TNAMField
	// Reference is disabled (always 0). Like UNAM, this will be emitted if the relevant flag is set in the reference's record header. This may only be possible via scripting. Also, even if present in the file, the field appears to be ignored on loading.
	// uint8
	// Optional.
	ZNAM *ZNAMField
	// Reference position (Rotations are in radians)
	//   float32 - Position X
	//   float32 - Position Y
	//   float32 - Position Z
	//   float32 - Rotation X
	//   float32 - Rotation Y
	//   float32 - Rotation Z
	// Optional.
	DATA *DATAFormReferenceField
}

References to objects in cells are listed as part of the cell data, each beginning with FRMR and NAME fields, followed by a list of fields specific to the object type.

func ParseFormRef

func ParseFormRef(subs []*esm.Subrecord) (*FormReference, int, error)

returns formref + how many records it ate

func (*FormReference) OrderedRecords

func (f *FormReference) OrderedRecords() ([]*esm.Subrecord, error)

type INDXField

type INDXField struct{ Value uint32 }

Faction rank (uint32).

func (*INDXField) Marshal

func (s *INDXField) Marshal() (*esm.Subrecord, error)

func (*INDXField) Tag

func (t *INDXField) Tag() esm.SubrecordTag

func (*INDXField) Unmarshal

func (s *INDXField) Unmarshal(sub *esm.Subrecord) error

type INTVField

type INTVField struct{ Value uint32 }

Remaining usage. uint32 - health remaining (weapons and armor). uint32 - uses remaining (locks, probes, repair items). float32 - time remaining (lights).

func (*INTVField) Marshal

func (s *INTVField) Marshal() (*esm.Subrecord, error)

func (*INTVField) Tag

func (t *INTVField) Tag() esm.SubrecordTag

func (*INTVField) Unmarshal

func (s *INTVField) Unmarshal(sub *esm.Subrecord) error

type KNAMField

type KNAMField struct{ Value string }

Key name.

func (*KNAMField) Marshal

func (s *KNAMField) Marshal() (*esm.Subrecord, error)

func (*KNAMField) Tag

func (t *KNAMField) Tag() esm.SubrecordTag

func (*KNAMField) Unmarshal

func (s *KNAMField) Unmarshal(sub *esm.Subrecord) error

type MVRFField

type MVRFField struct{ Value uint32 }

Reference ID (always the same as the attached FRMR value).

func (*MVRFField) Marshal

func (s *MVRFField) Marshal() (*esm.Subrecord, error)

func (*MVRFField) Tag

func (t *MVRFField) Tag() esm.SubrecordTag

func (*MVRFField) Unmarshal

func (s *MVRFField) Unmarshal(sub *esm.Subrecord) error

type MoveReference

type MoveReference struct {
	// Reference ID (always the same as the attached FRMR value).
	// Required.
	MVRF *MVRFField
	// Name of the cell the reference was moved to (interior cells only)
	// zstring
	// Optional.
	CNAM *CNAMField
	// Coordinates of the cell the reference was moved to (exterior cells only)
	//   int32 - Grid X
	//   int32 - Grid Y
	// Optional.
	CNDT *CNDTField
	// Reference to the form that was moved.
	// Optional.
	Moved *FormReference
}

These only appear in mod files when creatures or NPCs are moved from one cell to another; they commonly appear in saved game files as things move around.

func ParseMoveRef

func ParseMoveRef(subs []*esm.Subrecord) (*MoveReference, int, error)

returns formref + how many records it ate

func (*MoveReference) OrderedRecords

func (m *MoveReference) OrderedRecords() ([]*esm.Subrecord, error)

type NAM0Field

type NAM0Field struct{ Value uint32 }

Count of Temporary Children.

func (*NAM0Field) Marshal

func (s *NAM0Field) Marshal() (*esm.Subrecord, error)

func (*NAM0Field) Tag

func (t *NAM0Field) Tag() esm.SubrecordTag

func (*NAM0Field) Unmarshal

func (s *NAM0Field) Unmarshal(sub *esm.Subrecord) error

type NAM5Field

type NAM5Field struct {
	R uint8
	G uint8
	B uint8
}

Map color (exterior and like-exterior only).

func (*NAM5Field) Marshal

func (s *NAM5Field) Marshal() (*esm.Subrecord, error)

func (*NAM5Field) Tag

func (t *NAM5Field) Tag() esm.SubrecordTag

func (*NAM5Field) Unmarshal

func (s *NAM5Field) Unmarshal(sub *esm.Subrecord) error

type NAM9Field

type NAM9Field struct{ Value uint32 }

Value (uint32).

func (*NAM9Field) Marshal

func (s *NAM9Field) Marshal() (*esm.Subrecord, error)

func (*NAM9Field) Tag

func (t *NAM9Field) Tag() esm.SubrecordTag

func (*NAM9Field) Unmarshal

func (s *NAM9Field) Unmarshal(sub *esm.Subrecord) error

type NAMEField

type NAMEField struct{ Value string }

Cell Name. Unlike other NAME fields, this is the localized, human-readable name of the cell, not a language-agnostic ID string. Exterior regions are mostly empty strings; for these, the region name is used in the Construction Set.

func (*NAMEField) Marshal

func (s *NAMEField) Marshal() (*esm.Subrecord, error)

func (*NAMEField) Tag

func (t *NAMEField) Tag() esm.SubrecordTag

func (*NAMEField) Unmarshal

func (s *NAMEField) Unmarshal(sub *esm.Subrecord) error

type RGNNField

type RGNNField struct{ Value string }

Region name (exterior and like-exterior only).

func (*RGNNField) Marshal

func (s *RGNNField) Marshal() (*esm.Subrecord, error)

func (*RGNNField) Tag

func (t *RGNNField) Tag() esm.SubrecordTag

func (*RGNNField) Unmarshal

func (s *RGNNField) Unmarshal(sub *esm.Subrecord) error

type TNAMField

type TNAMField struct{ Value string }

Trap name.

func (*TNAMField) Marshal

func (s *TNAMField) Marshal() (*esm.Subrecord, error)

func (*TNAMField) Tag

func (t *TNAMField) Tag() esm.SubrecordTag

func (*TNAMField) Unmarshal

func (s *TNAMField) Unmarshal(sub *esm.Subrecord) error

type UNAMField

type UNAMField struct{ Value uint8 }

Reference blocked flag (always 0, present if Blocked is set in the header).

func (*UNAMField) Marshal

func (s *UNAMField) Marshal() (*esm.Subrecord, error)

func (*UNAMField) Tag

func (t *UNAMField) Tag() esm.SubrecordTag

func (*UNAMField) Unmarshal

func (s *UNAMField) Unmarshal(sub *esm.Subrecord) error

type WHGTField

type WHGTField struct{ Value float32 }

Water height (interior only).

func (*WHGTField) Marshal

func (s *WHGTField) Marshal() (*esm.Subrecord, error)

func (*WHGTField) Tag

func (t *WHGTField) Tag() esm.SubrecordTag

func (*WHGTField) Unmarshal

func (s *WHGTField) Unmarshal(sub *esm.Subrecord) error

type XCHGField

type XCHGField struct{ Value float32 }

Enchantment charge (charged items with non-zero charges), a float32.

func (*XCHGField) Marshal

func (s *XCHGField) Marshal() (*esm.Subrecord, error)

func (*XCHGField) Tag

func (t *XCHGField) Tag() esm.SubrecordTag

func (*XCHGField) Unmarshal

func (s *XCHGField) Unmarshal(sub *esm.Subrecord) error

type XSCLField

type XSCLField struct{ Value float32 }

Reference's scale, if applicable and not 1.0.

func (*XSCLField) Marshal

func (s *XSCLField) Marshal() (*esm.Subrecord, error)

func (*XSCLField) Tag

func (t *XSCLField) Tag() esm.SubrecordTag

func (*XSCLField) Unmarshal

func (s *XSCLField) Unmarshal(sub *esm.Subrecord) error

type XSOLField

type XSOLField struct{ Value string }

ID of soul in gem (soul gems only).

func (*XSOLField) Marshal

func (s *XSOLField) Marshal() (*esm.Subrecord, error)

func (*XSOLField) Tag

func (t *XSOLField) Tag() esm.SubrecordTag

func (*XSOLField) Unmarshal

func (s *XSOLField) Unmarshal(sub *esm.Subrecord) error

type ZNAMField

type ZNAMField struct{ Value uint8 }

Reference is disabled flag (always 0, present if the relevant flag is set in the header).

func (*ZNAMField) Marshal

func (s *ZNAMField) Marshal() (*esm.Subrecord, error)

func (*ZNAMField) Tag

func (t *ZNAMField) Tag() esm.SubrecordTag

func (*ZNAMField) Unmarshal

func (s *ZNAMField) Unmarshal(sub *esm.Subrecord) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL