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 shop, 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 bare room (see adjacent image). It generates doors and lanterns by itself, because this is specified in the default parameters for rooms in the dungeon.
{| class="wikitable"
| [[File:ShopBare.png|160px]]
|}
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 character 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. We see the top-left corner of the room <code>Pos = 0, 0;</code> 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"
| [[File:ShopPeople.png|160px]]
|}
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 can then populate our 3x7 item map with the types we specified, and using a full-stop to leave some spaces for the character types we placed in the character map for the shop.
{| class="wikitable"