Des-file format

des-file format is the language which is used to describe the special levels for NetHack. It is compiled into a binary file by lev_comp.

There are two types of levels you can create: mazes and rooms. For maze-type levels you "draw" one or more maps with ASCII characters and then describe the monsters, objects and so on that are in the map. For room-type levels, you describe rooms and their contents.

Language syntax
All lines beginning with # are comments and are ignored by the level compiler. Example:
 * 1) This is a comment.

MAZE
MAZE:"foo",'X' Example: MAZE:"soko3-2",' '
 * foo is the unique file name which will be used for this special level, up to 8 characters. For example: soko3-2.
 * 'X' is the fill map character. The map will be filled with this dungeon feature before anything else is done.

FLAGS
FLAGS:flaglist flaglist is one or more of the following flags, separated by commas Example: FLAGS:noteleport,hardfloor
 * noteleport: Player cannot teleport within the level.
 * hardfloor: The floor is too hard to dig.
 * nommap: magic mapping does not work.
 * arboreal</tt>: supposedly an outdoor map. Basically solid walls will be trees, and corridors are not used.
 * shortsighted</tt>: Monsters cannot see you from far away.

MESSAGE
MESSAGE:"string" "string"</tt> is any message you want player to see when entering the level. Example: MESSAGE: "Well done, mortal!"

OBJECT
OBJECT:'X',"name",place Examples: OBJECT:'%',"food ration",random OBJECT:'*',random,(10,10) OBJECT:'?',"genocide",place[0]
 * 'X'</tt>: a character denoting one of the object classes.
 * "name"</tt>: either an object name as listed in objects.c, or random</tt>
 * place</tt>: either a coordinate, a RANDOM_PLACES place, or random</tt>

NON_DIGGABLE
NON_DIGGABLE:region Sets the walls inside the region as non-diggable. Example: NON_DIGGABLE:(00,00,13,12)

NON_PASSWALL
NON_PASSWALL:region Players and monsters cannot phase through the walls inside the region Example: NON_PASSWALL:(00,00,13,12)

TRAP
TRAP:"name",place Examples: TRAP:"hole",(12,10) TRAP:"anti magic",random TRAP:random,random
 * "name"</tt> is the trap's name, or random</tt>
 * place</tt> is either a coordinate, a RANDOM_PLACES place, or random</tt>

MONSTER
MONSTER:'X',"name",place
 * 'X'</tt> is the monster class symbol, or random</tt>, or a RANDOM_MONSTERS index
 * "name"</tt> is the specific monster, or random</tt>
 * <tt>place</tt> is either a coordinate, a RANDOM_PLACES place, or <tt>random</tt>

You can also put some other things in there to further define the monster. See the examples below.

Examples: MONSTER:'v',"dust vortex",(42,05) MONSTER:'E',"earth elemental",(39,06),peaceful MONSTER:'&',"Pestilence",place[0],hostile MONSTER:random,random,random MONSTER:random,random,(01,01), asleep MONSTER:monster[0],random,(27,05) MONSTER:'m',"giant mimic",place[1],m_feature "fountain" MONSTER:'m',random,place[0], m_object "luckstone" MONSTER:'@',"rogue",(35,06),peaceful,"Pug"

RANDOM_PLACES
RANDOM_PLACES:place,... With this command you can set up to 10 coordinate registers, which you can access by using <tt>place[N]</tt> instead of a coordinate in any other command. The registers are shuffled at level creation time.

Example: RANDOM_PLACES:(23,9),(37,14),(51,9) OBJECT:'?',"genocide",place[0]

RANDOM_MONSTERS
RANDOM_MONSTERS:'X',... With this command you can set up 10 monster symbol registers, which you can access by using <tt>monster[N]</tt> instead of a monster symbol in any other command. The registers are shuffled at level creation time.

Example: RANDOM_MONSTERS: 'E', 'X' MONSTER:monster[0],random,(27,05)

RANDOM_OBJECTS
RANDOM_OBJECTS:'X',... With this command you can set up 10 object class symbol registers, which you can access by using <tt>object[N]</tt> instead of a object class symbol in any other command. The registers are shuffled at level creation time.

Example: RANDOM_OBJECTS:'[',')','*','%' OBJECT:object[0],random,(39,05)

Trap names
"anti magic", "arrow", "bear", "board", "dart", "falling rock", "fire", "hole", "land mine", "level teleport", "magic portal", "magic", "pit", "polymorph", "rolling boulder", "rust", "sleep gas", "spiked pit", "statue", "teleport", "trap door", "web"