home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Games / NetHack 3.1.3 / source / doc / lev_comp.6 < prev    next >
Encoding:
Text File  |  1993-08-01  |  10.0 KB  |  477 lines  |  [TEXT/R*ch]

  1. .TH LEV_COMP 6 "29 Dec 1992"
  2. .UC 4
  3. .SH NAME
  4. lev_comp \- NetHack special levels compiler
  5. .SH SYNOPSIS
  6. .B lev_comp
  7. [
  8. .B \-w
  9. ]
  10. [
  11. .I files
  12. ]
  13. .PP
  14. If no arguments are given, it reads standard input.
  15. .SH DESCRIPTION
  16. .PP
  17. .I Lev_comp
  18. is a special level compiler for NetHack version 3.1 and higher.  It
  19. takes description files as arguments and produces level files that can
  20. be loaded by NetHack at runtime.
  21. .PP
  22. The purpose of this tool is to provide NetHack administrators and
  23. implementors with a convenient way for adding special levels to the
  24. game, or modifying existing ones, without having to recompile the
  25. entire world.
  26. .PP
  27. The
  28. .B \-w
  29. option causes
  30. .I lev_comp
  31. to perform extra checks on the level and display extra warnings, however
  32. these warnings are sometimes superfluous, so they are not normally displayed.
  33.  
  34. .SH GRAMMAR
  35. .PP
  36. .LP
  37. .nf
  38. .ta +8n +8n +8n +8n
  39.  
  40. file        : /* nothing */
  41.         | levels
  42.  
  43. levels        : level
  44.         | level levels
  45.  
  46. level        : maze_level
  47.             | room_level
  48.  
  49. maze_level    : maze_def flags lev_init messages regions
  50.  
  51. room_level    : level_def flags lev_init messages
  52.           rreg_init rooms corridors_def
  53.  
  54. level_def    : "LEVEL" ':' string
  55.  
  56. lev_init    : /* nothing */
  57.         | "INIT_MAP" ':' fgtyp ',' bgtyp ',' smooth ','
  58.           joined ',' light_state ',' walled
  59.  
  60. fgtyp        : CHAR /* a MAP map_contents character */
  61.  
  62. bgtyp        : CHAR /* a MAP map_contents character */
  63.  
  64. smooth        : boolean
  65.  
  66. joined        : boolean
  67.  
  68. walled        : boolean | "random"
  69.  
  70. flags        : /* nothing */
  71.         | "FLAGS" ':' flag_list
  72.  
  73. flag_list    : flag_type
  74.         | flag_type ',' flag_list
  75.  
  76. flag_type    : "noteleport" | "hardfloor" | "nommap"  | "shortsighted"
  77.  
  78. messages    : /* nothing */
  79.         | message messages
  80.  
  81. message        : "MESSAGE" ':' STRING
  82.  
  83. rreg_init    : /* nothing */
  84.         | rreg_init init_rreg
  85.  
  86. init_rreg    : "RANDOM_OBJECTS" ':' object_list
  87.         | "RANDOM_MONSTERS" ':' monster_list
  88.  
  89. rooms        : /* nothing */
  90.         | roomlist
  91.  
  92. roomlist    : aroom
  93.         | aroom rooms
  94.  
  95. corridors_def    : random_corridors
  96.         | corridors
  97.  
  98. random_corridors: "RANDOM_CORRIDOR"
  99.  
  100. corridors    : /* nothing */
  101.         | corridors corridor
  102.  
  103. corridor    : "CORRIDOR" ':' corr_spec ',' corr_spec
  104.         | "CORRIDOR" ':' corr_spec ',' INTEGER
  105.  
  106. corr_spec    : '(' INTEGER ',' direction ',' door_pos ')'
  107.  
  108. direction    : "north" | "south" | "east" | "west"
  109.  
  110. aroom        : room_def room_details
  111.         | subroom_def room_details
  112.  
  113. subroom_def    : "SUBROOM" ':' room_type ',' light_state ','
  114.           subroom_pos ',' room_size ',' string
  115.  
  116. room_def    : "ROOM" ':' room_type ',' light_state ','
  117.           room_pos ',' room_align ',' room_size
  118.  
  119. room_pos    : '(' INTEGER ',' INTEGER ')'
  120.         | "random"
  121.  
  122. subroom_pos    : '(' INTEGER ',' INTEGER ')'
  123.         | "random"
  124.  
  125. room_align    : '(' h_justif ',' v_justif ')'
  126.         | "random"
  127.  
  128. room_size    : '(' INTEGER ',' INTEGER ')'
  129.         | "random"
  130.  
  131. room_details    : /* nothing */
  132.         | room_details room_detail
  133.  
  134. room_detail    : room_name
  135.         | room_chance
  136.         | room_door
  137.         | monster_detail
  138.         | object_detail
  139.         | trap_detail
  140.         | altar_detail
  141.         | fountain_detail
  142.         | sink_detail
  143.         | pool_detail
  144.         | gold_detail
  145.         | engraving_detail
  146.         | stair_detail
  147.  
  148. room_name    : "NAME" ':' string
  149.  
  150. room_chance    : "CHANCE" ':' INTEGER
  151.  
  152. room_door    : "DOOR" ':' secret ',' door_state ','
  153.           door_wall ',' door_pos
  154.  
  155. secret        : boolean
  156.         | "random"
  157.  
  158. door_wall    : direction
  159.         | "random"
  160.  
  161. door_pos    : INTEGER
  162.         | "random"
  163.  
  164. boolean        : "true" | "false"
  165.  
  166. maze_def    : "MAZE" ':' string ',' filling
  167.  
  168. filling        : CHAR
  169.         | "random"
  170. regions     : aregion
  171.         | aregion regions
  172.  
  173. aregion     : map_definition reg_init map_details
  174.  
  175. map_definition    : "NOMAP"
  176.         | map_geometry "MAP" map_contents "ENDMAP"
  177.  
  178. map_geometry    : "GEOMETRY" ':' h_justif ',' v_justif
  179.  
  180. map_contents    : /* see discussion below */
  181.  
  182. h_justif    : "left" | "half-left" | "right" | "half-right"
  183.         | "center"
  184.  
  185. v_justif    : "top" | "bottom"
  186.         | "center"
  187.  
  188. reg_init    : /* nothing */
  189.         | reg_init init_reg
  190.  
  191. init_reg    : "RANDOM_OBJECTS" ':' object_list
  192.         | "RANDOM_PLACES" ':' place_list
  193.         | "RANDOM_MONSTERS" ':' monster_list
  194.  
  195. object_list    : object
  196.         | object ',' object_list
  197.  
  198. monster_list    : monster
  199.         | monster ',' monster_list
  200.  
  201. place_list    : place
  202.         | place ',' place_list
  203.  
  204. map_details    : /* nothing */
  205.         | map_details map_detail
  206.  
  207. map_detail    : monster_detail
  208.         | object_detail
  209.         | door_detail
  210.         | trap_detail
  211.         | drawbridge_detail
  212.         | region_detail
  213.         | stair_region
  214.         | portal_region
  215.         | teleprt_region
  216.         | branch_region
  217.         | altar_detail
  218.         | fountain_detail
  219.         | mazewalk_detail
  220.                 | wallify_detail
  221.         | ladder_detail
  222.         | stair_detail
  223.         | gold_detail
  224.         | engraving_detail
  225.         | diggable_detail
  226.         | passwall_detail
  227.  
  228. monster_detail    : "MONSTER" ':' monster_c ',' m_name ',' coordinate
  229.           monster_infos
  230.  
  231. monster_infos    : /* nothing */
  232.         | monster_infos monster_info
  233.  
  234. monster_info    : ',' string
  235.         | ',' mon_attitude
  236.         | ',' mon_alertness
  237.         | ',' alignment
  238.         | ',' "m_feature" string
  239.         | ',' "m_monster" string
  240.         | ',' "m_object" string
  241.  
  242. mon_attitude    : "peaceful" | "hostile"
  243.  
  244. mon_alertness    : "asleep" | "awake"
  245.  
  246. object_detail    : "OBJECT" ':' object_c ',' o_name ',' coordinate
  247.           object_infos
  248.  
  249. object_infos    : /* nothing */
  250.         | ',' STRING ',' enchantment
  251.             | ',' curse_state ',' enchantment ',' art_name
  252.  
  253. curse_state    : "random"
  254.         | "blessed" | "uncursed" | "cursed"
  255.  
  256. enchantment    : INTEGER
  257.         | "random"
  258.  
  259. door_detail    : "DOOR" ':' door_state ',' coordinate
  260.  
  261. trap_detail    : "TRAP" ':' trap_name ',' coordinate
  262.  
  263. drawbridge_detail: "DRAWBRIDGE" ':' coordinate ','
  264.           direction ',' door_state
  265.  
  266. mazewalk_detail    : "MAZEWALK" ':' coordinate ',' direction
  267.  
  268. wallify_detail    : "WALLIFY"
  269.  
  270. ladder_detail    : "LADDER" ':' coordinate ',' up_or_down
  271.  
  272. stair_detail    : "STAIR" ':' coordinate ',' up_or_down
  273.  
  274. stair_region    : "STAIR" ':' lev_region ',' lev_region ',' up_or_down
  275.  
  276. up_or_down:    : "up" | "down"
  277.  
  278. portal_region    : "PORTAL" ':' lev_region ',' lev_region ',' string
  279.  
  280. teleprt_region    : "TELEPORT_REGION" ':' lev_region
  281.           ',' lev_region teleprt_detail
  282.  
  283. branch_region    : "BRANCH" ':' lev_region ',' lev_region
  284.  
  285. teleprt_detail    : /* empty */
  286.         | ',' up_or_down
  287.  
  288. lev_region    : region
  289.         | "levregion"
  290.           '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')'
  291.  
  292. fountain_detail    : "FOUNTAIN" ':' coordinate
  293.  
  294. sink_detail    : "SINK" ':' coordinate
  295.  
  296. pool_detail    : "POOL" ':' coordinate
  297.  
  298. diggable_detail    : "NON_DIGGABLE" ':' region
  299.  
  300. passwall_detail    : "NON_PASSWALL" ':' region
  301.  
  302. region_detail    : "REGION" ':' region ',' light_state ','
  303.           room_type prefilled
  304.  
  305. altar_detail    : "ALTAR" ':' coordinate ',' alignment ',' altar_type
  306.  
  307. gold_detail    : "GOLD" ':' amount ',' coordinate
  308.  
  309. engraving_detail: "ENGRAVING" ':' coordinate ','
  310.           engraving_type ',' string
  311.  
  312. monster_c    : monster
  313.         | "random"
  314.         | m_register
  315.  
  316. object_c    : object
  317.         | "random"
  318.         | o_register
  319.  
  320. m_name        : string
  321.         | "random"
  322.  
  323. o_name        : string
  324.         | "random"
  325.  
  326. trap_name    : string
  327.         | "random"
  328.  
  329. room_type    : string
  330.         | "random"
  331.  
  332. prefilled    : /* empty */
  333.         | ',' filling
  334.         | ',' filling ',' irregular
  335.  
  336. filling        : "filled" | "unfilled"
  337.  
  338. irregular    : boolean /* irregular shaped room around region */
  339.  
  340. coordinate    : coord
  341.         | p_register
  342.         | "random"
  343.  
  344. door_state    : "open" | "closed" | "locked" | "nodoor" | "broken"
  345.         | "random"
  346.  
  347. light_state    : "lit" | "unlit"
  348.         | "random"
  349.  
  350. alignment    : "noalign" | "law" | "neutral" | "chaos"
  351.         | a_register
  352.         | "random"
  353.  
  354. altar_type    : "sanctum" | "shrine" | "altar"
  355.         | "random"
  356.  
  357. p_register    : "place" '[' INTEGER ']'
  358.  
  359. o_register    : "object" '[' INTEGER ']'
  360.  
  361. m_register    : "monster" '[' INTEGER ']'
  362.  
  363. a_register    : "align" '[' INTEGER ']'
  364.  
  365. place        : coord
  366.  
  367. monster     : CHAR
  368.  
  369. object        : CHAR
  370.  
  371. string        : STRING
  372.  
  373. art_name    : STRING
  374.         | "none"
  375.  
  376. amount        : INTEGER
  377.         | "random"
  378.  
  379. engraving_type    : "dust" | "engrave" | "burn" | "mark"
  380.         | "random"
  381.  
  382. coord        : '(' INTEGER ',' INTEGER ')'
  383.  
  384. region        : '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')'
  385. .fi
  386. .PP
  387. .I NOTE:
  388. .br
  389. Lines beginning with '#' are considered comments.
  390. .PP
  391. The contents of a "MAP" description of a maze is a rectangle showing the exact
  392. level map that should be used for the given part of a maze.
  393. Each character in the map corresponds to a location on the screen.
  394. Different location types are denoted using different ASCII characters.
  395. The following characters are recognized.
  396. To give an idea of how these are used, see the EXAMPLE, below.
  397. The maximum size of a map is normally 76 columns by 21 rows.
  398. .LP
  399. .nf
  400. .ta +8n +8n +8n
  401. \&'-'    horizontal wall
  402. \&'|'    vertical wall
  403. \&'+'    a doorway (state is specified in a DOOR declaration)
  404. \&'A'    open air
  405. \&'B'    boundary room location (for bounding unwalled irregular regions)
  406. \&'C'    cloudy air
  407. \&'I'    ice
  408. \&'S'    a secret door
  409. \&'H'    a secret corridor
  410. \&'{'    a fountain
  411. \&'\\'    a throne
  412. \&'K'    a sink (if SINKS is defined, else a room location)
  413. \&'}'    a part of a moat or other deep water
  414. \&'P'    a pool
  415. \&'L'    lava
  416. \&'#'    a corridor
  417. \&'.'    a normal room location (unlit unless lit in a REGION declaration)
  418. \&' '    stone
  419. .fi
  420. .SH EXAMPLE
  421. .PP
  422. Here is an example of a description file (a very simple one):
  423. .LP
  424. .nf
  425. .ta +8n +8n +8n
  426. MAZE : "fortress", random
  427. GEOMETRY : center , center
  428. MAP
  429. }}}}}}}}}
  430. }}}|-|}}}
  431. }}|-.-|}}
  432. }|-...-|}
  433. }|.....|}
  434. }|-...-|}
  435. }}|-.-|}}
  436. }}}|-|}}}
  437. }}}}}}}}}
  438. ENDMAP
  439. MONSTER: '@', "Wizard of Yendor", (4,4)
  440. OBJECT: '"', "Amulet of Yendor", (4,4)
  441. # a hell hound flanking the Wiz on a random side
  442. RANDOM_PLACES: (4,3), (4,5), (3,4), (5,4)
  443. MONSTER: 'd', "hell hound", place[0]
  444. # a chest on another random side
  445. OBJECT: '(', "chest", place[1]
  446. # a random dragon somewhere
  447. MONSTER: 'D', random, random
  448. # a random trap in the EAST end
  449. TRAP: random, (6,4)
  450. # an electric eel below the SOUTH end
  451. MONSTER: ';', "electric eel", (4,8)
  452. # make the walls non-diggable
  453. NON_DIGGABLE: (0,0,8,8)
  454. TELEPORT_REGION: lev_region(0,0,79,20), (0,0,8,8)
  455. .fi
  456. .PP
  457. This example will produce a file named "fortress" that can be integrated into
  458. one of the numerous mazes of the game.
  459. .PP
  460. Note especially the final, TELEPORT_REGION specification.  This says
  461. that level teleports or other non-stairway arrivals on this level can
  462. land anywhere on the level except the area of the map.  This shows the
  463. use of the ``lev_region'' prefix allowed in certain region specifications.
  464. Normally, regions apply only to the most recent MAP specification, but
  465. when prefixed with ``lev_region'', one can refer to any area of the
  466. level, regardless of the placement of the current MAP in the level.
  467. .SH AUTHOR
  468. .PP
  469. Jean-Christophe Collet, David Cohrs.
  470. .SH "SEE ALSO"
  471. .PP
  472. dgn_comp(6), nethack(6)
  473. .SH BUGS
  474. .PP
  475. Probably infinite.
  476. Most importantly, still needs additional bounds checking.
  477.