Difference between revisions of "Dungeon.def format"

From NetHackWiki
Jump to navigation Jump to search
m (Fix floating TOC)
(Use self anchors)
Line 54: Line 54:
 
  ALIGNMENT: flag
 
  ALIGNMENT: flag
  
Sets the alignment for the previously defined [[#DUNGEON|DUNGEON]]. Only one of these per dungeon allowed.
+
Sets the alignment for the previously defined {{sa|DUNGEON}}. Only one of these per dungeon allowed.
  
 
flag is one of the following flags:
 
flag is one of the following flags:
Line 78: Line 78:
 
  BRANCH: "name" @ (base, range) type dir
 
  BRANCH: "name" @ (base, range) type dir
  
Adds a branch to the previously defined [[#DUNGEON|DUNGEON]].
+
Adds a branch to the previously defined {{sa|DUNGEON}}.
  
 
*<tt>"name"</tt> is the name of the branch. You must later define a DUNGEON with the same name.
 
*<tt>"name"</tt> is the name of the branch. You must later define a DUNGEON with the same name.
Line 98: Line 98:
 
  CHAINBRANCH: "name" "chain" + (base, range) type dir
 
  CHAINBRANCH: "name" "chain" + (base, range) type dir
  
Adds a branch to the previously defined [[#DUNGEON|DUNGEON]]. This is similar to [[#BRANCH|BRANCH]], except the depth depends where a [[#LEVEL|LEVEL]] occurs in the previously defined DUNGEON.
+
Adds a branch to the previously defined {{sa|DUNGEON}}. This is similar to {{sa|BRANCH}}, except the depth depends where a {{sa|LEVEL}} occurs in the previously defined DUNGEON.
  
 
*<tt>name</tt> is the name of the branch. You must later define a DUNGEON with the same name.
 
*<tt>name</tt> is the name of the branch. You must later define a DUNGEON with the same name.
 
*<tt>chain</tt> is a name of a previously defined LEVEL in this DUNGEON.
 
*<tt>chain</tt> is a name of a previously defined LEVEL in this DUNGEON.
 
*<tt>base</tt> and <tt>range</tt> define the branch depth, relative to <tt>chain</tt>.
 
*<tt>base</tt> and <tt>range</tt> define the branch depth, relative to <tt>chain</tt>.
*<tt>type</tt> and <tt>dir</tt> as in [[#BRANCH|BRANCH]]
+
*<tt>type</tt> and <tt>dir</tt> as in {{sa|BRANCH}}
  
 
Example:
 
Example:
Line 112: Line 112:
 
  LEVEL: "name" "bonetag" @ (base, range) chance
 
  LEVEL: "name" "bonetag" @ (base, range) chance
  
Adds a special level to the previously defined [[#DUNGEON|DUNGEON]]. See also [[#RNDLEVEL|RNDLEVEL]].
+
Adds a special level to the previously defined {{sa|DUNGEON}}. See also {{sa|RNDLEVEL}}.
  
 
*<tt>name</tt> is the name of this special level, and is used for loading the special levels from disk. You must define a special [[Des-file format|des-level]] with the same name.
 
*<tt>name</tt> is the name of this special level, and is used for loading the special levels from disk. You must define a special [[Des-file format|des-level]] with the same name.
Line 126: Line 126:
 
  RNDLEVEL: "name" "bonetag" @ (base, range) chance nlevels
 
  RNDLEVEL: "name" "bonetag" @ (base, range) chance nlevels
  
Adds a special level to the previously defined [[#DUNGEON|DUNGEON]], with several variants for the des-level. See also [[#LEVEL|LEVEL]].
+
Adds a special level to the previously defined {{sa|DUNGEON}}, with several variants for the des-level. See also {{sa|LEVEL}}.
  
 
*<tt>name</tt> is the name of this special level, used for loading the special levels from disk. The name format will be <tt>name-num</tt>, where <tt>num</tt> is the variant of the level to be loaded. For example, <tt>bigrm-3</tt>. See also [[Des-file format#MAZE|MAZE]] or [[Des-file format#LEVEL|LEVEL]] in the [[Des-file format]] article.
 
*<tt>name</tt> is the name of this special level, used for loading the special levels from disk. The name format will be <tt>name-num</tt>, where <tt>num</tt> is the variant of the level to be loaded. For example, <tt>bigrm-3</tt>. See also [[Des-file format#MAZE|MAZE]] or [[Des-file format#LEVEL|LEVEL]] in the [[Des-file format]] article.
Line 141: Line 141:
 
  LEVELDESC: flag
 
  LEVELDESC: flag
  
Defines flags for a previously defined [[#LEVEL|LEVEL]] or [[#RNDLEVEL|RNDLEVEL]].
+
Defines flags for a previously defined {{sa|LEVEL}} or {{sa|RNDLEVEL}}.
  
<tt>flag</tt> is the same as [[#DESCRIPTION|DESCRIPTION]] has.
+
<tt>flag</tt> is the same as {{sa|DESCRIPTION}} has.
  
 
Example:
 
Example:
Line 152: Line 152:
 
  LEVALIGN: flag
 
  LEVALIGN: flag
  
Defines alignment of a previously defined [[#LEVEL|LEVEL]] or [[#RNDLEVEL|RNDLEVEL]].
+
Defines alignment of a previously defined {{sa|LEVEL}} or {{sa|RNDLEVEL}}.
  
<tt>flag</tt> is the same as [[#ALIGNMENT|ALIGNMENT]] has.
+
<tt>flag</tt> is the same as {{sa|ALIGNMENT}} has.
  
 
Example:
 
Example:
Line 163: Line 163:
 
  CHAINLEVEL: "name" "bonetag" "chain" + (base, range) chance
 
  CHAINLEVEL: "name" "bonetag" "chain" + (base, range) chance
  
Adds a special level to the previously defined [[#DUNGEON|DUNGEON]]. This is similar to [[#LEVEL|LEVEL]], except the depth depends where another LEVEL occurs in the previously defined DUNGEON.
+
Adds a special level to the previously defined {{sa|DUNGEON}}. This is similar to {{sa|LEVEL}}, except the depth depends where another LEVEL occurs in the previously defined DUNGEON.
  
 
*<tt>name</tt> is the name of this special level. used for loading the special levels from disk.
 
*<tt>name</tt> is the name of this special level. used for loading the special levels from disk.
Line 178: Line 178:
 
  RNDCHLEVEL: "name" "bonetag" "chain" + (base, range) chance nlevels
 
  RNDCHLEVEL: "name" "bonetag" "chain" + (base, range) chance nlevels
  
Adds a special level to the previously defined [[#DUNGEON|DUNGEON]], with several variants for the des-level. This is similar to [[#CHAINLEVEL|CHAINLEVEL]], except the depth depends where another LEVEL occurs in the previously defined DUNGEON.
+
Adds a special level to the previously defined {{sa|DUNGEON}}, with several variants for the des-level. This is similar to {{sa|CHAINLEVEL}}, except the depth depends where another LEVEL occurs in the previously defined DUNGEON.
  
 
*<tt>name</tt> is the name of this special level. used for loading the special levels from disk. The name format will be <tt>name-num</tt>, where <tt>num</tt> is the variant of the level to be loaded. For example, <tt>bigrm-3</tt>. See also MAZE in [[Des-file format#MAZE|MAZE]] or [[Des-file format#LEVEL|LEVEL]] in the [[Des-file format]] article.
 
*<tt>name</tt> is the name of this special level. used for loading the special levels from disk. The name format will be <tt>name-num</tt>, where <tt>num</tt> is the variant of the level to be loaded. For example, <tt>bigrm-3</tt>. See also MAZE in [[Des-file format#MAZE|MAZE]] or [[Des-file format#LEVEL|LEVEL]] in the [[Des-file format]] article.

Revision as of 16:57, 28 May 2012

dungeon.def is the file that describes how the dungeon branches and what special levels are used and where. It is compiled into a binary file by dgn_comp

Comments

All lines beginning with # are comments and are ignored by the compiler.

Example:

# This is a comment.

DUNGEON

DUNGEON: "name" "bonetag" (base, range)

This is used to define a new dungeon.

  • "name" is the name of the dungeon
  • "bonetag" is the character used in file names when a bones file is created in this dungeon, or "none", in which case no bones will be created in the dungeon.
  • base and range define the dungeon depth.

You can also add an optional integer, which is the chance of this dungeon being generated.

Example:

DUNGEON: "The Dungeons of Doom" "D" (25, 5)

ENTRY

ENTRY: lvl

Set the entry level for this dungeon. 0 means from the top, negative number means the level from the bottom (-1 is the bottom level), greater than 0 means the level number from the top of the dungeon.

Example:

ENTRY: -1

DESCRIPTION

DESCRIPTION: flag

Sets a flag for the previously defined DUNGEON. You can use as many DESCRIPTION lines as you want.

flag is one of the following flags:

  • town
  • hellish
  • mazelike
  • roguelike

Example:

DESCRIPTION: mazelike

ALIGNMENT

ALIGNMENT: flag

Sets the alignment for the previously defined DUNGEON. Only one of these per dungeon allowed.

flag is one of the following flags:

  • unaligned (or its synonym noalign)
  • lawful
  • neutral
  • chaotic

Example:

ALIGNMENT: lawful

PROTOFILE

PROTOFILE: "str"

Sets the special level prototype filename. This is used when loading the lev-file from disk. See MAZE in Des-file format.

Example:

PROTOFILE: "tower"

BRANCH

BRANCH: "name" @ (base, range) type dir

Adds a branch to the previously defined DUNGEON.

  • "name" is the name of the branch. You must later define a DUNGEON with the same name.
  • base and range define the depth where the branch occurs.
  • type is optional (defaults to stair), or one of the following:
    • stair, a two-way stair
    • no_up, no up staircase
    • no_down, no down staircase
    • portal, portal connection
  • dir is optional (defaults to down), or is one of the following:
    • up
    • down

Example:

BRANCH: "Vlad's Tower" @ (9, 5) up

CHAINBRANCH

CHAINBRANCH: "name" "chain" + (base, range) type dir

Adds a branch to the previously defined DUNGEON. This is similar to BRANCH, except the depth depends where a LEVEL occurs in the previously defined DUNGEON.

  • name is the name of the branch. You must later define a DUNGEON with the same name.
  • chain is a name of a previously defined LEVEL in this DUNGEON.
  • base and range define the branch depth, relative to chain.
  • type and dir as in BRANCH

Example:

CHAINBRANCH: "Gehennom" "castle" + (0, 0) no_down

LEVEL

LEVEL: "name" "bonetag" @ (base, range) chance

Adds a special level to the previously defined DUNGEON. See also RNDLEVEL.

  • name is the name of this special level, and is used for loading the special levels from disk. You must define a special des-level with the same name.
  • bonetag is a single character used in a filename when this level leaves a bones, or "none", in which case no bones will be created in the level. This should be unique among all special levels in this dungeon.
  • base and range define the branch depth
  • chance is optional, gives the % chance of this level existing in any given game.

Example:

LEVEL: "oracle" "O" @ (5, 5)

RNDLEVEL

RNDLEVEL: "name" "bonetag" @ (base, range) chance nlevels

Adds a special level to the previously defined DUNGEON, with several variants for the des-level. See also LEVEL.

  • name is the name of this special level, used for loading the special levels from disk. The name format will be name-num, where num is the variant of the level to be loaded. For example, bigrm-3. See also MAZE or LEVEL in the Des-file format article.
  • bonetag is a single character used in a filename when this level leaves a bones, or "none", in which case no bones will be created in the dungeon. This should be unique among all special levels in this dungeon.
  • base and range define the branch depth
  • chance is optional, gives the % chance of this level existing in any given game.
  • nlevels is the number of different special level layout versions or variants for this particular level.

Example:

RNDLEVEL: "bigrm" "B" @ (10, 3) 40 5

LEVELDESC

LEVELDESC: flag

Defines flags for a previously defined LEVEL or RNDLEVEL.

flag is the same as DESCRIPTION has.

Example:

LEVELDESC: town

LEVALIGN

LEVALIGN: flag

Defines alignment of a previously defined LEVEL or RNDLEVEL.

flag is the same as ALIGNMENT has.

Example:

LEVALIGN: chaotic

CHAINLEVEL

CHAINLEVEL: "name" "bonetag" "chain" + (base, range) chance

Adds a special level to the previously defined DUNGEON. This is similar to LEVEL, except the depth depends where another LEVEL occurs in the previously defined DUNGEON.

  • name is the name of this special level. used for loading the special levels from disk.
  • bonetag is a single character used in a filename when this level leaves a bones, or "none", in which case no bones will be created in the level. This should be unique among all special levels in this dungeon.
  • chain is a name of a previously defined LEVEL in this DUNGEON.
  • base and range define the level depth, relative to chain.
  • chance is optional, gives the % chance of this level existing in any given game.

Example:

CHAINLEVEL: "wizard2" "X" "wizard1" + (1, 0)

RNDCHLEVEL

RNDCHLEVEL: "name" "bonetag" "chain" + (base, range) chance nlevels

Adds a special level to the previously defined DUNGEON, with several variants for the des-level. This is similar to CHAINLEVEL, except the depth depends where another LEVEL occurs in the previously defined DUNGEON.

  • name is the name of this special level. used for loading the special levels from disk. The name format will be name-num, where num is the variant of the level to be loaded. For example, bigrm-3. See also MAZE in MAZE or LEVEL in the Des-file format article.
  • bonetag is a single character used in a filename when this level leaves a bones, or "none", in which case no bones will be created in the level. This should be unique among all special levels in this dungeon.
  • chain is a name of a previously defined LEVEL in this DUNGEON.
  • base and range define the level depth, relative to chain.
  • chance is optional, gives the % chance of this level existing in any given game.
  • nlevels is the number of different special level layout version for this particular level.