User Guide
Quick Reference
Modding
Development
User Guide
Quick Reference
Modding
Development
This page describes the common syntax elements of the ded (Doomsday Engine Definition) language.
Directives instruct the DED parser to perform special actions when encountered.
There are two kinds of comment in DED; single-line and multi-line.
Single line comments begin with # and continue until the end of line.
# A single line comment stops here
Multi line comments begin with #> and continue until <# is found.
#> A multi-line comment begins... And continues ...and ends here <#
Property = flaga | flagb | flagc; # Version 6 syntax Property = "flaga flagb flagc"; # Version 5 syntax (still supported).
The special case of 'no flags' is defined as follows:
Property = 0; # Supported from Doomsday 1.9.9 onwards
Property = ""; # Version 5 syntax
Property = ;
Strings begin and end with “ (double quotation mark). If newline (\n
) characters are found inside a string (the string has been divided into multiple lines) the newline and all following whitespace are skipped, and the actual string continues from the first non-whitespace character that follows.
Property = "Some text string";
To include a double quotation mark in the string itself, escape it with \ (backward slash).
Property = "Some \"quoted text\"";
To include a backward slash in the string itself, it must appear twice (to escape the escape sequence).
Property = "path\\to\\something";
For this reason it is generally better to use forward slashes in paths. Doomsday uses forward slashes on all platforms, internally.
Resource uris are used throughout Doomsday and use the following form:
Property = "<scheme>:<path>";
A scope describes the extent of zero or more definition statements which apply to a named definition type.
Syntax example:
<attribute> definitiontype <attribute> <identifier> { //... Definition statements ...// }
Attributes are optional keywords that either precede or follow a scope. These “derivation” attributes change the behavior of the parser when interpreting definition statements within the scope.
Keyword | Description |
---|---|
Copy | Use the previous definition of the same type as a base. |
Mods | Modify an existing definition. |
Clever use of attributes in conjunction with directives allows the add-on author to construct multi-part, combinatorial add-ons.
The following snippet (taken from libdoom.pk3:defs/doom1/materials.ded) serves as good example of what a .DED file typically looks like:
Header { Version = 6; } # Allow disabling from the command line. SkipIf -nodefaultfx; # Add an animated light glow effect to the NUKAGE1 material. Material Mods "flats:NUKAGE1" { Layer { Stage { Glow = .5; Tics = 24; Rnd = .5; } Stage { Glow = .44; Tics = 24; Rnd = .5; } } }