Variants - Slash'em, SporkHack, UnNetHack, NetHack-de, ...
 
User: [Log In] [Create A New Profile]
Actions: [New Topic] [Print View] [RSS]
Search
Path: [NAO] [Forums] [Variants]
Topic:
SporkHack lev_comp (1 Post)
Started By:
Date:
November 09, 2009 07:42AM

SporkHack lev_comp
paxed - November 09, 2009 07:42AM
 
In this thread, I will document the changes to the SporkHack special level compiler with more depth and examples than the wiki article on SporkHack.

Differences to the vanilla des-file format:

* The basis for the lev_comp changes is my new level compiler -patch, but SporkHack does more.

* No more [tt]MAZE[/tt]; all special levels start with [tt]LEVEL:"filename"[/tt]. To mark a level mazelike, you add [tt]mazelevel[/tt] to the level [tt]FLAGS[/tt].

* New command [tt]RANDLINE[/tt] to create random river-like structures.
RANDLINE: random,random,'L',lit,20
RANDLINE: (0,10),(73,10),'P',lit,20,2
RANDLINE: <coord1>, <coord2>, <terrain>, <lit>, <roughness>[, <thickness>]

Long post is long. Click here to see the rest.
* New command [tt]TERRAIN[/tt] to explicitly set map character(s) in certain locations:
* * Single mapgrid:
TERRAIN: (51,7), '-', unlit
* * Vertical or horizontal line:
TERRAIN: (14,9), vertical, 2, '|', unlit
TERRAIN: (42,6), horizontal, 6, '.',unlit
TERRAIN: <coord>, <horiz_or_vert>, <distance>, <terrain>, <lit>
* * Rectangle:
TERRAIN: (7,12, 8,13), unfilled, '.',unlit
TERRAIN: (21,4, 22,5), filled, '.',unlit

* New command [tt]SPILL[/tt] to create random pool-like structures.
SPILL: (60,15), '}', west, 20, lit

* New command [tt]REPLACE_TERRAIN[/tt] to replace a percentage of one map character with another map character inside an area.
REPLACE_TERRAIN: (00,00,25,19), ' ', 'P', unlit, 10%

* New command [tt]EXIT[/tt] to exit the level creation script immediately.

* New command [tt]GRAVE[/tt] to put down a grave:
GRAVE: (4,10), "Paxed wuz hear"
GRAVE: (5,5), random
GRAVE: (7,7)

* Level initialization has three different modes:
[tt]solidfill[/tt] fills the whole level with the specified map character. can also take an optional light-state flag.
[tt]mazegrid[/tt] fills the whole level with a grid of solid wall characters and the specified map character, so you can use MAZEWALK on it.
[tt]mines[/tt] this is equivalent to the vanilla INIT_MAP, and takes the same parameters.

INIT_MAP: solidfill, 'T'
INIT_MAP: solidfill, '.', lit
INIT_MAP: mazegrid, '.'
INIT_MAP: mines, ...

* Map [tt]GEOMETRY[/tt] also accepts an absolute coordinate, for example
GEOMETRY: (45,10)

* [tt]MAZEWALK[/tt] can take two optional parameters, a boolean that tells whether the maze should get stocked with standard maze items and monsters, and a map character that is used as the floor of the maze.
MAZEWALK:(30,10),west,false,'L'.

* New level flags:
[tt]shroud[/tt] causes hero not to remember the map outside his field of vision.
[tt]mazelike[/tt] used in place of the old-style [tt]MAZE[/tt] -level declaration.
[tt]stormy[/tt] clouds on the map to emit lightning and thunder, a la Plane of Air.
[tt]graveyard[/tt] causes wraiths to leave corpses much less, etc.


* In [tt]MAP ... ENDMAP[/tt], the character '[tt]x[/tt]' is "transparent" map character. When the [tt]MAP[/tt]-part is put down on the position defined by [tt]GEOMETRY[/tt], the positions with the '[tt]x[/tt]' are not touched.

* [tt]CONTAINER[/tt] contents are defined inside curly brackets, and allow recursive CONTAINERs:
 CONTAINER:'(', "sack", (10,10) {
   OBJECT:'+',random
   CONTAINER:'(', "sack" {
     OBJECT:'"', random
   }
 }

* [tt]WALLIFY[/tt] can take an optional region to wallify:
WALLIFY:levregion(1,1,70,20)

* [tt]OBJECT[/tt] (and [tt]CONTAINER[/tt]) has several new optional parameters:
[tt]quantity:X[/tt] where X is the number of items in this stack.
[tt]eroded:X[/tt] where X is -1 for erosionproof, or 1-15 for erosion levels.
[tt]locked[/tt] container is locked.
[tt]broken[/tt] container lock is broken. "locked" overrides this.
[tt]trapped[/tt] container is trapped.
[tt]recharged:X[/tt]number of times the item has been recharged.
[tt]invisible[/tt] item is invisible. only if INVISIBLE_OBJECTS.
[tt]greased[/tt] item is greased.

CONTAINER:'(',"chest",random,broken,trapped,eroded:15,greased,invisible {
  OBJECT:'[',"splint mail",eroded:-1,greased
  OBJECT:'/',random,recharged:2
}

* [tt]MONSTER[/tt] has several new optional parameters:
[tt]female[/tt] monster is female.
[tt]invisible[/tt] monster is invisible.
[tt]cancelled[/tt] monster has been cancelled.
[tt]revived[/tt] monster has been revived. most useful for dragons or unicorns.
[tt]avenge[/tt] monster can be hit without repercussions.
[tt]fleeing:X[/tt] monster is scared for X turns (0-127)
[tt]blinded:X[/tt] monster is blinded for X turns (0-127)
[tt]paralyzed:X[/tt] monster is paralyzed for X turns (0-127)
[tt]stunned[/tt] monster is stunned
[tt]confused[/tt] monster is confused
[tt]seen_traps:X[/tt] monster has seen the following traps. X can either be "all", or a pipe-delimited list of trap names.

MONSTER:'T',random,random,female,fleeing:100
MONSTER:'n',random,random,cancelled,invisible
MONSTER:'u',"white unicorn",random,revived,paralyzed:25
MONSTER:':',"newt",random,seen_traps:all,avenge
MONSTER:'G',random,random,seen_traps:"rolling boulder"

* IF-statements:
IF [50%] {
  MONSTER:'T', random, random
} ELSE {
  MONSTER:'L', random, random
}

* Looping:
LOOP [50] { 
  OBJECT:'?',random,random
}

* Switch-statements:
SWITCH [3] {
   CASE 0:
     ...
     BREAK
   CASE 1:
     ...
     BREAK
   CASE 2:
     ...
     BREAK
   DEFAULT:
     ...
}

* It's possible to define what items monster gets:
MONSTER:'V',"Vlad the Impaler",(06,05) {
   OBJECT:'(',"Candelabrum of Invocation"
}

* It's possible to override normal random monster generation chances; quest levels use this method:
MON_GENERATION:86%, (80,'S'), (16,"human mummy"), (4,'M')
* * The percentage is the chances of how often the normal monster generation is overridden.
* * You can define as many chance-monster tuples as you want, and the order in which the tuples are defined does not matter.
* * Single character in single quotes is a monster class, a monster name is double quotes is one particular monster type.
* * Chances are relative to each other, so [tt](5, 'S'), (10, 'M)[/tt] is the same as [tt](1, 'S'), (2, 'M)[/tt]


* Subroutines, aka FUNCTIONs:
FUNCTION mktrolls()
{
   LOOP [10] {
     MONSTER:'T',random,random
   }
}

mktrolls()
mktrolls()

* Level-specific sounds:
SOUNDS:500, (hear, "a slithering sound."),
             (feel, "a breeze."),
             (verbal, "You shall both win and lose!"),
             (pline, "You smell rotten eggs.")
* * The first number is the frequency how often one of the messages is shown. Each turn there is 1/X chance that one of the messages, selected at random, is shown. (X is 500 in this example)
* * You can define as many sounds as you wish.
* * hear means the message will be prefixed with "You hear "
* * feel means the message will be prefixed with "You feel "
* * verbal means the message will be shown as if someone spoke it
* * pline is the standard output, like how most messages in NetHack are shown.

* [tt]RANDOM_CORRIDORS[/tt] can take an optional parameter, which tells what algorithm to use to generate the corridors:
[tt]0[/tt] Vanilla NetHack style corridors
[tt]1[/tt] Each room has at least one corridor that goes to random room ("spiky")
[tt]2[/tt] Circular path: room1 -> room2 -> room3 -> ... -> room1
[tt]3[/tt] All corridors start from the first room ("hub")
[tt]random[/tt] Selects one of the algorithms at random.

Leaving the parameter out will generate NetHack style corridors.
RANDOM_CORRIDORS:3


-- 
You( "are momentarily disoriented." );



Edited 6 time(s). Last edit at 11/24/2009 07:27PM by paxed.
 

Go to Topic: [Previous] [Next]