Declarations

From modwiki

Jump to: navigation, search

Declaration (most often called decls) files can consist of definitions of one or more assets like a texture, sound, model, etc.. The files themselves are in ASCII (plain text) format.

A single declaration consists of a header and body. The header is composed of a name and sometimes a descriptor that defines the type of declaration (descriptors are not needed if the declaration is put in its respective file format; for example you wouldn't need to put "material" before your material decls in an .MTR file). The body of a definition is enclosed in curly brackets.

A few examples of headers would be...

textures/common/npc_pda
articulatedFigure char_campbell_bfg
entityDef aas_types

The purpose of a declaration is to define the properties and behavior of game content. More than one type of decl can be included in a single file however, for organizational purposes it's recommended that they are kept separate. Alternatively you can also put just one decl in a single file, allowing you to use the operating system's own file system to navigate the declarations.

Contents

Universal declaration types

These declarations are handled by the engine:

Image:D3square_25.png Declaration types

The information in this section is specific to Doom 3.

Along with the universal decls Doom 3 provides the following:

Image:Q4square_25.png Declaration types

The information in this section is specific to Quake 4.

Along with the universal decls Quake 4 provides the following:

Editing tools

The following tools can be used to edit or create new declaration files.

  • Doom 3 - Just type editDecls into the console. Note: Some declarations cannot be created this way.
  • Notepad - A text editor packaged with Mircosoft Windows.
  • UltraEdit32 - A very good text editor with great search/replace in files/macro recording/tabbed files/regexp and all that stuff. Also has a Doom 3 script and GUI syntax highlighting by eutectic.
  • Editpad (Pro/Lite/Classic) - A third party text editor that supports opening multiple files at once and search /replace functionality via use of regular expressions.
  • ConText - This is a text editor with programing in mind. You can have several text documents opened at once similar to Firefox and Netscape; it also has syntax highlighters, including one for Doom 3 located here. Plus quite a few other features.

NOTE: There is a discrepancy in the way Unix, Windows, and Mac operating systems terminate a line of text. The details of which can be read here. Because of this, text files created under one operating system may not display properly in another, provided the text editor in use does not take this discrepancy into account. One program that falls victim to this problem is Notepad.

It's also handy to have a grep tool available to search the contents of multiple declarations files for a specific item or pattern. For instance, searching for a specific material shader if you are unsure in which .MTR file it was located in.

Personal tools
Main