4 LEV_COMP(6) 1996 LEV_COMP(6)
9 lev_comp - NetHack special levels compiler
12 lev_comp [ -w ] [ files ]
14 If no arguments are given, it reads standard input.
17 Lev_comp is a special level compiler for NetHack version 3.2
18 and higher. It takes description files as arguments and
19 produces level files that can be loaded by NetHack at run-
22 The purpose of this tool is to provide NetHack administra-
23 tors and implementors with a convenient way for adding spe-
24 cial levels to the game, or modifying existing ones, without
25 having to recompile the entire world.
27 The -w option causes lev_comp to perform extra checks on the
28 level and display extra warnings, however these warnings are
29 sometimes superfluous, so they are not normally displayed.
45 maze_level : maze_def flags lev_init messages regions
48 room_level : level_def flags lev_init messages rreg_init rooms corridors_def
51 level_def : LEVEL_ID ':' string
54 lev_init : /* nothing */
55 | LEV_INIT_ID ':' CHAR ',' CHAR ',' BOOLEAN ',' BOOLEAN ',' light_state ',' walled
70 LEV_COMP(6) 1996 LEV_COMP(6)
77 | FLAGS_ID ':' flag_list
80 flag_list : FLAG_TYPE ',' flag_list
84 messages : /* nothing */
88 message : MESSAGE_ID ':' STRING
91 rreg_init : /* nothing */
95 init_rreg : RANDOM_OBJECTS_ID ':' object_list
96 | RANDOM_MONSTERS_ID ':' monster_list
99 rooms : /* Nothing - dummy room for use with INIT_MAP */
107 corridors_def : random_corridors
111 random_corridors: RAND_CORRIDOR_ID
114 corridors : /* nothing */
118 corridor : CORRIDOR_ID ':' corr_spec ',' corr_spec
119 | CORRIDOR_ID ':' corr_spec ',' INTEGER
122 corr_spec : '(' INTEGER ',' DIRECTION ',' door_pos ')'
125 aroom : room_def room_details
129 May Last change: 16 2
136 LEV_COMP(6) 1996 LEV_COMP(6)
140 | subroom_def room_details
143 subroom_def : SUBROOM_ID ':' room_type ',' light_state ',' subroom_pos ',' room_size ',' string roomfill
146 room_def : ROOM_ID ':' room_type ',' light_state ',' room_pos ',' room_align ',' room_size roomfill
149 roomfill : /* nothing */
153 room_pos : '(' INTEGER ',' INTEGER ')'
157 subroom_pos : '(' INTEGER ',' INTEGER ')'
161 room_align : '(' h_justif ',' v_justif ')'
165 room_size : '(' INTEGER ',' INTEGER ')'
169 room_details : /* nothing */
170 | room_details room_detail
173 room_detail : room_name
188 room_name : NAME_ID ':' string
191 room_chance : CHANCE_ID ':' INTEGER
195 May Last change: 16 3
202 LEV_COMP(6) 1996 LEV_COMP(6)
208 room_door : DOOR_ID ':' secret ',' door_state ',' door_wall ',' door_pos
215 door_wall : DIRECTION
223 maze_def : MAZE_ID ':' string ',' filling
234 aregion : map_definition reg_init map_details
237 map_definition : NOMAP_ID
238 | map_geometry MAP_ID
241 map_geometry : GEOMETRY_ID ':' h_justif ',' v_justif
244 h_justif : LEFT_OR_RIGHT
248 v_justif : TOP_OR_BOT
252 reg_init : /* nothing */
256 init_reg : RANDOM_OBJECTS_ID ':' object_list
257 | RANDOM_PLACES_ID ':' place_list
261 May Last change: 16 4
268 LEV_COMP(6) 1996 LEV_COMP(6)
272 | RANDOM_MONSTERS_ID ':' monster_list
276 | object ',' object_list
279 monster_list : monster
280 | monster ',' monster_list
284 | place ',' place_list
287 map_details : /* nothing */
288 | map_details map_detail
291 map_detail : monster_detail
313 monster_detail : MONSTER_ID chance ':' monster_c ',' m_name ',' coordinate
317 monster_infos : /* nothing */
318 | monster_infos monster_info
321 monster_info : ',' string
327 May Last change: 16 5
334 LEV_COMP(6) 1996 LEV_COMP(6)
339 | ',' MON_APPEARANCE string
342 object_detail : OBJECT_ID object_desc
343 | COBJECT_ID object_desc
346 object_desc : chance ':' object_c ',' o_name ',' object_where object_infos
349 object_where : coordinate
353 object_infos : /* nothing */
354 | ',' curse_state ',' monster_id ',' enchantment optional_name
355 | ',' curse_state ',' enchantment optional_name
356 | ',' monster_id ',' enchantment optional_name
359 curse_state : RANDOM_TYPE
366 enchantment : RANDOM_TYPE
370 optional_name : /* nothing */
375 door_detail : DOOR_ID ':' door_state ',' coordinate
378 trap_detail : TRAP_ID chance ':' trap_name ',' coordinate
381 drawbridge_detail: DRAWBRIDGE_ID ':' coordinate ',' DIRECTION ',' door_state
384 mazewalk_detail : MAZEWALK_ID ':' coordinate ',' DIRECTION
387 wallify_detail : WALLIFY_ID
393 May Last change: 16 6
400 LEV_COMP(6) 1996 LEV_COMP(6)
404 ladder_detail : LADDER_ID ':' coordinate ',' UP_OR_DOWN
407 stair_detail : STAIR_ID ':' coordinate ',' UP_OR_DOWN
410 stair_region : STAIR_ID ':' lev_region ',' lev_region ',' UP_OR_DOWN
413 portal_region : PORTAL_ID ':' lev_region ',' lev_region ',' string
416 teleprt_region : TELEPRT_ID ':' lev_region ',' lev_region teleprt_detail
419 branch_region : BRANCH_ID ':' lev_region ',' lev_region
422 teleprt_detail : /* empty */
427 | LEV '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')'
430 fountain_detail : FOUNTAIN_ID ':' coordinate
433 sink_detail : SINK_ID ':' coordinate
436 pool_detail : POOL_ID ':' coordinate
439 diggable_detail : NON_DIGGABLE_ID ':' region
442 passwall_detail : NON_PASSWALL_ID ':' region
445 region_detail : REGION_ID ':' region ',' light_state ',' room_type prefilled
448 altar_detail : ALTAR_ID ':' coordinate ',' alignment ',' altar_type
451 gold_detail : GOLD_ID ':' amount ',' coordinate
454 engraving_detail: ENGRAVING_ID ':' coordinate ',' engraving_type ',' string
459 May Last change: 16 7
466 LEV_COMP(6) 1996 LEV_COMP(6)
496 prefilled : /* empty */
498 | ',' FILLING ',' BOOLEAN
506 door_state : DOOR_STATE
510 light_state : LIGHT_STATE
514 alignment : ALIGNMENT
519 altar_type : ALTAR_TYPE
525 May Last change: 16 8
532 LEV_COMP(6) 1996 LEV_COMP(6)
536 p_register : P_REGISTER '[' INTEGER ']'
539 o_register : O_REGISTER '[' INTEGER ']'
542 m_register : M_REGISTER '[' INTEGER ']'
545 a_register : A_REGISTER '[' INTEGER ']'
568 engraving_type : ENGRAVING_TYPE
572 coord : '(' INTEGER ',' INTEGER ')'
575 region : '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')'
579 Lines beginning with '#' are considered comments.
581 The contents of a "MAP" description of a maze is a rectangle
582 showing the exact level map that should be used for the
583 given part of a maze. Each character in the map corresponds
584 to a location on the screen. Different location types are
585 denoted using different ASCII characters. The following
586 characters are recognized. To give an idea of how these are
587 used, see the EXAMPLE, below. The maximum size of a map is
591 May Last change: 16 9
598 LEV_COMP(6) 1996 LEV_COMP(6)
602 normally 76 columns by 21 rows.
606 '+' a doorway (state is specified in a DOOR declaration)
608 'B' boundary room location (for bounding unwalled irregular regions)
612 'H' a secret corridor
615 'K' a sink (if SINKS is defined, else a room location)
616 '}' a part of a moat or other deep water
619 'W' water (yes, different from a pool)
623 '.' a normal room location (unlit unless lit in a REGION declaration)
627 Here is an example of a description file (a very simple
630 MAZE : "fortress", random
631 GEOMETRY : center , center
643 MONSTER: '@', "Wizard of Yendor", (4,4)
644 OBJECT: '"', "Amulet of Yendor", (4,4)
645 # a hell hound flanking the Wiz on a random side
646 RANDOM_PLACES: (4,3), (4,5), (3,4), (5,4)
647 MONSTER: 'd', "hell hound", place[0]
648 # a chest on another random side
649 OBJECT: '(', "chest", place[1]
650 # a sack on a random side, with a diamond and maybe a ruby in it
651 CONTAINER: '(', "sack", place[2]
652 OBJECT: '*', "diamond", contained
653 OBJECT[50%]: '*', "ruby", contained
657 May Last change: 16 10
664 LEV_COMP(6) 1996 LEV_COMP(6)
668 # a random dragon somewhere
669 MONSTER: 'D', random, random
670 # 3 out of 4 chance for a random trap in the EAST end
671 TRAP[75%]: random, (6,4)
672 # an electric eel below the SOUTH end
673 MONSTER: ';', "electric eel", (4,8)
674 # make the walls non-diggable
675 NON_DIGGABLE: (0,0,8,8)
676 TELEPORT_REGION: levregion(0,0,79,20), (0,0,8,8)
678 This example will produce a file named "fortress" that can
679 be integrated into one of the numerous mazes of the game.
681 Note especially the final, TELEPORT_REGION specification.
682 This says that level teleports or other non-stairway
683 arrivals on this level can land anywhere on the level except
684 the area of the map. This shows the use of the ``levre-
685 gion'' prefix allowed in certain region specifications.
686 Normally, regions apply only to the most recent MAP specifi-
687 cation, but when prefixed with ``levregion'', one can refer
688 to any area of the level, regardless of the placement of the
689 current MAP in the level.
692 Jean-Christophe Collet, David Cohrs.
695 dgn_comp(6), nethack(6)
698 Probably infinite. Most importantly, still needs additional
723 May Last change: 16 11