Difference between revisions of "Manual:Zone Manual/The Room Section"

From DikuMUD Wiki
Jump to navigation Jump to search
(checked against the current code (wiki review 2026-11-15))
 
Line 1: Line 1:
 
== The room section ==
 
== The room section ==
  
−
The previous chapter gave you the basic building blocks that
+
Rooms are the places of your zone: where players stand, what they see and which ways they can go. This chapter lists every field a room can have and what each one does in the game. It builds on [[Manual:Zone_Manual/Unit_Building_Blocks|Unit Building Blocks]], which explains the field types (symbols, strings, string lists, flags, numbers); read that first if you haven't.
−
will be used all through creating rooms, NPCs, and objects. If you
+
 
−
jumped straight to this chapter without reading about the general
+
Rooms go in the <code>%rooms</code> section of the zone file. Each room is a symbol, its fields in any order, and <code>end</code>:
−
building blocks you might want to return to (Link to ch-03)
+
 
−
first. This chapter will deal with all the fields
+
<pre>
−
of rooms what they are and how to use them but with out the previous
+
%rooms
−
chapter you may get lost.
+
 
 +
chamber
 +
title "The middle chamber of the station"
 +
descr
 +
"This chamber seems to have the entire station rotating around it."
 +
movement SECT_INSIDE
 +
east to hallway descr "You see a hallway.";
 +
end
 +
</pre>
  
−
In order to get started building rooms you should first be aware
 
−
of the room fields you can use.  The (Link to rmfields) shows a full listing
 
−
of all the room fields and their types as defined in (Link to ch-03).
 
 
{| class="wikitable"
 
{| class="wikitable"
−
|+Room fields and types listing
+
|+Room fields
 
|-
 
|-
 
!Field
 
!Field
 
!Type
 
!Type
−
!Field
+
!What it does
−
!Type
 
 
|-
 
|-
−
|symbolic name
+
|''symbol''
 
|Symbol
 
|Symbol
−
|manipulate
+
|The room's name in the zone, used by exits, <code>goto</code>, <code>wstat</code> and DIL
−
|Integer
 
 
|-
 
|-
−
|names
+
|<code>title</code>
−
|Stringlist
+
|String
−
|alignment
+
|The room's name, shown as the first line when you look
−
|Integer
 
 
|-
 
|-
−
|title
+
|<code>names</code>
 +
|String list
 +
|Names for <code>goto</code>, and what <code>enter</code> matches for a room inside a room
 +
|-
 +
|<code>descr</code>
 
|String
 
|String
−
|flags
+
|What <code>look</code> shows
−
|Integer
 
 
|-
 
|-
−
|descr
+
|<code>outside_descr</code>
 
|String
 
|String
−
|weight
+
|What the outer room shows of a room inside it
−
|Integer
 
 
|-
 
|-
−
|outside_descr
+
|<code>extra</code>
−
|String
+
|Names and string
−
|capacity
+
|Things to look at, and hidden data for DIL
−
|Integer
+
|-
 +
|<code>movement</code>
 +
|Constant
 +
|The terrain: endurance cost, swimming, boats
 
|-
 
|-
−
|extra
+
|<code>flags</code>
−
|Structure
+
|Flags
−
|light
+
|<code>UNIT_FL_*</code> flags: indoors, no weather, no teleport...
−
|Integer
 
 
|-
 
|-
−
|minv
+
|<code>light</code>
−
|Integer
+
|Number
−
|exit
+
|Light in the room
−
|Structure
 
 
|-
 
|-
−
|key
+
|''direction''
−
|string
+
|Exit
−
|movement
+
|An exit: <code>north</code>...<code>southwest</code>, <code>up</code>, <code>down</code>
−
|Integer
 
 
|-
 
|-
−
|spell
+
|<code>in</code>
−
|Integer
 
−
|end
 
 
|Symbol
 
|Symbol
 +
|Puts this room inside another room
 +
|-
 +
|<code>capacity</code>
 +
|Number
 +
|For a room inside a room: how much weight can enter it
 +
|-
 +
|<code>spell</code>
 +
|Number
 +
|Magic resistance of the room
 
|-
 
|-
−
|dilbegin or dilcopy
+
|<code>gmap</code>
−
|Function pointer
+
|Two numbers
−
|
+
|Map coordinates
−
|
+
|-
 +
|<code>minv</code>
 +
|Number
 +
|Wizard invisibility level
 +
|-
 +
|<code>romflags</code>
 +
|Flags
 +
|Room flags; only DIL reads them
 +
|-
 +
|<code>dilcopy</code>, <code>dilbegin</code>
 +
|DIL
 +
|Scripts that run on the room
 
|}
 
|}
−
As you can see there is not a whole lot of fields you have to
+
 
−
learn in order to make a room. In fact as you will see shortly some of
+
Other unit fields (<code>alignment</code>, <code>weight</code>, <code>manipulate</code>, <code>key</code>, <code>open</code>) are accepted on a room but do nothing for an ordinary room. In a room inside another room, <code>open {EX_CLOSED}</code> makes <code>enter</code> and <code>leave</code> refuse. vmc gives every room <code>MANIPULATE_ENTER</code> itself, so that rooms inside rooms can be entered and left.
−
these fields are not even used on rooms. In (Link to rmfielddescr) we will expand your knowledge from just knowing what the
+
 
−
field types are to how to set them as well.
 
 
=== Description of room fields ===
 
=== Description of room fields ===
  
 +
==== The symbol ====
 +
The rules for symbols are in [[Manual:Zone_Manual/Unit_Building_Blocks|Unit Building Blocks]]: letters, digits and <code>_</code>, at most 15 characters. Rooms, objects and NPCs of a zone share one set of symbols. Pick a symbol that resembles the title. Gods move about with <code>goto chamber@dragonst</code>, and <code>wstat zone dragonst rooms</code> lists a zone's rooms by symbol only, so <code>chamber</code>, <code>portal_room</code> and <code>office</code> are far easier to work with than <code>st_rm1</code>, <code>st_rm2</code> and <code>st_rm3</code>.
 +
 +
==== title ====
 +
The room's name, the first line a player sees in the room. Start it with a capital. Punctuation at the end is up to you.
 +
<pre>
 +
title "The Post Office"
 +
title "The deep dark jungle floor"
 +
title "The Dragon Station control room"
 +
</pre>
 +
 +
==== names ====
 +
A room doesn't need names. They are used in two places:
 +
* <code>goto</code> finds a room by name as well as by symbol.
 +
* A room placed inside another room (see <code>in</code> below) is entered with <code>enter</code> and one of its names.
 +
<pre>
 +
title "The Post Office"
 +
names {"post office", "office"}
 +
</pre>
 +
As with all name lists, no name may start with an earlier one: write <code>{"post office", "post"}</code>, never <code>{"post", "post office"}</code>. vmc stops with "Name order error" otherwise.
 +
 +
==== descr ====
 +
What a player sees on entering the room or typing <code>look</code>. vmc puts three spaces in front of a room's description, so don't indent the first line yourself. Line breaks are shown as you write them; the game only wraps a line that is too long. Keep each line under about 72 characters, as the zones in the repository do.
 +
 +
A string can't contain a double quote, not even as <code>\"</code>. Use single quotes in the text.
 +
 +
==== outside_descr ====
 +
For a room inside another room: the line the outer room shows for it, as an object's description is shown. Without it the inner room isn't listed at all, and you describe it in the outer room's <code>descr</code> or an <code>extra</code> instead.
 +
<pre>
 +
outside_descr "A big old barrel is lying here on its side."
 +
</pre>
 +
This lets a room look like an object inside another room.
 +
 +
==== extra ====
 +
Extras are descriptions of things in the room that players can <code>look at</code>. Say you have a computer room:
 +
<pre>
 +
descr
 +
"This small room houses the computer power of the development team. All
 +
four walls are lined with computer equipment, old pizza boxes and plenty
 +
of empty soda cans."
 +
</pre>
 +
A player will want to look at the cans, the boxes and the equipment. Add an extra for each:
 +
<pre>
 +
extra {"soda cans", "cans", "soda", "can"}
 +
"These cans are all from the same brand. Strange: all of them seem to
 +
have indentations."
 +
 +
extra {"strange indentations", "indentations", "indentation"}
 +
"They are human bite marks. Is this what happens when code doesn't work?"
 +
 +
extra {"pizza boxes", "pizza", "boxes", "box"}
 +
"Someone could make a fortune from all these boxes. They are all empty;
 +
at least the team finishes what it starts."
 +
 +
extra {"computer equipment", "equipment", "hardware", "computer"}
 +
"All you see is an old XT."
 +
 +
extra {"xt"}
 +
"It's a hunk of junk really!"
 +
</pre>
 +
Two things to notice:
 +
* Within one list, no name may start with an earlier one, as for <code>names</code>; the extras themselves can come in any order.
 +
* One extra describes something that leads to another (the cans lead to the indentations, the equipment to the XT). Players who read carefully find more, which is a good place to hide hints for a quest.
  
−
;symbolic name
+
Extras whose first name starts with <code>$</code> are not shown to players. DIL scripts use them to store data on a unit, and some have a meaning in the game. An extra can also carry a list of numbers after its names, for DIL:
−
: The rules of the symbols has been explained in (Link to ch-03), if you didn't read them yet you may want to review.
+
<pre>
−
The important thing to realize with the room symbol is it is always
+
extra {"$rockcount"}
−
good practice to give the room a symbol resembling the title so
+
"5"
−
administrators and builders can use the
+
 
−
'''goto''' and the '''wstat''' to easily
+
extra {"$coke", "$milk", "$water"} {1, 5, 10}
−
goto the room in question.
+
"Drinks and amounts"
−
;title
+
</pre>
−
: The room title field should start with a capital and depending on your preference the compiler will not complain if you add punctuation at the end. The following are good examples of a room title.
+
 
−
<nowiki>
+
Special extras on rooms:
−
title "The Post Office"
+
* <code>extra {"$get", "statues", "statue"} "..."</code>: when a player types <code>get statue</code>, the text is shown instead of "nothing here", so the room can mention things that can't be taken without making objects for them.
−
title "The deep dark jungle floor:"
+
* <code>extra {"$exit_descr"} "..."</code>: what a player in a neighbouring room sees on <code>look &lt;direction&gt;</code> towards this room, when that exit has no <code>descr</code> of its own.
−
title "The Dragon Station control room"</nowiki>
+
<pre>
−
It is really up to you weather you want to use punctuation or not, it
+
extra {"$get", "statues", "statue"}
−
is more administrator personal opinion than anything.
+
"You try to pick up a statue, but quickly discover that your feeble
−
;names
+
attempts will never work."
−
: The names field on the rooms are not that important and only should be used if the builder wishes the room to be accessed by the players by a teleport command. If the room has no names no one will be able to teleport to it. On some muds there will be no teleport spell so the only use for this field will be for DIL functions the administrator creates. If a builder wants the room to be accessible by teleport then the names should match the title since that is what the player will try to teleport to. A few good examples of names on a room would look as follows.
+
 
−
<nowiki>
+
extra {"$get", "red roses", "roses"}
−
title "The Post Office"
+
"You bend down to pick a rose, but then decide to leave the beautiful
−
Names {"post office","office"}
+
flower to itself."
 +
</pre>
 +
 
 +
==== movement ====
 +
The terrain of the room, one of the <code>SECT_</code> constants in <code>vme/include/vme.h</code>. It must be a plain constant: <code>movement SECT_FIELD+1</code> is a syntax error. The default is <code>SECT_CITY</code>.
 +
<pre>
 +
movement SECT_FOREST
 +
</pre>
 +
A step from one room to another costs the average of the two rooms' endurance costs below (rounded down). The costs come from <code>g_movement_loss</code> in <code>vme/src/constants.cpp</code>; carrying more than you can also costs extra.
  
−
title "the thrown room"
 
−
names {"thrown room","thrown"}</nowiki>
 
−
;descr
 
−
: The description field is what the player sees when walking into the room or when looking with no arguments.
 
−
;outside_descr
 
−
: This field is what is shown to a char if the room is loaded inside another room.  For example if you had a room linked inside another room and called a barrel this would be the description that lets the character know it is a barrel.  An example would be like:
 
−
<nowiki>
 
−
outside_descr "a big old barrel is laying here on its side."</nowiki>
 
−
This allows a builder to make a room that looks like an object
 
−
inside another room.
 
−
;movement
 
−
: The movement field defines the endurance cost to a character when moving through this room.  In the future these fields will be adjustable by the use of a define file.  Currently all movement fields are constants and are defined in the
 
−
''vme.h''  The following is the movement sector types and their values.
 
 
{| class="wikitable"
 
{| class="wikitable"
−
|+Sector movement values
+
|+Sector types
 
|-
 
|-
 
!Symbol
 
!Symbol
−
!Name
+
!Endurance
−
!Endurance Cost
+
!Notes
 
|-
 
|-
 
|SECT_INSIDE
 
|SECT_INSIDE
−
|inside
 
 
|1
 
|1
 +
|
 
|-
 
|-
 
|SECT_CITY
 
|SECT_CITY
−
|city
 
 
|1
 
|1
 +
|The default
 
|-
 
|-
 
|SECT_FIELD
 
|SECT_FIELD
−
|field
 
 
|2
 
|2
 +
|
 
|-
 
|-
 
|SECT_FOREST
 
|SECT_FOREST
−
|forest
 
 
|3
 
|3
 +
|
 
|-
 
|-
 
|SECT_HILLS
 
|SECT_HILLS
−
|hills
 
 
|4
 
|4
 +
|
 
|-
 
|-
 
|SECT_MOUNTAIN
 
|SECT_MOUNTAIN
−
|mountain
 
 
|6
 
|6
 +
|
 
|-
 
|-
 
|SECT_DESERT
 
|SECT_DESERT
−
|desert
 
 
|8
 
|8
 +
|
 
|-
 
|-
 
|SECT_SWAMP
 
|SECT_SWAMP
−
|swamp
 
 
|8
 
|8
 +
|
 
|-
 
|-
 
|SECT_WATER_SWIM
 
|SECT_WATER_SWIM
−
|water-swim
+
|20
−
|4
+
|Moving into or out of it needs swimming turned on (the <code>swim</code> command) and a swimming skill check against the exit's <code>difficulty</code>
 
|-
 
|-
 
|SECT_WATER_SAIL
 
|SECT_WATER_SAIL
−
|water-sail
+
|20
−
|50
+
|Deep water: only in a boat; leaving it for land means swimming, 150 harder
 
|-
 
|-
 
|SECT_UNDER_WATER
 
|SECT_UNDER_WATER
−
|under-water
+
|20
−
|8
+
|
 
|-
 
|-
 
|SECT_SNOW
 
|SECT_SNOW
−
|snow
 
 
|8
 
|8
 +
|
 
|-
 
|-
 
|SECT_SLUSH
 
|SECT_SLUSH
−
|slush
+
|8
−
|6
+
|Wet snow
 
|-
 
|-
 
|SECT_ICE
 
|SECT_ICE
−
|ice
 
 
|10
 
|10
 +
|
 
|}
 
|}
−
The movement is simply defined by placing the 'movement' keyword first
+
The terrain is also read by some skills (tracking, hunting and laying traps in <code>skills.zon</code>) and is a field DIL can read ([[Manual:DIL Manual/movement|movement]]). It doesn't make a room dark or keep the weather out; use <code>flags</code> for that.
−
followed by the type of sector you desire. For example a few
+
 
−
movement fields would look as follows:
+
==== flags ====
−
<nowiki>
+
Unit flags, the <code>UNIT_FL_</code> constants of <code>vme/include/vme.h</code>. Only <code>UNIT_FL_*</code> belongs here.
−
movement SECT_FOREST
+
<pre>
−
movement SECT_HILLS</nowiki>
+
flags {UNIT_FL_NO_WEATHER, UNIT_FL_INDOORS}
−
<blockquote style="background-color: #E8E8E8; font-style: italic; ">Only one movement is needed for a room if you put more than one the last one added will be the one used.</blockquote>
+
</pre>
−
;flags
 
−
: This field on a room is used to set special attributes in order to make the room private or no-teleportable and many others.  The following is the list of possible already defined flags.  Extras can also be used to create special room flags.
 
 
{| class="wikitable"
 
{| class="wikitable"
−
|+Room unit flag affects
+
|+Unit flags on rooms
 
|-
 
|-
 
!Flag
 
!Flag
−
!Description
+
!In a room
 
|-
 
|-
−
|UNIT_FL_PRIVATE
+
|UNIT_FL_INDOORS
−
|When this flag is set on a room it marks it as a private room.  Commands
+
|The room has walls and a ceiling: daylight doesn't reach it (see <code>light</code>), players in it get no weather messages, and weather spells don't work in it
−
that honor the private flag will not let more than 2 players into this room.
 
−
Commands like '''goto''' and direction commands are a few
 
−
commands that do honor this flag.
 
 
|-
 
|-
−
|UNIT_FL_INVISIBLE
+
|UNIT_FL_NO_WEATHER
−
|Makes unit invisible
+
|Players in the room get no weather messages, and weather spells don't work in it
−
|-
 
−
|UNIT_FL_NO_BURY
 
−
|Makes a hard floor so items can't be buried.
 
−
|-
 
−
|UNIT_FL_BURIED
 
−
|Makes unit buried when loaded
 
 
|-
 
|-
 
|UNIT_FL_NO_TELEPORT
 
|UNIT_FL_NO_TELEPORT
−
|makes unit so no one can teleport to it
+
|The teleport and summon spells refuse to take anyone into or out of the room. It is four flags in one: UNIT_FL_NO_TEL, UNIT_FL_NO_TEL_TO, UNIT_FL_NO_SUM and UNIT_FL_NO_SUM_FROM
 
|-
 
|-
 
|UNIT_FL_NO_MOB
 
|UNIT_FL_NO_MOB
−
|Makes it so no mobile will enter the unit
+
|NPCs that wander with <code>wander_zones@function</code> or <code>global_wander@function</code> don't walk into the room. Nothing else stops NPCs
 
|-
 
|-
−
|UNIT_FL_NO_WEATHER
+
|UNIT_FL_PRIVATE
−
|keeps weather and natural light out of unit
+
|<code>goto</code> refuses when two or more players are in the room already
 +
|-
 +
|UNIT_FL_SACRED
 +
|Everyone in the room regains hit points, mana and endurance at double rate
 
|-
 
|-
−
|UNIT_FL_INDOORS
+
|UNIT_FL_NOSAVE
−
|Makes unit inside and doesn't affect weather
+
|A player who quits or loses the connection in the room isn't put back in it on logging in again (for treasure rooms, traps and the like)
 
|-
 
|-
 
|UNIT_FL_TRANS
 
|UNIT_FL_TRANS
−
|Makes unit transparent
+
|For a room inside a room: those inside also see the outer room and what is in it
 
|-
 
|-
−
|UNIT_FL_NO_SAVE
+
|UNIT_FL_NO_BURY
−
|Makes it so you can't save with unit
+
|Only the corpse-collecting NPC in Midgaard checks it; the <code>bury</code> command doesn't
−
|-
 
−
|UNIT_FL_SACRED
 
−
|Makes unit a double gain unit
 
 
|-
 
|-
−
|UNIT_FL_MAGIC
+
|UNIT_FL_INVISIBLE, UNIT_FL_BURIED, UNIT_FL_MAGIC
−
|Marks a unit to be magic
+
|Meant for objects and characters; no use on a room
 
|}
 
|}
−
;extra
 
−
: Extras are the work horse of the VME.  Extras are used in everything from DIL to just normal extra descriptions on rooms.  The first job for an extra was to hold extra description information on a room.  For example if you had a computer room and you described it might look something like this:
 
−
<nowiki>
 
−
descr
 
−
"This small room houses the computer power of the VME development team.
 
−
All four walls are lined with various pieces of computer equipment old pizza
 
−
boxes and plenty of empty soda cans."</nowiki>
 
−
The problem is as a player if you saw this description you might want to know what kind
 
−
of pizza we eat or maybe you would want to see what kind of soda we drink.  Or heaven forbid you might want to know
 
−
what kinds of computer equipment is scattered about the room.  In the VME servers we
 
−
do this by adding extra descriptions to the room.  In this case the builder of the zone
 
−
may do something like this:
 
−
<nowiki>
 
−
descr
 
−
"This small room houses the computer power of the VME development team.
 
−
All four walls are lined with various pieces of computer equipment old pizza
 
−
boxes and plenty of empty soda cans."
 
−
 
−
extra {"soda cans", "cans", "soda", "can"}
 
−
"These cans are all Canadian blue.  Maybe the Valhalla team hates American
 
−
beer.  Strange all of them look to have strange indentations."
 
−
 
−
extra {"strange indentations", "strange indentation","indentation"}
 
−
"They are human bite marks.  Is this what happens when code doesn't work right?"
 
−
 
−
extra {"pizza boxes","pizza","boxes","box"}
 
−
"Dominos could make a fortune from all these boxes and probably already have
 
−
from the VME team.  you notice all the boxes are empty at least they finish what
 
−
they start."
 
−
 
−
extra {"computer pieces","computer parts", "equipment","hardware", "pieces", "parts"}
 
−
"I bet you thought you would see what we have running.  Yeah right you might come
 
−
over and rob us if we told you that.  All you see is an old XT."
 
−
 
−
extra {"xt"}
 
−
"Its a hunk of junk really!"</nowiki>
 
−
There is a lot to notice in the previous examples.  First we will start with
 
−
extras when defined on rooms, NPC, and objects must be in length
 
−
order for the names.  There are a few reasons for this but lets just
 
−
say the most important reason is we wanted it this way.  If you
 
−
don't put them in order the VMC will give you a fatal error and
 
−
will not compile your zone.
 
−
 
−
The next thing you should notice is we have used an extra to
 
−
describe something in another extra.  We actually did this twice
 
−
once for the beer cans and once for the computer parts.  That way
 
−
you can actually give quest information but make the person really
 
−
have to explore your rooms descriptions to find it.
 
−
 
−
The previous example is what we consider normal extras in a
 
−
room.  There are also extras that hold information for DIL functions.  These
 
−
special extras can have extra fields and they can be hidden to the
 
−
players eyes.  Here are some
 
−
examples of special extras.
 
−
<nowiki>
 
−
extra {"$rockcount"}
 
−
"5"
 
−
 
−
extra {"$playerkill"}
 
−
"0"
 
−
 
−
extra {"$coke","$milk","$water"}{1,5,10}
 
−
"Drinks and amounts"</nowiki>
 
−
These extras all have the '$' sign appended to the front of
 
−
the names in order to tell the look command the player
 
−
shouldn't be able to look at the extra.  If you have not already seen
 
−
DIL coding you may not understand why you would want extras
 
−
players can't see.  The DIL language can manipulate these extras by
 
−
reading and writing them in order to change the way a command or
 
−
another function works.  For example the last DIL could be used for
 
−
a shopkeeper to tell how many of each type of drink he has.  Notice
 
−
the drink extra also has something you haven't seen yet, an added integer list after the namelist. all extras can have these but
 
−
only extras being used with DIL functions really need
 
−
them.
 
−
 
−
Some of these special functions are supported already in the code
 
−
and the ones that affect the rooms are as follows.  In the
 
−
following $1n is the activator and $2n is the unit in question.
 
−
 
−
There is only one special extra already supported for rooms and
 
−
that would be the '$get'.  As we have previously
 
−
mentioned the extras that start with a dollar sign are not seen by the
 
−
players.  This one however is shown to the player when the person
 
−
types get on the other names in the extras list.  This easier to
 
−
describe in an example than in words so the following would be a good
 
−
example.:
 
−
<nowiki>
 
−
extra {"$get", "statues", "statue"}
 
−
"You attempt to pick up a statue but quickly discover your feeble
 
−
attempts will never work."
 
−
 
−
{"$get", "red roses", "roses"}
 
−
"You bend down to pick a rose, but then decide to leave the beautiful
 
−
flower to itself."</nowiki>
 
−
With this one special extra we have made it so you don't need to
 
−
make millions of items so the person can act upon them.  You can
 
−
just make the acts as if the items were in the room.
 
−
;Exits
 
−
: Every room has ten possible exits; North, East, South, West, Northeast, Southeast, Southwest, Northwest, Up and Down. To enable mobile use of these commands, you must specify these exits as outlined below:
 
−
  exit &lt;direction&gt; [to &lt;destination&gt;] [open {&lt;infoflags&gt;}]
 
−
  [key &lt;keyname&gt;] [keyword {&lt;keywords&gt;}] descr &lt;description&gt; ;</nowiki>
 
−
;exit &lt;directions&gt;
 
−
: Is the direction the exit leads, ie. one of north, south .. up, down.
 
−
; to &lt;destinations&gt;
 
−
: The symbolic reference to the room, you want this exit to lead to. If you reference a room within another zone, post pend the name with @&lt;zone name&gt;
 
−
 
−
  to myotherroom
 
−
  to hisotherroom@hiszone</nowiki>
 
−
 
−
; open &lt;info flags&gt;
 
−
: These flags describe the state of the door.  The following is the list of possible door flags.
 
  
−
;EX_OPEN_CLOSE
+
==== light ====
−
: Set this if you can open and close this exit, be it a door, gate or otherwise.
+
The light in a room. A room is lit when its light is 0 or more, dark below 0. The total is the room's own <code>light</code>, plus the light sources people carry in, plus daylight: +1 by day, 0 at dawn and dusk, -1 at night. A room with <code>UNIT_FL_INDOORS</code> gets no daylight. The default is 0, so an outdoor room is dark at night and an indoor room is always lit.
−
;EX_CLOSED
 
−
: Set this if you want the exit to be closed at boot time.
 
−
;EX_LOCKED
 
−
: Set this if you want the exit to be clocked at boot time.
 
−
<blockquote style="background-color: #E8E8E8; font-style: italic; ">
 
−
An interesting aspect is, if you do not specify a key, you can
 
−
    only unlock this door with the 'pick' skill, 'unlock' spell or from
 
−
    DIL with UnSet();
 
−
</blockquote>
 
−
;EX_PICK_PROOF
 
−
: Using this flag renders the 'pick' skill and 'unlock' spell un useable on the lock of this exit.
 
−
;EX_HIDDEN
 
−
: If this bit is set, the exit is hidden until the mobile has successfully searched for it, using the 'search'-command.
 
−
;key &lt;keyname&gt;
 
−
: The symbolic name of a key object used for unlocking this exit.
 
−
  key mykey@myzone</nowiki>
 
−
;keyword { &lt;stringlist&gt; }
 
−
: This stringlist holds all the names of the exit, you specify to manipulate the exit. If the exit is hidden exit, these are the keywords the mobile can search for.
 
−
  keyword {"wooden door","door"}
 
−
  keyword {"hidden door","door","hatch","floor"}</nowiki>
 
−
;descr &lt;description&gt;
 
−
: This string is the description of what you see if you look in the direction of the exit.
 
−
;;
 
−
: Every exit statement needs to be terminated with a semi-colon.
 
  
−
<blockquote style="background-color: #E8E8E8; font-style: italic; ">
+
<code>vme/include/wmacros.h</code> has macros for the usual cases:
−
==== General notes ====
 
−
Even though you do not need an exit in all directions, you can use it to place
 
−
descriptions of the direction.
 
−
</blockquote>
 
−
<nowiki>
 
−
      exit north descr "An unsurmountable mountain blocks your way.";</nowiki>
 
−
;minv
 
−
: This field is rarely used on rooms. It could however be used to make a room invisible inside another room.  Or it could be used to store numbered values on a room.  The reason this field is on a room is it is part of the base object which all objects are derived from.  If the room is going to be inside another room and you don't want it visible the following would make it invisible to all players below the level of 20.
 
−
<nowiki>
 
−
minv 20</nowiki>
 
−
;key
 
−
: This field is not used normally on a room.  It is a string that can be used for anything you desire.  The reason it exists on rooms is it is a part of the base object all unitptrs (unit pointers like,
 
−
rooms, objects, and NPCs) are derived from.
 
−
;manipulate
 
−
: This field is not used normally on a room.  It is an integer that can be used for anything you desire.  The reason it exists on rooms is it is a part of the base object all unitptrs are derived from.
 
−
;alignment
 
−
: This field is not used normally on a room.  It is an integer that can be used for anything you desire.  The reason it exists on rooms is it is a part of the base object all unitptrs are derived from.
 
−
;weight
 
−
: This field is not used normally on a room.  It is an integer that can be used for anything you desire.  The reason it exists on rooms is it is a part of the base object all unitptrs are derived from.
 
−
;capacity
 
−
: This field is not used normally on a room.  It is an integer that can be used for anything you desire.  The reason it exists on rooms is it is a part of the base object all unitptrs are derived from.
 
−
;light
 
−
: This field sets the light on a room.  Normally this is not done directly, instead it is set using macros defined in
 
−
''wmacros.h''.
 
 
{| class="wikitable"
 
{| class="wikitable"
−
|+Light defines
+
|+Light macros
 
|-
 
|-
−
!Define
+
!Macro
−
!Light Value
+
!Means
−
!Affect
+
!Effect
 
|-
 
|-
 
|ALWAYS_LIGHT
 
|ALWAYS_LIGHT
−
|1
+
|light 1
−
|Room is always light no matter time of day
+
|Always lit, also outdoors at night
−
|-
 
−
|IN_ALWAYS_DARK
 
−
|-1
 
−
|When an inside room is always dark - both inside and outside
 
 
|-
 
|-
 
|OUT_DARK_NON_NOON
 
|OUT_DARK_NON_NOON
−
|-1
+
|light -1
−
|Always a dark room, except when it is high noon
+
|Outdoors: dark except in daylight (at night and at dawn and dusk)
 
|-
 
|-
 
|OUT_ALWAYS_DARK
 
|OUT_ALWAYS_DARK
−
|-2
+
|light -2
−
|Always a Dark room, no matter the time of day
+
|Outdoors: always dark
 +
|-
 +
|IN_ALWAYS_DARK
 +
|light -1
 +
|Indoors: always dark, unless someone brings a light
 
|}
 
|}
−
To set natural light that changes depending on the type of day
+
<pre>
−
nothing is needed to be put in the light field the compiler will default
+
ALWAYS_LIGHT
−
to '0'.  If you for some reason want to set the light to default
+
</pre>
−
lighting you can do so but you don't need to.  You will also notice
+
does the same as
−
there are two macros that set the light to the exact same value.  This is
+
<pre>
−
for compatibility with older code base and if you wish to combine these
+
light 1
−
two macros or only use one it would not change the way the mud
+
</pre>
−
works.
 
  
−
This is probably one of the simplest fields you will have to deal
+
==== Exits ====
−
with in the rooms.  In order to set it all that is needed is to place
+
A room has ten possible exits: <code>north</code>, <code>east</code>, <code>south</code>, <code>west</code>, <code>up</code>, <code>down</code>, <code>northeast</code>, <code>northwest</code>, <code>southeast</code> and <code>southwest</code>. These words are macros from <code>vme/include/wmacros.h</code> (for <code>exit[NORTH]</code> and so on), which is why they can't be used as symbols. An exit is the direction, then its fields in any order, without commas, ending with <code>;</code>:
−
the macro or the light and value on a line in the room and your all
+
<pre>
−
done.
+
north to vault open {EX_OPEN_CLOSE, EX_CLOSED, EX_LOCKED}
−
<nowiki>
+
  key vault_key keyword {"oak door", "door"}
−
//To Set always light with macro
+
  descr "A heavy oak door blocks the way north.";
−
ALWAYS_LIGHT
+
east to temple@udgaard;
 +
</pre>
  
−
//To set Always light with out macro
+
; to ''room''
−
light 1</nowiki>
+
: Where the exit leads. A room in your own zone is just its symbol; a room in another zone is <code>symbol@zone</code>. vmc doesn't check that the room exists: a wrong name compiles, and the server drops the exit at boot with "Unknown room direction" in <code>vme.log</code>.
−
You can decide which is easiest for you.
+
; descr ''string''
−
;link
+
: What a player sees on <code>look north</code>. An exit can have only a <code>descr</code> and no <code>to</code>, to describe a direction you can't go. Its door flags, key and keyword are then dropped.
−
:
+
; keyword ''string list''
−
;spell
+
: The names of the door. Players use them to open, close, lock, unlock, pick and search for it: <code>open door</code> or <code>open north door</code>. The first keyword names the door in all messages ("You see a closed oak door."). A door without a keyword is called "the UNDEFINED".
−
:
+
; open ''flags''
−
;dilbegin or dilcopy
+
: The <code>EX_</code> flags below. They give the door's state at boot; after that the door stays as players leave it, until a <code>door</code> command in the [[Manual:Zone_Manual/The_Reset_Section|reset section]] sets it again.
−
: The DIL functions are what give VME servers the edge over all other muds.
+
; key ''object''
−
We will only give some examples here and leave it up to the DIL manual to teach
+
: The symbol of the key object (<code>key vault_key</code>, or <code>key vault_key@otherzone</code>). Unlocking looks for an object with that symbol in the player's inventory. Without a <code>key</code> the door has no keyhole: it can't be unlocked with a key or picked, only by the <code>unlock</code> spell or DIL. A key that no object has (<code>key nokey</code>) makes a keyhole that can only be picked.
−
you how to create your own functions that will make your rooms, NPC, and
+
; difficulty ''0..250''
−
objects more than special.
+
: How hard the exit is: for finding it with <code>search</code> when hidden, picking its lock, climbing it, and swimming through it in water. Each is a skill check against this number (see [[Manual:Game_Mechanics/Skills|Skills]]). The default is 0.
 +
; ;
 +
: Every exit ends with a semicolon. A missing one is reported at the next word, often <code>Token: 'end'</code>.
  
−
There are only currently three room functions that come
+
{| class="wikitable"
−
standard with a VME in the ''function.zon''.  There
+
|+Exit flags (vme/include/vme.h)
−
are much more in the zones released with the VME but you
+
|-
−
will have to hunt for those.  The three that come standard are Safe
+
!Flag
−
room, Death room, and forced move.  The safe room makes it
+
!Meaning
−
impossible for players to kill each other, the death room is a
+
|-
−
function that lets you make things like rock slides and quick sand,
+
|EX_OPEN_CLOSE
−
and the forced move lets you make an easy river.
+
|The exit is a door, gate or hatch that can be opened and closed
−
 
+
|-
−
Since these are just DIL's written by builders for the
+
|EX_CLOSED
−
Valhalla mud all you have to do is use the dilcopy keyword in the
+
|The door is closed
−
room with the function name you want to use and the arguments the
+
|-
−
function requires.  The following is what you would find in the
+
|EX_LOCKED
−
''function.zon'' for death room.
+
|The door is locked
−
<nowiki>
+
|-
−
/* Death room DIL
+
|EX_PICKPROOF
−
*tick is in 4th's of seconds
+
|The <code>pick</code> skill can't open the lock. The <code>unlock</code> spell still can, unless the room's <code>spell</code> resistance is higher than the spell's power
−
* Damage is damage done per tick
+
|-
−
*act_s is string shown to damaged player.
+
|EX_HIDDEN
−
*/
+
|A closed door that isn't shown, and can't be opened, until the player has found it with <code>search</code>. An open hidden exit can be seen and used by anyone
−
dilbegin death_room(tick: integer, damage: integer, act_s: string);
+
|-
−
 
+
|EX_CLIMB
−
var ext: extraptr;
+
|You can't walk this way, only <code>climb</code> (see [[Manual:Zone_Manual/The_Room_Section/Climbing|Climbing]])
−
    u  : unitptr;
+
|-
−
    i  : integer;
+
|EX_FALL_THIS_WAY
−
 
+
|Someone who fails a climb here falls out through this exit
−
code
+
|}
−
{
 
−
 
 
−
if (tick < 12) tick := 12;
 
−
 
 
−
heartbeat := tick;
 
−
 
 
−
if (damage < 0)
 
−
    damage := -damage;
 
−
 
 
−
if ("$death room for mobs" in self.extra)
 
−
    i := UNIT_ST_PC|UNIT_ST_NPC;
 
−
else
 
−
    i := UNIT_ST_PC;
 
−
 
 
−
while (TRUE)
 
−
{
 
−
wait (SFB_TICK, TRUE);
 
−
 
 
−
foreach (i, u)
 
−
    {
 
−
    if (u.level >= IMMORTAL_LEVEL)
 
−
        continue;
 
  
−
    if (("$no death room" in u.extra) and (u.type == UNIT_ST_NPC))
+
A door is two exits, one in each room. Give both sides the same flags, keyword and key. Opening, closing, locking or unlocking one side changes the other side too.
−
        continue; // Don't allow pcs to get this flag
 
  
−
    if (act_s != "")
+
==== in ====
−
        act ("&[hit_me]"+act_s, A_ALWAYS, u, null, null, TO_CHAR);
+
Puts this room inside another room, with no <code>;</code> after it:
−
    else
+
<pre>
−
        act ("&[hit_me]You bleed from your wounds.",
+
in portal_room
−
            A_ALWAYS, u, null, null, TO_CHAR);
+
</pre>
 +
Players in the outer room reach it with <code>enter</code> and one of its <code>names</code>, and get out again with <code>leave</code>. A room inside a room can also have exits of its own. <code>capacity</code> limits how much it holds: someone can enter only if their weight with all they carry fits (the default is 30000, so in practice no limit).
  
−
    u.hp := u.hp - damage;
+
==== spell ====
−
    position_update (u);
+
The room's resistance to magic, 0 to 255 (default 0). The <code>unlock</code> spell fails on a door when its power is less than the resistance of the room on either side.
−
    }
 
  
−
}
+
==== gmap ====
 +
<code>gmap(x, y)</code> gives the room coordinates on the world map.
  
−
}
+
==== minv ====
 +
Wizard invisibility: only characters of at least this level see the unit (gods start at level 200). On a room it only matters for a room inside another room, which then can't be seen or entered by anyone below that level:
 +
<pre>
 +
minv 220
 +
</pre>
  
−
dilend</nowiki>
+
==== romflags ====
−
If this DIL function scares you don't worry you don't have to
+
Room flags. The server stores them but nothing in it reads them, and no <code>ROOM_FL_</code> constants are defined. A DIL script can give them a meaning of its own with the [[Manual:DIL Manual/roomflags|roomflags]] field.
−
understand or adjust it you just have to use it. In this function it requires a time,
 
−
damage, and act.  So you could use this in a room definition like
 
−
this:
 
−
<nowiki>
 
−
dilcopy death@function (60,25,"Flames shoot from the floor burning
 
−
your rear.");</nowiki>
 
−
This says to copy the DIL from zone function with the arguments 60
 
−
seconds, damage 25% and act as shown. Pretty simple eh?
 
  
−
All released DIL room functions are described in
+
==== dilcopy and dilbegin ====
−
(Link to rmdilfunc).
+
DIL scripts make a room do things: hurt the players in it, move them on, block a command. <code>dilcopy</code> runs a template from another zone (or your own) on the room:
−
Then we put some to work so you can see how
+
<pre>
−
to use them in (Link to rmcomplex)
+
dilcopy death_room@function(PULSE_SEC * 15, 60, "Flames shoot up from the floor.");
 +
</pre>
 +
The <code>;</code> at the end is required. vmc checks neither the template's name nor its arguments, so check them against the template's <code>dilbegin</code> line; a mistake shows up only at boot or when the script runs. The templates for rooms that come with the server are in [[Manual:Zone_Manual/The_Room_Section/DIL_functions_for_rooms|DIL functions for rooms]]. A <code>dilbegin ... dilend</code> written inside the room runs on it without arguments; writing DIL is the subject of the [[Manual:DIL Manual|DIL manual]].
  
 
<div style='padding-top: 30px; padding-bottom: 20px; text-align: left;float:left;width:50%;'>[[Manual:Zone_Manual/Unit_Building_Blocks|Previous: Unit Building Blocks]]</div>
 
<div style='padding-top: 30px; padding-bottom: 20px; text-align: left;float:left;width:50%;'>[[Manual:Zone_Manual/Unit_Building_Blocks|Previous: Unit Building Blocks]]</div>
 
<div style='padding-top: 30px; padding-bottom: 20px; text-align: right;float:right;width:50%;'>[[Manual:Zone_Manual/The_Room_Section/Building_your_first_room|Next: Building your first room]]</div>
 
<div style='padding-top: 30px; padding-bottom: 20px; text-align: right;float:right;width:50%;'>[[Manual:Zone_Manual/The_Room_Section/Building_your_first_room|Next: Building your first room]]</div>

Latest revision as of 06:20, 15 November 2026

The room section

Rooms are the places of your zone: where players stand, what they see and which ways they can go. This chapter lists every field a room can have and what each one does in the game. It builds on Unit Building Blocks, which explains the field types (symbols, strings, string lists, flags, numbers); read that first if you haven't.

Rooms go in the %rooms section of the zone file. Each room is a symbol, its fields in any order, and end:

%rooms

chamber
title "The middle chamber of the station"
descr
"This chamber seems to have the entire station rotating around it."
movement SECT_INSIDE
east to hallway descr "You see a hallway.";
end
Room fields
Field Type What it does
symbol Symbol The room's name in the zone, used by exits, goto, wstat and DIL
title String The room's name, shown as the first line when you look
names String list Names for goto, and what enter matches for a room inside a room
descr String What look shows
outside_descr String What the outer room shows of a room inside it
extra Names and string Things to look at, and hidden data for DIL
movement Constant The terrain: endurance cost, swimming, boats
flags Flags UNIT_FL_* flags: indoors, no weather, no teleport...
light Number Light in the room
direction Exit An exit: north...southwest, up, down
in Symbol Puts this room inside another room
capacity Number For a room inside a room: how much weight can enter it
spell Number Magic resistance of the room
gmap Two numbers Map coordinates
minv Number Wizard invisibility level
romflags Flags Room flags; only DIL reads them
dilcopy, dilbegin DIL Scripts that run on the room

Other unit fields (alignment, weight, manipulate, key, open) are accepted on a room but do nothing for an ordinary room. In a room inside another room, open {EX_CLOSED} makes enter and leave refuse. vmc gives every room MANIPULATE_ENTER itself, so that rooms inside rooms can be entered and left.

Description of room fields

The symbol

The rules for symbols are in Unit Building Blocks: letters, digits and _, at most 15 characters. Rooms, objects and NPCs of a zone share one set of symbols. Pick a symbol that resembles the title. Gods move about with goto chamber@dragonst, and wstat zone dragonst rooms lists a zone's rooms by symbol only, so chamber, portal_room and office are far easier to work with than st_rm1, st_rm2 and st_rm3.

title

The room's name, the first line a player sees in the room. Start it with a capital. Punctuation at the end is up to you.

title "The Post Office"
title "The deep dark jungle floor"
title "The Dragon Station control room"

names

A room doesn't need names. They are used in two places:

  • goto finds a room by name as well as by symbol.
  • A room placed inside another room (see in below) is entered with enter and one of its names.
title "The Post Office"
names {"post office", "office"}

As with all name lists, no name may start with an earlier one: write {"post office", "post"}, never {"post", "post office"}. vmc stops with "Name order error" otherwise.

descr

What a player sees on entering the room or typing look. vmc puts three spaces in front of a room's description, so don't indent the first line yourself. Line breaks are shown as you write them; the game only wraps a line that is too long. Keep each line under about 72 characters, as the zones in the repository do.

A string can't contain a double quote, not even as \". Use single quotes in the text.

outside_descr

For a room inside another room: the line the outer room shows for it, as an object's description is shown. Without it the inner room isn't listed at all, and you describe it in the outer room's descr or an extra instead.

outside_descr "A big old barrel is lying here on its side."

This lets a room look like an object inside another room.

extra

Extras are descriptions of things in the room that players can look at. Say you have a computer room:

descr
"This small room houses the computer power of the development team. All
four walls are lined with computer equipment, old pizza boxes and plenty
of empty soda cans."

A player will want to look at the cans, the boxes and the equipment. Add an extra for each:

extra {"soda cans", "cans", "soda", "can"}
"These cans are all from the same brand. Strange: all of them seem to
have indentations."

extra {"strange indentations", "indentations", "indentation"}
"They are human bite marks. Is this what happens when code doesn't work?"

extra {"pizza boxes", "pizza", "boxes", "box"}
"Someone could make a fortune from all these boxes. They are all empty;
at least the team finishes what it starts."

extra {"computer equipment", "equipment", "hardware", "computer"}
"All you see is an old XT."

extra {"xt"}
"It's a hunk of junk really!"

Two things to notice:

  • Within one list, no name may start with an earlier one, as for names; the extras themselves can come in any order.
  • One extra describes something that leads to another (the cans lead to the indentations, the equipment to the XT). Players who read carefully find more, which is a good place to hide hints for a quest.

Extras whose first name starts with $ are not shown to players. DIL scripts use them to store data on a unit, and some have a meaning in the game. An extra can also carry a list of numbers after its names, for DIL:

extra {"$rockcount"}
"5"

extra {"$coke", "$milk", "$water"} {1, 5, 10}
"Drinks and amounts"

Special extras on rooms:

  • extra {"$get", "statues", "statue"} "...": when a player types get statue, the text is shown instead of "nothing here", so the room can mention things that can't be taken without making objects for them.
  • extra {"$exit_descr"} "...": what a player in a neighbouring room sees on look <direction> towards this room, when that exit has no descr of its own.
extra {"$get", "statues", "statue"}
"You try to pick up a statue, but quickly discover that your feeble
attempts will never work."

extra {"$get", "red roses", "roses"}
"You bend down to pick a rose, but then decide to leave the beautiful
flower to itself."

movement

The terrain of the room, one of the SECT_ constants in vme/include/vme.h. It must be a plain constant: movement SECT_FIELD+1 is a syntax error. The default is SECT_CITY.

movement SECT_FOREST

A step from one room to another costs the average of the two rooms' endurance costs below (rounded down). The costs come from g_movement_loss in vme/src/constants.cpp; carrying more than you can also costs extra.

Sector types
Symbol Endurance Notes
SECT_INSIDE 1
SECT_CITY 1 The default
SECT_FIELD 2
SECT_FOREST 3
SECT_HILLS 4
SECT_MOUNTAIN 6
SECT_DESERT 8
SECT_SWAMP 8
SECT_WATER_SWIM 20 Moving into or out of it needs swimming turned on (the swim command) and a swimming skill check against the exit's difficulty
SECT_WATER_SAIL 20 Deep water: only in a boat; leaving it for land means swimming, 150 harder
SECT_UNDER_WATER 20
SECT_SNOW 8
SECT_SLUSH 8 Wet snow
SECT_ICE 10

The terrain is also read by some skills (tracking, hunting and laying traps in skills.zon) and is a field DIL can read (movement). It doesn't make a room dark or keep the weather out; use flags for that.

flags

Unit flags, the UNIT_FL_ constants of vme/include/vme.h. Only UNIT_FL_* belongs here.

flags {UNIT_FL_NO_WEATHER, UNIT_FL_INDOORS}
Unit flags on rooms
Flag In a room
UNIT_FL_INDOORS The room has walls and a ceiling: daylight doesn't reach it (see light), players in it get no weather messages, and weather spells don't work in it
UNIT_FL_NO_WEATHER Players in the room get no weather messages, and weather spells don't work in it
UNIT_FL_NO_TELEPORT The teleport and summon spells refuse to take anyone into or out of the room. It is four flags in one: UNIT_FL_NO_TEL, UNIT_FL_NO_TEL_TO, UNIT_FL_NO_SUM and UNIT_FL_NO_SUM_FROM
UNIT_FL_NO_MOB NPCs that wander with wander_zones@function or global_wander@function don't walk into the room. Nothing else stops NPCs
UNIT_FL_PRIVATE goto refuses when two or more players are in the room already
UNIT_FL_SACRED Everyone in the room regains hit points, mana and endurance at double rate
UNIT_FL_NOSAVE A player who quits or loses the connection in the room isn't put back in it on logging in again (for treasure rooms, traps and the like)
UNIT_FL_TRANS For a room inside a room: those inside also see the outer room and what is in it
UNIT_FL_NO_BURY Only the corpse-collecting NPC in Midgaard checks it; the bury command doesn't
UNIT_FL_INVISIBLE, UNIT_FL_BURIED, UNIT_FL_MAGIC Meant for objects and characters; no use on a room

light

The light in a room. A room is lit when its light is 0 or more, dark below 0. The total is the room's own light, plus the light sources people carry in, plus daylight: +1 by day, 0 at dawn and dusk, -1 at night. A room with UNIT_FL_INDOORS gets no daylight. The default is 0, so an outdoor room is dark at night and an indoor room is always lit.

vme/include/wmacros.h has macros for the usual cases:

Light macros
Macro Means Effect
ALWAYS_LIGHT light 1 Always lit, also outdoors at night
OUT_DARK_NON_NOON light -1 Outdoors: dark except in daylight (at night and at dawn and dusk)
OUT_ALWAYS_DARK light -2 Outdoors: always dark
IN_ALWAYS_DARK light -1 Indoors: always dark, unless someone brings a light
ALWAYS_LIGHT

does the same as

light 1

Exits

A room has ten possible exits: north, east, south, west, up, down, northeast, northwest, southeast and southwest. These words are macros from vme/include/wmacros.h (for exit[NORTH] and so on), which is why they can't be used as symbols. An exit is the direction, then its fields in any order, without commas, ending with ;:

north to vault open {EX_OPEN_CLOSE, EX_CLOSED, EX_LOCKED}
   key vault_key keyword {"oak door", "door"}
   descr "A heavy oak door blocks the way north.";
east to temple@udgaard;
to room
Where the exit leads. A room in your own zone is just its symbol; a room in another zone is symbol@zone. vmc doesn't check that the room exists: a wrong name compiles, and the server drops the exit at boot with "Unknown room direction" in vme.log.
descr string
What a player sees on look north. An exit can have only a descr and no to, to describe a direction you can't go. Its door flags, key and keyword are then dropped.
keyword string list
The names of the door. Players use them to open, close, lock, unlock, pick and search for it: open door or open north door. The first keyword names the door in all messages ("You see a closed oak door."). A door without a keyword is called "the UNDEFINED".
open flags
The EX_ flags below. They give the door's state at boot; after that the door stays as players leave it, until a door command in the reset section sets it again.
key object
The symbol of the key object (key vault_key, or key vault_key@otherzone). Unlocking looks for an object with that symbol in the player's inventory. Without a key the door has no keyhole: it can't be unlocked with a key or picked, only by the unlock spell or DIL. A key that no object has (key nokey) makes a keyhole that can only be picked.
difficulty 0..250
How hard the exit is: for finding it with search when hidden, picking its lock, climbing it, and swimming through it in water. Each is a skill check against this number (see Skills). The default is 0.
 ;
Every exit ends with a semicolon. A missing one is reported at the next word, often Token: 'end'.
Exit flags (vme/include/vme.h)
Flag Meaning
EX_OPEN_CLOSE The exit is a door, gate or hatch that can be opened and closed
EX_CLOSED The door is closed
EX_LOCKED The door is locked
EX_PICKPROOF The pick skill can't open the lock. The unlock spell still can, unless the room's spell resistance is higher than the spell's power
EX_HIDDEN A closed door that isn't shown, and can't be opened, until the player has found it with search. An open hidden exit can be seen and used by anyone
EX_CLIMB You can't walk this way, only climb (see Climbing)
EX_FALL_THIS_WAY Someone who fails a climb here falls out through this exit

A door is two exits, one in each room. Give both sides the same flags, keyword and key. Opening, closing, locking or unlocking one side changes the other side too.

in

Puts this room inside another room, with no ; after it:

in portal_room

Players in the outer room reach it with enter and one of its names, and get out again with leave. A room inside a room can also have exits of its own. capacity limits how much it holds: someone can enter only if their weight with all they carry fits (the default is 30000, so in practice no limit).

spell

The room's resistance to magic, 0 to 255 (default 0). The unlock spell fails on a door when its power is less than the resistance of the room on either side.

gmap

gmap(x, y) gives the room coordinates on the world map.

minv

Wizard invisibility: only characters of at least this level see the unit (gods start at level 200). On a room it only matters for a room inside another room, which then can't be seen or entered by anyone below that level:

minv 220

romflags

Room flags. The server stores them but nothing in it reads them, and no ROOM_FL_ constants are defined. A DIL script can give them a meaning of its own with the roomflags field.

dilcopy and dilbegin

DIL scripts make a room do things: hurt the players in it, move them on, block a command. dilcopy runs a template from another zone (or your own) on the room:

dilcopy death_room@function(PULSE_SEC * 15, 60, "Flames shoot up from the floor.");

The ; at the end is required. vmc checks neither the template's name nor its arguments, so check them against the template's dilbegin line; a mistake shows up only at boot or when the script runs. The templates for rooms that come with the server are in DIL functions for rooms. A dilbegin ... dilend written inside the room runs on it without arguments; writing DIL is the subject of the DIL manual.

Previous: Unit Building Blocks
Next: Building your first room