Des-file format

From NetHackWiki
Revision as of 10:26, 10 September 2006 by Paxed (talk | contribs) (beginning. still lots of stuff missing.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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:

# This is a comment.

Maze-type levels

MAZE

MAZE:"foo",'X'
  • 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.

Example:

MAZE:"soko3-2",' '

FLAGS

FLAGS:flaglist

flaglist is one or more of the following flags, separated by commas

  • noteleport: Player cannot teleport within the level.
  • hardfloor: The floor is too hard to dig.
  • nommap: magic mapping does not work.
  • arboreal: supposedly an outdoor map. Basically solid walls will be trees, and corridors are not used.
  • shortsighted: Monsters cannot see you from far away.

Example:

FLAGS:noteleport,hardfloor

MESSAGE

MESSAGE:"string"

"string" is any message you want player to see when entering the level. Example:

MESSAGE: "Well done, mortal!"

OBJECT

OBJECT:'X',"name",place
  • 'X': a character denoting one of the object classes.
  • "name": either an object name as listed in objects.c, or random
  • place: either a coordinate, a RANDOM_PLACES place, or random

Examples:

OBJECT:'%',"food ration",random
OBJECT:'*',random,(10,10)
OBJECT:'?',"genocide",place[0]

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
  • "name" is the trap's name, or random
  • place is either a coordinate, a RANDOM_PLACES place, or random

Examples:

TRAP:"hole",(12,10)
TRAP:"anti magic",random
TRAP:random,random

MONSTER

MONSTER:'X',"name",place
  • 'X' is the monster class symbol, or random, or a RANDOM_MONSTERS index
  • "name" is the specific monster, or random
  • place is either a coordinate, a RANDOM_PLACES place, or random

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 place[N] 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 monster[N] 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 object[N] 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)

ROOM-type Levels

Common syntax

Map characters

character dungeon feature
' ' solid wall
'#' corridor
'.' room floor
'-' horizontal wall
'|' vertical wall
'+' door
'A' air
'B' crosswall
'C' cloud
'S' secret door
'H' secret corridor
'{' fountain
'\' throne
'K' sink
'}' moat
'P' pool of water
'L' lava pool
'I' ice
'W' water
'T' tree
'F' iron bars

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"