This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| ded:syntax [2017-03-13 18:29] – [Attributes] skyjake | ded:syntax [2017-03-21 06:06] (current) – [Example] skyjake | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== DED syntax ====== | ||
| + | |||
| + | This page describes the common syntax elements of the [[ded]] (Doomsday Engine Definition) language. | ||
| + | |||
| + | ===== Directives ===== | ||
| + | |||
| + | Directives instruct the DED [[http:// | ||
| + | |||
| + | ^ Keyword^ Description | | ||
| + | | [[include|Include]]| Include the specified //.DED// file. | | ||
| + | | [[include|IncludeIf]]| Include the specified //.DED// file if the conditional statement is **true**. | | ||
| + | | [[skip|SkipIf]]| Skip the rest of the current file if the conditional statement is **true**. | | ||
| + | | [[model_path|ModelPath]]| Append a new path to the list of model search paths. | | ||
| + | |||
| + | |||
| + | |||
| + | ===== Comments ===== | ||
| + | |||
| + | 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. | ||
| + | |||
| + | < | ||
| + | </ | ||
| + | Multi line comments begin with **#>** and continue until **<#** is found. | ||
| + | | ||
| + | #> A multi-line comment begins... | ||
| + | And continues | ||
| + | ...and ends here <# | ||
| + | |||
| + | |||
| + | ===== Assignment statements ===== | ||
| + | |||
| + | |||
| + | ==== Flag values ==== | ||
| + | |||
| + | < | ||
| + | Property = "flaga flagb flagc"; | ||
| + | </ | ||
| + | The special case of 'no flags' is defined as follows: | ||
| + | | ||
| + | Property = 0; # Supported from Doomsday 1.9.9 onwards | ||
| + | Property = ""; | ||
| + | |||
| + | <note warning> | ||
| + | The following is a syntax error: | ||
| + | Property = ; | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== String values ==== | ||
| + | |||
| + | Strings begin and end with **"** (double quotation mark). If newline ('' | ||
| + | |||
| + | Property = "Some text string"; | ||
| + | |||
| + | To include a double quotation mark in the string itself, [[http:// | ||
| + | |||
| + | Property = "Some \" | ||
| + | |||
| + | To include a backward slash in the string itself, it must appear twice (to escape the escape sequence). | ||
| + | |||
| + | < | ||
| + | </ | ||
| + | |||
| + | For this reason it is generally better to use forward slashes in paths. Doomsday uses forward slashes on all platforms, internally. | ||
| + | |||
| + | |||
| + | ==== URI values ==== | ||
| + | |||
| + | Resource [[uri]]s are used throughout Doomsday and use the following form: | ||
| + | Property = "< | ||
| + | |||
| + | |||
| + | ===== Definition scopes ===== | ||
| + | |||
| + | A scope describes the extent of zero or more definition statements which apply to a named [[ded# | ||
| + | |||
| + | Syntax example: | ||
| + | < | ||
| + | //... Definition statements ...// | ||
| + | } | ||
| + | |||
| + | |||
| + | ==== Attributes ==== | ||
| + | |||
| + | Attributes are optional keywords that either precede or follow a scope. These " | ||
| + | |||
| + | ^ Keyword ^ Description | | ||
| + | | [[altering_and_copying_definitions|Copy]]| Use the previous definition of the same type as a base. | | ||
| + | | [[altering_and_copying_definitions|Mods]]| Modify an existing definition. | | ||
| + | |||
| + | Clever use of attributes in conjunction with [[# | ||
| + | |||
| + | |||
| + | ===== Example ===== | ||
| + | |||
| + | The following snippet (taken from // | ||
| + | | ||
| + | Header { Version = 6; } | ||
| + | | ||
| + | # Allow disabling from the command line. | ||
| + | SkipIf -nodefaultfx; | ||
| + | | ||
| + | # Add an animated light glow effect to the NUKAGE1 material. | ||
| + | Material Mods " | ||
| + | Layer { | ||
| + | Stage { Glow = .5; Tics = 24; Rnd = .5; } | ||
| + | Stage { Glow = .44; Tics = 24; Rnd = .5; } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | |||
| + | ===== See also ===== | ||
| + | |||
| + | * [[:ded|DED language overview]] | ||
| + | * [[Flags reference]] | ||