The Cathedral of Attnam

Changes

Jump to navigation Jump to search
2,161 bytes added ,  10:21, 8 May 2016
=== Gloomy Caves Shop ===
As The shop in the gloomy caves is a good example of how to manually lay out a specific room in the script. The shop is declared as a simple room. The size is set to 5 tiles wide by 9 tiles high. Because it is a startshop, let's have and Mellis is the god of trade and politics, the divine master is set to Mellis. No altars, fountains, locked doors or booby trapped doors will generate here. This will generate a look at what bare room (see adjacent image). It generates doors and lanterns by itself, and this is going on with specified in the default parameters for rooms in the Gloomy Caves Shopdungeon.
{| class="wikitable"
! Script
! Result
|-
|
<tt>Room
AllowBoobyTrappedDoors = false;</tt>
| [[File:ShopBare.png]]
|}
 
Next we can fill the room with characters. We can place each character in a precise way, by writing a little ascii map showing where everyone will go. The map - a character map - has a size, a position relative to the room's origin (the top-left corner is <code>x = 0; y = 0;</code>), and a key showing all the types to be found on the character map. The character map can be thought of as a little sub-map belonging to the room. We need to show where the character map is positioned relative to the room it is in. To this end, the top-left corner of the room (Pos = 0, 0;) is occupied by a wall. We want to have a map that covers the floor area. The total floor area available in the shop is 3 tiles wide by 7 tiles tall, so this will be the size of or character map. The top-left tile in the character map will be the top-left tile in the room's available floor space. Therefore we will position the character map at <code>Pos = 1, 1;</code>, relative to the co-ordinates of the room's total space.
We need a shop keeper, and some strong guards to protect the fine wares. Therefore we will add the types <code>g</code> for a <code>guard</code> character with the config <code>SHOP</code>, and <code>s</code> for a <code>shopkeeper</code> with the config <code>ELPURI_CAVE</code>. We'll put them both on the same team, and we'll make the shopkeeper the room's master, which is relevant to the room type being a shop. So when the player character wishes to make a trade in the shop, the person he will deal with is the shopkeeper.
We then lay the types out in a 3x7 ascii map. White spaces are ignored, full-stops represent no character, and g and s represent the guard and the shop keeper. We can place the guard in the shop many times over, and we will place one of them in each corner. We probably only want one shop keeper, and so he is placed in the middle of the map.
 
{| class="wikitable"
! Script
! Result
|-
|
}</tt>
| [[File:ShopPeople.png]]
|}
 
We need to put items in the room so the shopkeeper has something to sell. We can do this in the same way as with the character map, only this time with an item map. The item map will have the same footprint as the character map, so this will be the same as before.
We want to fill the remaining available spaces in the room with random items of varying categories and worth. In the script, random items are created, but within the given parameters of minimum and maximum prices, and item category flags. This gives a good balance between high and low value items, preventing the game from creating a room full of broken leather boots, or for that matter, a room full of magic lamps! If we want we can generate specific items, and so by looking at this script you will see a wand of striking will generate in every shop, for every game of IVAN. This is an example of a so-called "guaranteed item", and is a design element I hope you will choose to use sparingly.
 
{| class="wikitable"
! Script
! Result
|-
|
| [[File:ShopItems.png]]
|}
 
<tt>Room
{
Size = 5,9;
AltarPossible = false;
DivineMaster = MELLIS;
Type = ROOM_SHOP;
GenerateFountains = false;
AllowLockedDoors = false;
AllowBoobyTrappedDoors = false;</tt>
 
<tt>CharacterMap
{
Pos = 1, 1;
Size = 3, 7;
Types
{
g = guard(SHOP) { Team = 5; }
s = shopkeeper(ELPURI_CAVE) { Team = 5; Flags = IS_MASTER; }
}
}
{
g.g
...
...
.s.
...
...
g.g
}</tt>
 
<tt>ItemMap
{
Pos = 1,1;
Size = 3,7;
Types
{
g == Random { MinPrice = 100; MaxPrice = 10000; Category = GAUNTLET|BOOT; }
b == Random { MinPrice = 100; MaxPrice = 10000; Category = GAUNTLET|BOOT; }
a == Random { MinPrice = 500; MaxPrice = 10000; Category = HELMET|CLOAK|BODY_ARMOR|BELT; }
d == Random { MinPrice = 200; MaxPrice = 10000; Category = RING|AMULET; }
w == Random { MinPrice = 500; MaxPrice = 10000; Category = WEAPON|SHIELD; }
e == Random { MinPrice = 50; MaxPrice = 10000; Category = FOOD|POTION; }
u == Random { MinPrice = 200; MaxPrice = 10000; Category = WAND|TOOL; }
r == Random { MinPrice = 200; MaxPrice = 10000; Category = SCROLL|BOOK; }
s == wand(WAND_OF_STRIKING);
}
}
{
.g.
ddb
err
e.w
auw
auw
.s.
}</tt>
== Dungeon default control variables ==
158

edits

Navigation menu