Skip to content

The DEF Specification

Josh Nave edited this page Jan 1, 2021 · 4 revisions

(In progress)

.def (Definition List) files are used by the core server to map human-readable values to internal id's. Definition lists are not a required component for subsystems, but in most cases should be provided, as they are a useful utility for end users. DEF is an NSS (The NSS Format) implementation.

Header

DEF does not define any extension pairs to the NSS header.

The DEF type is def, and the only available version is 1.

An basic DEF header might look like this:

{
    type:"def"
    version:"1"
    encoding:"iso-8859-1"
}

Sections

The DEF specification defines a single available section:

  • .map <subsystem id>
    Indicates that the section defines translations between a human-readable name and an internal id for the specified subsystem. Translations are in the form of <name> <name>, where the first name is the internal id to be mapped, and the second is the name to be mapped to it.

    An example .map section might look like this:
.map "mc"
    37 stone
    38 cobblestone

    42 dirt

Example

An complete .def file might look something like this:

{
    type:"def"
    version:"1"
    encoding:"iso-8859-1"
}

.map "mc"
    37 stone
    38 cobblestone

    42 dirt

.map "civ"
    s:irn iron
    s:cppr copper
    r:fd food

Clone this wiki locally