As mind is the witness and reality of all dream-objects, so soul is the only reality in the diversities of this universe.
There are four basic object types. Each has its own special properties, as well as those that they all share. The basic objects are mob, obj, turf, and area. There are other objects as well, but these four are the ones which are visible to players. We call them atomic objects.
The simplest difference between them is the order in which they appear on the map. Areas are drawn in the first layer. The icon of an area is often simply a solid background color. Turfs are drawn on top of areas; these usually represent some type of terrain like grass, roads, or walls. Objs are drawn next, and might stand for items such as swords or cookies. Mobs are drawn on top of everything else. They normally represent players or computer-controlled creatures. (The term mob stands for mobile object. It is also suggestive of monster, which is a common role they play.)
On the map, the mobs and objs are said to be contained by the turf. That in turn is contained by the area. It is also possible for mobs and objs to contain things. For example, a chest obj might contain a bunch of treasure items; and a player's mob could contain all the player's possessions.
Notice how I keep using words like `might,' `could,' or `normally.' That is because DM gives you, the designer, a great deal of flexibility. Many of the basic object properties were defined with a particular purpose in mind. That doesn't mean you have to use them that way. The meaning of the game objects is up to you.
area |
turf |
obj |
mob |
First let us look at the properties that all of the objects have in common.
We have already seen that they each have a name and an icon. These are
variables. (There are also some procs, but the discussion of those takes
place later in chapter 7.) Here is a list of each
variable and a description of its purpose.
This is the name of the object, which by default is the same as the type
(i.e. node) name with any underscores replaced by spaces.
The grammatical gender of the object may be set using this variable. The
possible values are
This is a description of the object. It often appears in the "stat"
panels when the player examines the object. Controlling the content of
those panels will be discussed in section 7.3.
This is some text commonly displayed after the name of the object in the
"stat" panels. For example, this could indicate the status of equipment
items:
This is a single character used to represent the object on a non-graphical
map. If you have ever played rogue or any of its derivatives, you will know
what this means.
This is the icon file used to graphically represent the object.
Icon files may contain several alternate representations for an object.
For example, a door could be open or closed. This variable is the name of
the currently active state.
This is the direction the object is facing. Some icons may be directional,
meaning that they look different depending on which way the object is
pointed. This is most often used for mobs, which change direction as they
move around.
This is a list of icons or object types which appear on top of the object's
main icon.
This is a list of icons or object types which appear underneath the object's
main icon.
This is 1 or 0 to indicate whether the object is visible.
This is 0 to 6 to indicate how far the object emits light. Only areas are
luminous by default, which has the effect of casting light on everything
else in the area.
This is 1 or 0 depending on whether the object blocks light. An opaque
object will block the view of objects behind it.
This is 1 or 0 to indicate whether the object fills up the space it
occupies. Only mobs are dense by default. Normally, no two dense objects
may occupy the same position (but you will see how to circumvent that in
section 7.1).
This is a list of all the objects directly inside of an object. The term
often used in the case of mobs is inventory. You will learn more
about this and lists in general in chapter 10.
This is a list of the verbs (that is, commands) associated with the object.
These will be discussed in chapter 4.
This is the type path of the object. For example, it might be
/turf or /turf/trap. You could look at this value in a
procedure in order to find out what type of object you are dealing with.
The following location variables apply to all object types except areas,
which never exist inside other objects. These variables are only used in
proc code, which will be discussed in chapter 6.
This indicates the container of an object. In other words, if object A
contains object B, B's loc will be equal to A, and B will exist in A's
contents list.
These indicate the position of an object on the map. Valid coordinates
start at (1,1,1). The x and y coordinates represent east/west and
north/south positioning, respectively. The z coordinate specifies the map
level.
In addition to these commonly held variables, mobs add a few of their own.
This is the login name of the player. By default, when a new mob is created
for a player, the mob's name is set equal to this. Every key is
unique--even when stripped of punctuation and ignoring case. That makes it
a good way to keep track of people.
This is the player's key in canonical form (stripped of punctuation and
converted to lowercase). This is useful when saving information about the
player for future use. More will be said about doing that in
chapter 12.
This is the player's client object (if any). The client object will be
described in chapter 9.
This value controls special visual powers of a mob, permitting sight of
invisible or obscured objects. It can be one or more of the following
numerical constants added together: SEEINVIS, SEEMOBS,
SEEOBJS, SEETURFS, BLIND.
(
Normally, one uses the bitwise OR operator | to combine sight
values. However, you can use a plain old + as long as you don't
include the same value more than once.
)
This is a list of one's mob friends. It serves the very practical purpose
of avoiding traffic problems. When a friend tries to move past another, the
two switch places. Otherwise it can be rather annoying to continually bump
into each other. This variable would be manipulated in the proc code.
By assigning a few variables, one can create a wide variety of objects.
This is done in the object definition. For example, here are a few
different combinations of opacity and density.
This example defines four turfs:
Notice how we had to explicitly set the name of the secret door to
This example illustrates three basic types of values: numbers, text strings,
and resource files. These are called constant values.
Numerical constants may be positive or negative, integer or floating point,
and can make use of scientific notation. For example 3.15e7 or 31500000 is
approximately the number of seconds in a year. The maximum possible value
is 3.4e38 and the smallest is 1.4e-45. (The numerical limits are
those of a single-precision IEEE floating point value, in case you were
wondering.)
Text constants are often simply called strings by programmers because
they consist of a string of characters. They begin and end with a double
quote. There are several special text macros that can be used inside
the text. For example, a name is assumed to be a proper noun if it is
capitalized. You can override that by using the
Like all text macros,
In this particular example, the purpose of using
Resource files, such as icons or sounds are specified inside single quotes.
For instance, to access an icon file located at
C:\myworld\man.dmi, you would enter the value
1. Object Properties
"neuter"
, "male"
, "female"
, and
"plural"
. The default is "neuter"
.
"(weapon in hand)"
, "(worn on body)"
, and so on.
1.1 Location
1.2 Additional Mob Properties
2. Assigning Variables
turf
floor
icon = 'floor.dmi'
wall
icon = 'wall.dmi'
density = 1
opacity = 1
secret_door
name = "wall"
density = 0
window
icon = 'window.dmi'
density = 1
floor
, wall
, secret_door
,
and window
. One can walk and see across the floor but not the wall.
The secret door is just like a wall, except one can walk through it. To
round out the set, the window is transparent but not traversable.
wall
to prevent the default secret door
from taking effect. You
would also need to do this if you wanted the name to contain a character
that is not allowed in a node name.
2.1 Constant Values
2.1.1 Numbers
2.1.2 Text
\improper
text macro.
obj/CPU
name = "\improper CPU"
\improper
begins with a backslash. The space
after it serves merely as a separator and is ignored. A complete
description of this and other text macros will be given in section
11.3.
\improper
is to
modify how the name of the object is treated in output text. As an improper
noun, it would produce sentences like "You insert the CPU." rather than
"You insert CPU." You will see exactly how to construct sentences like
that later.
2.1.3 Resource Files
'man.dmi'
. You can make use of sub-directories within your project to
organize things as you wish.