Adding special levels
By CosmicGerbil
What is a special level?
A special level is a level that appears in a dungeon only once. If you leave the special level, then it is gone forever. The special level is designed like a quest level, and usually has extra tough monsters and an artifact to find.
The special level files are kept in the edit folder and have names such as s-crypt.map. The easiest way to make your own special level is to copy one of the these files and paste it in the edit folder. Then you can edit the copy and design a new level.
Copy s_crypt,map and open it up. You will see that it comes in two parts: the part telling you what monsters and artifact will appear on the level, and the actual map. The top part will look like this:
# Special level "The Forgotten Crypt" in The Pits of Angband # # Created for PernAngband 5.0.1 on 18/8/01 # Written by Mynstral (mynstral@thehelm.com) %:special.txt ### Guaranteed Monsters # Vampire on normal floor F:a:1:0:432
There are 9 more monsters after this, but you only need to look at one to get the idea.
All lines that start with the "#" symbol are comment lines, and will be ignored by the computer. The top 4 lines simply tell you the name of the special level and who designed it.
The line %:special.txt is important and *must* be included in every special level.
The line F:a:1:0:432 is the one that controlls what monsters will appear in the level. The a is the symbol that is used on the map to represent the monster. I will explain more about this in the map section. I don't know what the second or third numbers mena, but I don't think you need to worry about them. The number 432 is the vampires index number in the r_info (monster) file. Using a different number would generate a different monster, for example number 46 would generate a novice mage.
There are ten monsters chosen like this for the crypt level, however when designing your own special level, you can have as few or as many monsters as you want.
### Random Monsters and/or Items # Random monster (upto 5 levels ood) on normal floor F:&:1:0:*75 # Random monster (upto 11 levels ood) on normal floor F:@:1:0:*81 # Random monster (upto 9 levels ood) and # Random object (upto 7 levels ood) on normal floor F:8:1:0:*79:*77
These are examples of random monsters and objects that can appear on the special level. I am not sure how these lines work, if anybody can help me here, I'd be very grateful
### Guaranteed Items # The Shadow Cloak of Luthien on normal floor F:1:1:0:0:0:0:49
This line makes the artifact appear. The first number 1 is the symbol that will be used on the map to represent the aftifact. I don't know what the other 1 or the 0s mean, but I don't think you need to worry about them. The 49 is the number of the artifact in the a_info (artifacts) file. You can choose any artifact you want to appear here. For example, changing the number 49 to 126 will make the light crossbow 'Cubragol' appear instead.
To add an artifact, first make sure the aftifact you have chosen has not already got the SPECIAL_GENE flag. This flag means that such an artifact has already been chosen to appear in a special level or perhaps a quest. However using Cubragol as an example, you want to give it the SPECAIL_GENE flag now, to make sure it only appears on the new special level, and doesn't turn up anywhere else in the game.
Open the a_info file and find Cubragol.
# The Light Crossbow 'Cubragol' N:126:'Cubragol' I:19:23:10 W:50:25:110:50000 P:0:0d0:10:14:0 F:SPEED | HIDE_TYPE | F:RES_FIRE | ACTIVATE | SHOW_MODS a:HARDCORE=CUBRAGOL D:A crossbow that grants fiery speed to he who finds it, and from which D:shoot bolts that blaze with flame unquenchable.
After the flag HIDE_TYPE | add on SPECIAL_GENE. You can put this flag anywhere in the F: lines. Just make sure it has a | symbol in front and after it. This symbol is needed after every flag except the last one in the list, so if you added SPECIAL_GENE after SHOW_MODS, you would not need the | symbol after it.
### Starting location P:17:29
Finally this shows where the player will appear on the map. The number 17 means 17 spaces down and the 29 means 29 spaces across (I think).
The Map
The map lines must always start with D: You can have as few or as many D lines as you want, depending on how big you want to do a special level. Don't forget the colon
The actual symbols on the map and what each one means can be found in the special file in the edit folder. An example is:
# Permanent Wall F:X:63:0 F: :63:0
The X is the letter you must draw on the special level map to make a square of permanent wall appear. The number 63 is the index number for permanent wall in the f_info (features) file. I don't know what the 0 does, but I don't think it is used.
You can use any method of redrawing the map, such as planning your map first on paper, deleting the whole map on the file and starting drawing from scratch, or deleting and redrawing part of the map at a time. I usually use the last method, but use whatever works best for you
The other symbols (lower case letters and numbers) are the monsters and artifacts you add in. So on this crypt map, anywhere there is an a, a vampire will appear in the game. The location of the Shadow Cloak of Luthien (or Cubragol, as it now is) on the map is shown by the number 1.
When you have finished editing a special level, you need to make it appear in the chosen dungeon. Rename the copied file (I'll use s_dungeon.map as an example). Leave the edit folder and go into the dngn folder, where you will see all the files that put special levels into their chosen dungeons. You will notice that they all have names like dun3.3, dun1.14 and so on.
The first number refers to the number of the dungeon in the d_info (dungeon) file in the edit folder. So dungeon number 3 is Angband. The second number refers to the depth in the dungeon that the special level appears. However the the level count starts at zero, not one. So the second 3 means that this special level will appear on the fourth level down in Angband.
Open the file called dun3.3 (this is the file for the special crypt level). You will see:
N:Crypt U:s_crypt.map D:Looks like a forgotten crypt... F:DESC | NO_GENO | NO_NEW_MONSTER | SPECIAL | NO_STAIR F:ASK_LEAVE | NO_TELEPORT
N:Crypt
This line is the name of the special level that will appear in the right hand corner of the screen when you are playing the game.
U:s_crypt.map
This tells the game which special level map to load.
D:Looks like a forgotten crypt...
This is the description of the special level that will appear on screen when you first enter the level.
F:DESC | NO_GENO | NO_NEW_MONSTER | SPECIAL | NO_STAIR F:ASK_LEAVE | NO_TELEPORT
These are the flags that the special level will have.
DESC describes the dungeon with the information written in the line "D:Looks like a forgotten crypt..."
NO_GENO means you cannot genocide any of the monsters.
NO_NEW_MONSTER means that only the monsters you have put in the special level file can appear.
SPECIAL obviously means it's a special level
NO_STAIR I am not sure what this means as there are stairs going both up and down on special levels.
ASK_LEAVE If you go to leave a special level, you will be asked if you wish to leave. Because if you leave, then the special level is gone and when you go down or up the same staircase again, it will be a normal level.
NO_TELEPORT means that you cannot teleport on specail levels.
To put in the copied and renamed file, copy the dun3.3 file, paste it and rename it to:
dun4.1
The number 4 is the Barrow Downs dungeon and the number 1 means that the new special level will appear on level 2 of the Barrow Downs. I have put it to appear very early in the game, because this makes it easy to test
Open it, and add the following:
N:Dungeon U:s_dungeon.map D:Looks like a forgotten dungeon... F:DESC | NO_GENO | NO_NEW_MONSTER | SPECIAL | NO_STAIR F:ASK_LEAVE | NO_TELEPORT
Now when you play T.o.M.E, go to level 2 of the Barrow Downs and there should be a new special level.
ToME Wiki