esm

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: 9 Imported by: 0

Documentation

Overview

Package esm deals with parsing ESM/omwaddon files.

Index

Constants

This section is empty.

Variables

View Source
var ErrArgumentNil error
View Source
var ErrTagMismatch error

Functions

func WriteRecords

func WriteRecords(w io.Writer, recs iter.Seq[*Record]) error

Types

type ParsedSubrecord

type ParsedSubrecord interface {
	// Unmarshal sub into this instance.
	Unmarshal(sub *Subrecord) error
	// Marshal the parsed subrecord into a raw binary representation.
	// If this instance is nil, this should return (nil, nil).
	Marshal() (*Subrecord, error)
	Tag() SubrecordTag
}

ParsedSubrecord is an unmarshalled Subrecord.

type Record

type Record struct {
	// tag, size, padding, flags
	Tag        RecordTag
	Flags      uint32
	Subrecords []*Subrecord
	// PluginName is just metadata; it is not written to the file.
	PluginName string
	// PluginOffset is just metadata; it is not written to the file.
	PluginOffset int64
}

Record is an unmarshalled component of an ESM file.

func ParsePluginData

func ParsePluginData(pluginName string, f io.Reader) ([]*Record, error)

ParsePluginData extracts records from an io.Reader.

func ParsePluginFile

func ParsePluginFile(path string) ([]*Record, error)

ParsePluginFile extracts records from some esm or omwaddon file. See https://en.uesp.net/wiki/Morrowind_Mod:Mod_File_Format

func (*Record) Write

func (r *Record) Write(w io.Writer) error

Write the record to the writer w.

type Subrecord

type Subrecord struct {
	Tag  SubrecordTag
	Data []byte
}

Subrecord is a marshalled component of a Record.

func (*Subrecord) UnmarshalTo

func (s *Subrecord) UnmarshalTo(p ParsedSubrecord) error

UnmarshalTo the parsed subrecord p.

func (*Subrecord) Write

func (s *Subrecord) Write(w io.Writer) error

Write the data in the subrecord to the writer w.

type SubrecordTag

type SubrecordTag string

Directories

Path Synopsis
Package record contains parsed record and subrecord structs.
Package record contains parsed record and subrecord structs.
cell
CELL records contain information about cells (both interior and exterior).
CELL records contain information about cells (both interior and exterior).
land
LAND records contain information about the landscape of exterior cells.
LAND records contain information about the landscape of exterior cells.
ltex
LTEX records contain information about landscape textures.
LTEX records contain information about landscape textures.
lua
Package lua handles LUAL and LUAM records, which are specific to openmw.
Package lua handles LUAL and LUAM records, which are specific to openmw.
tes3
Package tes3 handles https://en.uesp.net/wiki/Morrowind_Mod:Mod_File_Format/TES3
Package tes3 handles https://en.uesp.net/wiki/Morrowind_Mod:Mod_File_Format/TES3

Jump to

Keyboard shortcuts

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