Difference between revisions of "Dungeon.def format"

From NetHackWiki
Jump to navigation Jump to search
m (RNDCHLEVEL: - see also LEVEL)
m (bonetag can be "none")
Line 16: Line 16:
  
 
*<tt>"name"</tt> is the name of the dungeon
 
*<tt>"name"</tt> is the name of the dungeon
*<tt>"bonetag"</tt> is the character used in file names when a bones file is created in this dungeon.
+
*<tt>"bonetag"</tt> is the character used in file names when a bones file is created in this dungeon, or <tt>"none"</tt>, in which case no bones will be created in the dungeon.
 
*<tt>base</tt> and <tt>range</tt> define the dungeon depth.
 
*<tt>base</tt> and <tt>range</tt> define the dungeon depth.
  
Line 113: Line 113:
  
 
*<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-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-level with the same name.
*<tt>bonetag</tt> is a single character used in a filename when this level leaves a bones. This should be unique among all special levels.
+
*<tt>bonetag</tt> is a single character used in a filename when this level leaves a bones, or <tt>"none"</tt>, in which case no bones will be created in the level. This should be unique among all special levels in this dungeon.
 
*<tt>base</tt> and <tt>range</tt> define the branch depth
 
*<tt>base</tt> and <tt>range</tt> define the branch depth
 
*<tt>chance</tt> is optional, gives the % chance of this level existing in any given game.
 
*<tt>chance</tt> is optional, gives the % chance of this level existing in any given game.
Line 127: Line 127:
  
 
*<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.
*<tt>bonetag</tt> is a single character used in a filename when this level leaves a bones. This should be unique among all special levels.
+
*<tt>bonetag</tt> is a single character used in a filename when this level leaves a bones, or <tt>"none"</tt>, in which case no bones will be created in the dungeon. This should be unique among all special levels in this dungeon.
 
*<tt>base</tt> and <tt>range</tt> define the branch depth
 
*<tt>base</tt> and <tt>range</tt> define the branch depth
 
*<tt>chance</tt> is optional, gives the % chance of this level existing in any given game.
 
*<tt>chance</tt> is optional, gives the % chance of this level existing in any given game.
Line 164: Line 164:
  
 
*<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.
*<tt>bonetag</tt> is a single character used in a filename when this level leaves a bones. This should be unique among all special levels. Can also be <tt>"none"</tt>.
+
*<tt>bonetag</tt> is a single character used in a filename when this level leaves a bones, or <tt>"none"</tt>, in which case no bones will be created in the level. This should be unique among all special levels in this dungeon.
 
*<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 level depth, relative to <tt>chain</tt>.
 
*<tt>base</tt> and <tt>range</tt> define the level depth, relative to <tt>chain</tt>.
Line 179: Line 179:
  
 
*<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.
*<tt>bonetag</tt> is a single character used in a filename when this level leaves a bones. This should be unique among all special levels. Can also be <tt>"none"</tt>
+
*<tt>bonetag</tt> is a single character used in a filename when this level leaves a bones, or <tt>"none"</tt>, in which case no bones will be created in the level. This should be unique among all special levels in this dungeon.
 
*<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 level depth, relative to <tt>chain</tt>.
 
*<tt>base</tt> and <tt>range</tt> define the level depth, relative to <tt>chain</tt>.

Revision as of 20:52, 14 July 2007

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 it's 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 version 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.