EDF delta structures

From Eternity Wiki
Jump to navigationJump to search

Delta structures are an easier and more flexible way to edit existing thing type, frame, sound, terrain and (upcoming) inventory definitions.

Each delta structure for a thing type, frame, sound, or terrain specifies by mnemonic the section that it edits inside it. This allows for any number of delta structures to be defined. The structures are always applied in the order in which they are encountered during parsing, so that, like style sheets in HTML, delta structures cascade. This means you can load your own set of delta structures on top of an existing set in a modification.

Delta structure syntax[edit]

# A delta structure for a frame has this syntax:
framedelta
{
  name <frame mnemonic>
  <list of frame fields>
}

# A delta structure for a thing type has this syntax:
thingdelta
{
  name <thingtype mnemonic>
  <list of thingtype fields>
}

# A delta structure for a sound has this syntax:
sounddelta
{
  name <sound mnemonic>
  <list of sound fields>
}

# A delta structure for a terrain has this syntax:
terraindelta
{
  name <terrain mnemonic>
  <list of terrain fields>
}

The name field is required, and must be set to a valid terrain, sound, frame, or thingtype mnemonic in order to specify the definition that the delta structure edits. Along with the name, the delta structure can specify any field that is valid in that type of definition (see exceptions below).

Any field not specified in a delta structure will not be affected, and retains the value that it had before the delta structure was applied. A delta structure must specify values explicitly, even if the new values are the usual defaults for those fields. Note that the frame args list must be completely specified. It is not possible to override only some of the values in that list.

Fields not supported in delta structures:

  • The dehackednum field of any section edited by a delta structure cannot be changed. Although the field will be syntactically accepted by the parser, any value provided to it in a delta structure will have no effect. Only definition sections can provide a DeHackEd number.
  • The cmp field of the frame block is not supported in framedelta sections.
  • The inherits field of the thingtype block is not supported in thingdelta sections.

Frame delta example[edit]

# Change the Zombieman attack frame to use the shotgun zombie attack
framedelta
{
  name S_POSS_ATK2
  action SPosAttack
}

Thing delta example[edit]

# Change the Zombieman's drop type to MegaSphere, and his spawnhealth to 400
thingdelta
{
  name Zombieman
  droptype MegaSphere
  spawnhealth 400
}


# Later on, maybe in a different file, we change the spawnhealth again
thingdelta
{
  name Zombieman
  spawnhealth 20
}

# At this point, the Zombieman drops MegaSpheres, but his spawnhealth is 20, not 400.

Sound delta example[edit]

# This changes the sound explod we defined earlier
sounddelta
{
  name = explod
  priority = 200
  singularity = sg_getpow
}

Terrain delta example[edit]

# Terrain deltas used by Heretic in terrain.edf to enable splash alerts:
terraindelta { name = Water;  splashalert = true }
terraindelta { name = Lava;   splashalert = true }
terraindelta { name = Sludge; splashalert = true }

Back to Editing reference.