

DDF TEMPLATE RULES

==================



1. Some DDF files are number-only (lines.ddf, sectors.ddf and

   playlist.ddf).  Some DDF files (namely things.ddf) have both a name

   and a number (in the format "[XXXX:1234]".  The number is optional,

   defaulting to zero when it (and the colon) are absent.  All other

   DDF files have just a name in the square brackets.

   

2  For named DDF files, the name is allowed to be missing.  The engine

   will generate an internal name guaranteed to be unique.  The

   usefulness of this is questionable, it prevents the entry from

   being referenced anywhere else in DDF (e.g. as a template).

   

   None of our own DDF files should omit the name.



3. The old ways of setting the number in numbered DDF files (e.g.

   MAPNUMBER=123 in things.ddf, or TRIGGER=456 in lines.ddf) will be

   allowed for backwards compatibility, but removed from our own DDF

   files.



   (NOTE: this B.C. support may be removed soon)



4. For named DDF files, and as a matter of convention, all entries

   that serve only as templates should be placed at the top the DDF

   file, and have names that end with "_TEMPLATE" (for example:

   MONSTER_TEMPLATE).

   

5. The initial DDF files will not be treated any different to DDF

   files or lumps (such as the DDFXXX lumps found in WAD files) that

   are read later on.



6. When a new DDF entry has the same name as an older one (or the same

   number, for number-only files), then the older one is removed.  The

   new entry replaces it.  The new entry uses the same memory as the

   previous one, preventing any alias issues (no need to do a

   replacement scan on all potential references).



   For things.ddf, the new number in [] replaces the old number too.

   This can cause the old number to disappear.  The only implication

   of this is that a future number lookup of the thing may fail.



7. For things.ddf, when the number is missing, zero or negative, then

   it means that the entry is be considered as having no number at

   all.  Lookups on these numbers don't happen, so the thing will

   never be found via number lookups, only via name lookups.

 

8. For things.ddf, when a new DDF entry has the same number as an

   older one (but a different name), then the new entry is used for

   lookups on that number.  The older entry is not removed, and can

   still be referred to by name, but can no longer be referred to by

   that number.

 

9. If the first field of a DDF entry is "TEMPLATE=OLD;", then the old 

   entry with the same name (or number, for number-only files) is used

   to instantiate the new entry.  The old entry must exist, otherwise

   an error occurs.  For things.ddf, the new number in "[]" replaces

   the old entry's number.



10. If the first field of a DDF entry is "TEMPLATE=XXXX;" (where XXXX

    is an entry name, or number for number-only DDF files), then the

    new DDF entry is instantiated using the other DDF entry as a

    template.  This template entry must exist, otherwise an error

    occurs.



11. If the first field of a DDF entry is not a template, then the new

    DDF entry is instantiated (i.e. filled in) with default values

    using a built-in template.



