Making DOOM 3 Mods : Decl Files

The core of Doom 3 is driven by what we lovingly refer to as 'decl files' which is short for 'declaration files'. A decl file contains one or more decl types. These types can be mixed and matched, but we tend to keep all the decls of a certain type in a certain file. There are 15 decl types that come in standard Doom 3, but more decls can be added by mod authors.

The standard 15 decls

#defineKeywordFileDescription
DECL_TABLE table.mtrMaterial Look-up tables
DECL_MATERIAL material.mtrMaterial Definitions
DECL_SKIN skin.skinSkin Files
DECL_SOUND sound.sndshdSound Shaders
DECL_ENTITYDEF entityDef.defEntity Definitions
DECL_MODELDEF model.defModel Definitions
DECL_FX fx.fxSpecial Effects
DECL_PARTICLE particle.prtParticles
DECL_AF articulatedFigure.afArticulated Figures (rag dolls)
DECL_PDA pda.pdaPDAs
DECL_VIDEO video.pdaVideo Discs
DECL_AUDIO audio.pdaAudio Logs
DECL_EMAIL email.pdaEmails
DECL_MODELEXPORT export.defExport sections
DECL_MAPDEF mapDef.defMap definitions

Useful decl related console commands

CommandDescription
listDeclsLists all the decls that have been scanned (but not necessarily loaded)
reloadDeclsReloads all the decls that have been changed since the last reload (pass "all" to reload all decls)
touchThis causes a decl to be loaded, parsed, and cached
listTables
List the Decls of a certain type that are parsed and have been referenced this level.

You can pass it 'all' to list all the decls (including unparsed ones) or 'ever' to list parsed decls that have ever been referenced (not just in this level).

  • The first column contains a '*' if the decl is referenced this level, a '.' if it has ever been referenced, and a blank if it has never been referenced.
  • The second column contains a 'D' if the decl is 'defaulted' (referenced but not defined, so it uses the default definition).
  • The third column is the decl index
  • The fourth column is either the decl name, or some data specific to the decl type
listMaterials
listSkins
listSoundShaders
listEntityDefs
listFX
listParticles
listAF
listPDAs
listEmails
listVideos
listAudios
printTable

Prints a decl (to the console) along with some useful information about it's current state. You have to pass it the name of a decl to print.
printMaterial
printSkin
printSoundShader
printEntityDef
printFX
printParticle
printAF
printPDA
printEmail
printVideo
printAudio

Copyright © 2004 id software