Difference between revisions of "Manual:Zone Manual/The Room Section/Building your first room"

From DikuMUD Wiki
Jump to navigation Jump to search
(checked against the current code (wiki review 2026-11-15))
 
Line 1: Line 1:
 
=== Building your first room ===
 
=== Building your first room ===
  
−
Now you are ready!  With all you have learned about room
+
Now you are ready to build your first room. I like dragons and I like space, so I have chosen to make a dragon station. We start with one simple room and add to it in the following sections. This page walks you through the room and why each part is there.
−
fields you are now ready to build your first room. I personally
 
−
like dragons and I like space so I have chosen to make a dragon
 
−
station. We will first do a simple room and build on to it in the
 
−
next sections. In this section we will walk you through creating a
 
−
basic room and why we choose what we do where we do.
 
  
−
When making rooms you create the zone source file first as shown
+
You make the zone file first, as shown in [[Manual:Zone_Manual/Zone_Source_File|Zone Source File]]. The zone is called <code>dragonst</code>, so the file must be called <code>dragonst.zon</code>: the zone name and the file name have to be the same. A zone with only rooms needs no <code>%objects</code>, <code>%mobiles</code> or <code>%reset</code> section; the rooms go in the <code>%rooms</code> section. At the end of the chapter you will have the whole zone in one piece.
−
in (Link to ch-02). If you only have rooms you do not need the
 
−
%reset, %objects, and %mobiles.  For the examples in this chapter we
 
−
will use the zone we created in (Link to ch-02) and add the %room
 
−
tag where we will put all the rooms. At the end of the chapter we will
 
−
have the entire zone so you can see it all together.
 
  
−
The first part of all rooms is the symbolic name it is good to
+
Every room starts with its symbol. Pick one that matches the title. Gods move about with <code>goto chamber@dragonst</code>, and <code>wstat zone dragonst rooms</code> lists the zone's rooms by symbol only. With names like <code>chamber</code>, <code>portal_room</code> and <code>office</code> you know which room is which; with <code>st_rm1</code>, <code>st_rm2</code> and <code>st_rm3</code> you won't, once there are a hundred of them.
−
always pick a name that will match the title so you can use the
 
−
administrator command '''goto''' to easily get to the
 
−
room.  The reason is when you use the command
 
−
'''wstat''' it will only show you a list of the rooms
 
−
by symbolic name for example if you type
 
−
'''wstat zone dragon room'''
 
−
You will get  the following:
 
  
−
<nowiki>
+
The first room is a simple chamber with nothing special:
−
List of rooms in zone Dragon:
+
<pre>
−
chamber portal office</nowiki>
+
chamber
−
If you didn't make it clear what the rooms were by the symbolic name
+
end
−
it might look like this:
+
</pre>
−
<nowiki>
 
−
List of rooms in zone Dragon:
 
−
st_rm1 st_rm2 st_rm3</nowiki>
 
−
While this might be great when you first start imagine trying to
 
−
remember what all one hundred rooms are.
 
  
−
The first room we will create will be a simple chamber with nothing special.  We can build on to it later if we need to.
+
Easy so far. Now let's add some life to it. The room needs a title and a description. The title is a short name for the room, the way you would show someone around your house: "this is the big bathroom", "this is the computer room". The description is what you would tell an interior decorator on the phone when asking for advice: everything you can see in the room.
−
<nowiki>
+
<pre>
−
chamber
+
chamber
−
end</nowiki>
+
title "The middle chamber of the station"
−
Pretty easy so far. Now lets add some life to it. The room
+
descr
−
will need a title and a description. The title should be a one line
+
"This chamber seems to have the entire station rotating around it.
−
description of a room sort of like if you were walking someone
+
Small human-size ornate chairs with dragon designs on the arms and
−
around your house and telling them what each room was like this is
+
backs are arranged in a triangle, with one large chair at the front.
−
'My houses big bathroom' or maybe this is 'The computer room'. The
+
This must be where all station meetings are held. Large pictures cover
−
description should be something you would tell an interior
+
the walls, showing dragons in all kinds of situations. Small passages
−
decorator you were talking to on the phone and asking for
+
lead off to the west and the east."
−
advice.  He would want to know everything about the room you
+
end
−
can see so he could give you good advice.
+
</pre>
−
<nowiki>
+
Line breaks in the description are shown as you write them, so break the lines yourself and keep them under about 72 characters. vmc puts three spaces in front of the first line.
−
chamber
 
−
title "The middle chamber of the station"
 
−
descr
 
−
"This chamber seems to have the entire station rotating around it.
 
−
Small human size ornate chairs with dragon designs scrawled on the
 
−
arms and back are arranged in a triangle like setting with one large
 
−
chair at the front. This must be where all station meetings are held.
 
−
large pictures cover the walls depicting dragons in all kinds of
 
−
situations. Small passages lead of to the west and the east.
 
−
."
 
−
end</nowiki>
 
−
It is a matter of taste if you want the descriptions of the
 
−
exits in your description or not but I like them so I put them. Now
 
−
if you were reading this description to someone the person might ask
 
−
you what is on the pictures or maybe even what exactly do the chairs
 
−
look like so we better take care of that by adding some extras to
 
−
our little room.
 
−
<nowiki>
 
−
extra {"chairs","chair"}
 
−
"The chairs are made of some metal you don't recognize and every inch is covered
 
−
with some kind of dragon."
 
  
−
extra {"dragon picture","picture"}
+
Whether you mention the exits in the description is a matter of taste; I like to. If you read this description to someone, they might ask what is on the pictures, or what the chairs look like. Extras answer that: <code>look chair</code>, <code>look picture</code>, and then <code>look dragon</code>.
−
"Thousands of dragons dot the skies of this rather life like picture.  In the
+
<pre>
−
center you see something move.  It looks to be a little green dragon."
+
extra {"chairs", "chair"}
 +
"The chairs are made of some metal you don't recognise and every inch
 +
is covered with some kind of dragon."
  
−
extra{"green dragon","dragon","green"}
+
extra {"dragon picture", "picture"}
−
"An intelligent looking dragon is sitting perched on a large chair watching you."</nowiki>
+
"Thousands of dragons dot the skies of this rather lifelike picture. In
−
Normally we could put a movement type for the amount of
+
the centre you see something move. It looks to be a little green
−
endurance lost when a person is moving through the area but we will
+
dragon."
−
leave it blank and go with the default which is SECT_CITY since
 
−
with the fake gravity that is the closest we could come with the
 
−
sector types availible. The last thing we need to finish our room
 
−
is the two exits leading to the other rooms.
 
−
<nowiki>
 
−
west to portal descr "You see a small room.";
 
  
−
east to office descr "You see what looks to be an office.";</nowiki>
+
extra {"green dragon", "dragon", "green"}
−
Thats it that is all there is to making a room.  In the next
+
"An intelligent-looking dragon is sitting perched on a large chair,
−
couple of sections we are going to add some more rooms with more
+
watching you."
−
advanced features and give some debugging hints for compiling your
+
</pre>
−
rooms but if you understand everything so far your going to have no
+
In each list the longer names come first: no name may start with an earlier one, or vmc stops with an error.
−
problem. Lets take a look at our entire finished first room
 
−
<nowiki>
 
−
chamber
 
−
title "The middle chamber of the station"
 
−
descr
 
−
"This chamber seems to have the entire station rotating around it.
 
−
Small human size ornate chairs with dragon designs scrawled on the
 
−
arms and back are arranged in a triangle like setting with one large
 
−
chair at the front.  This must be where all station meetings are held.
 
−
large pictures cover the walls depicting dragons in all kinds of
 
−
situations.  Small passages lead of to the west and the east.
 
−
."
 
  
−
extra {"chairs","chair"}
+
We could give the room a <code>movement</code> type for the endurance it costs to walk through, but we leave it out for now and get the default, <code>SECT_CITY</code>; with the station's artificial gravity that is as close as any of the sector types. The last thing the room needs is the two exits to the rooms next to it:
−
"The chairs are made of some metal you don't recognize and every inch is covered
+
<pre>
−
with some kind of dragon."
+
west to disposal_room descr "You see a small room.";
 +
east to hallway descr "You see what looks to be a hallway.";
 +
</pre>
 +
Those two rooms don't exist yet. vmc doesn't check where exits lead, so the zone compiles anyway; until the rooms are there, the server drops these two exits at boot and says so in <code>vme.log</code> ("Unknown room direction").
  
−
extra  {"dragon picture","picture"}
+
That is all there is to making a room. Here is the finished first room:
−
"Thousands of dragons dot the skies of this rather life like picture. In the
+
<pre>
−
center you see something move. It looks to be a little green dragon."
+
chamber
 +
title "The middle chamber of the station"
 +
descr
 +
"This chamber seems to have the entire station rotating around it.
 +
Small human-size ornate chairs with dragon designs on the arms and
 +
backs are arranged in a triangle, with one large chair at the front.
 +
This must be where all station meetings are held. Large pictures cover
 +
the walls, showing dragons in all kinds of situations. Small passages
 +
lead off to the west and the east."
  
−
extra{"green dragon","dragon","green"}
+
extra {"chairs", "chair"}
−
"An intelligent looking dragon is sitting perched on a large chair watching you."
+
"The chairs are made of some metal you don't recognise and every inch
−
west to portal descr "You see a small room.";
+
is covered with some kind of dragon."
  
−
east to office descr "You see what looks to be an office.";
+
extra {"dragon picture", "picture"}
−
end</nowiki>
+
"Thousands of dragons dot the skies of this rather lifelike picture. In
 +
the centre you see something move. It looks to be a little green
 +
dragon."
 +
 
 +
extra {"green dragon", "dragon", "green"}
 +
"An intelligent-looking dragon is sitting perched on a large chair,
 +
watching you."
 +
 
 +
west to disposal_room descr "You see a small room.";
 +
east to hallway descr "You see what looks to be a hallway.";
 +
end
 +
</pre>
 +
In the next sections we compile it, then add more rooms with doors, hidden exits and rooms inside rooms.
  
 
<div style='padding-top: 30px; padding-bottom: 20px; text-align: left;float:left;width:50%;'>[[Manual:Zone_Manual/The_Room_Section|Previous: The Room Section]]</div>
 
<div style='padding-top: 30px; padding-bottom: 20px; text-align: left;float:left;width:50%;'>[[Manual:Zone_Manual/The_Room_Section|Previous: The Room Section]]</div>
 
<div style='padding-top: 30px; padding-bottom: 20px; text-align: right;float:right;width:50%;'>[[Manual:Zone_Manual/The_Room_Section/Compiling_and_debugging_your_first_room|Next: Compiling and debugging 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/Compiling_and_debugging_your_first_room|Next: Compiling and debugging your first room]]</div>

Latest revision as of 06:20, 15 November 2026

Building your first room

Now you are ready to build your first room. I like dragons and I like space, so I have chosen to make a dragon station. We start with one simple room and add to it in the following sections. This page walks you through the room and why each part is there.

You make the zone file first, as shown in Zone Source File. The zone is called dragonst, so the file must be called dragonst.zon: the zone name and the file name have to be the same. A zone with only rooms needs no %objects, %mobiles or %reset section; the rooms go in the %rooms section. At the end of the chapter you will have the whole zone in one piece.

Every room starts with its symbol. Pick one that matches the title. Gods move about with goto chamber@dragonst, and wstat zone dragonst rooms lists the zone's rooms by symbol only. With names like chamber, portal_room and office you know which room is which; with st_rm1, st_rm2 and st_rm3 you won't, once there are a hundred of them.

The first room is a simple chamber with nothing special:

chamber
end

Easy so far. Now let's add some life to it. The room needs a title and a description. The title is a short name for the room, the way you would show someone around your house: "this is the big bathroom", "this is the computer room". The description is what you would tell an interior decorator on the phone when asking for advice: everything you can see in the room.

chamber
title "The middle chamber of the station"
descr
"This chamber seems to have the entire station rotating around it.
Small human-size ornate chairs with dragon designs on the arms and
backs are arranged in a triangle, with one large chair at the front.
This must be where all station meetings are held. Large pictures cover
the walls, showing dragons in all kinds of situations. Small passages
lead off to the west and the east."
end

Line breaks in the description are shown as you write them, so break the lines yourself and keep them under about 72 characters. vmc puts three spaces in front of the first line.

Whether you mention the exits in the description is a matter of taste; I like to. If you read this description to someone, they might ask what is on the pictures, or what the chairs look like. Extras answer that: look chair, look picture, and then look dragon.

extra {"chairs", "chair"}
"The chairs are made of some metal you don't recognise and every inch
is covered with some kind of dragon."

extra {"dragon picture", "picture"}
"Thousands of dragons dot the skies of this rather lifelike picture. In
the centre you see something move. It looks to be a little green
dragon."

extra {"green dragon", "dragon", "green"}
"An intelligent-looking dragon is sitting perched on a large chair,
watching you."

In each list the longer names come first: no name may start with an earlier one, or vmc stops with an error.

We could give the room a movement type for the endurance it costs to walk through, but we leave it out for now and get the default, SECT_CITY; with the station's artificial gravity that is as close as any of the sector types. The last thing the room needs is the two exits to the rooms next to it:

west to disposal_room descr "You see a small room.";
east to hallway descr "You see what looks to be a hallway.";

Those two rooms don't exist yet. vmc doesn't check where exits lead, so the zone compiles anyway; until the rooms are there, the server drops these two exits at boot and says so in vme.log ("Unknown room direction").

That is all there is to making a room. Here is the finished first room:

chamber
title "The middle chamber of the station"
descr
"This chamber seems to have the entire station rotating around it.
Small human-size ornate chairs with dragon designs on the arms and
backs are arranged in a triangle, with one large chair at the front.
This must be where all station meetings are held. Large pictures cover
the walls, showing dragons in all kinds of situations. Small passages
lead off to the west and the east."

extra {"chairs", "chair"}
"The chairs are made of some metal you don't recognise and every inch
is covered with some kind of dragon."

extra {"dragon picture", "picture"}
"Thousands of dragons dot the skies of this rather lifelike picture. In
the centre you see something move. It looks to be a little green
dragon."

extra {"green dragon", "dragon", "green"}
"An intelligent-looking dragon is sitting perched on a large chair,
watching you."

west to disposal_room descr "You see a small room.";
east to hallway descr "You see what looks to be a hallway.";
end

In the next sections we compile it, then add more rooms with doors, hidden exits and rooms inside rooms.

Previous: The Room Section
Next: Compiling and debugging your first room