https://eternity.youfailit.net/index.php?title=EDF_delta_structures&feed=atom&action=historyEDF delta structures - Revision history2024-03-29T05:59:07ZRevision history for this page on the wikiMediaWiki 1.39.2https://eternity.youfailit.net/index.php?title=EDF_delta_structures&diff=2972&oldid=prevPrintz: preliminary copy from the old official docs2011-12-30T09:42:59Z<p>preliminary copy from the old official docs</p>
<p><b>New page</b></p><div>Delta structures are an easier and more flexible way to edit existing [[Thingtype|thing type]], [[Frame|frame]], [[Sound|sound]], terrain and (upcoming) inventory definitions. <br />
<br />
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.<br />
<br />
===Delta structure syntax===<br />
# A delta structure for a frame has this syntax:<br />
framedelta<br />
{<br />
name <frame mnemonic><br />
<list of frame fields><br />
}<br />
<br />
# A delta structure for a thing type has this syntax:<br />
thingdelta<br />
{<br />
name <thingtype mnemonic><br />
<list of thingtype fields><br />
}<br />
<br />
# A delta structure for a sound has this syntax:<br />
sounddelta<br />
{<br />
name <sound mnemonic><br />
<list of sound fields><br />
}<br />
<br />
# A delta structure for a terrain has this syntax:<br />
terraindelta<br />
{<br />
name <terrain mnemonic><br />
<list of terrain fields><br />
}<br />
<br />
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).<br />
<br />
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.<br />
<br />
Fields not supported in delta structures:<br />
*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. <br />
*The '''cmp''' field of the '''frame''' block is not supported in framedelta sections. <br />
*The '''inherits''' field of the '''thingtype''' block is not supported in '''thingdelta''' sections.<br />
<br />
===Frame delta example===<br />
# Change the Zombieman attack frame to use the shotgun zombie attack<br />
framedelta<br />
{<br />
name S_POSS_ATK2<br />
action [[SPosAttack]]<br />
}<br />
===Thing delta example===<br />
# Change the Zombieman's drop type to MegaSphere, and his spawnhealth to 400<br />
thingdelta<br />
{<br />
name Zombieman<br />
droptype MegaSphere<br />
spawnhealth 400<br />
}<br />
<br />
<br />
# Later on, maybe in a different file, we change the spawnhealth again<br />
thingdelta<br />
{<br />
name Zombieman<br />
spawnhealth 20<br />
}<br />
<br />
# At this point, the Zombieman drops MegaSpheres, but his spawnhealth is 20, not 400.<br />
===Sound delta example===<br />
# This changes the sound explod we defined earlier<br />
sounddelta<br />
{<br />
name = explod<br />
priority = 200<br />
singularity = sg_getpow<br />
}<br />
===Terrain delta example===<br />
# Terrain deltas used by Heretic in terrain.edf to enable splash alerts:<br />
terraindelta { name = Water; splashalert = true }<br />
terraindelta { name = Lava; splashalert = true }<br />
terraindelta { name = Sludge; splashalert = true }<br />
<br />
----<br />
Back to [[Editing reference]].</div>Printz