The .zon File

The .zon file tells the mud where everything goes, from the goblin in the pit to what the knight is wielding and putting the fountain in the square. It also controls how and when the area is reset.

There are two main parts to every .zon file: the header information, and a list of commands to be followed out by the mud. Here is a header of a zone file for an example, followed by a line by line example:

Example Area~
2299 20 2

Please note the example above is only the header of the file. The examples of zone commands will follow this explanation of the header...

This is the zone number of the area. The mud doesn't actually care what number goes here, but your mud-admin probably does.
Example Area~
The name of the area.
2299 20 2
The first number is the 'top' or 'last' number of the zone -- the vnum of the final room of the area.
The second number is the number of ticks between resets of the area. 20-30 is usually a good number.
The third number controls how the zone is reset:

Zone Commands

The zone commands tell the mud exactly how to reset a zone, from mobs to objects, to closing doors. Each command is given its own line, one after the other, until the end of the file. Comments can be added for clarity's sake (like this: big guy with sword).

*Standard Fields:
An if flag tells the mud to look at the previous command. If the if-flag is 0, the mud will try to execute the command regardless of the previous command. If the if-flag is any other than a zero (one is most commonly used), then that particular command will only execute if the command immediately preceding it did as well.
This is useful for objects loaded onto mobs; you don't want to load a shield on a guard that didn't get loaded, for example. There are several other uses as well, that should become apparent as you build...
<max #>
This is the maximum number of whatever this is can exist in the mud. If on a mob command, this will prevent excess mobs being loaded into an area. On an object command, this limits how many of this object are available in the game. For items not limited, it is common to put a very high number in this slot... from 100 to 1000.
*The 'M' Command
The 'M' zone command loads a mobiles to a certain place in the mud. The format is:
M <if-flag> <mob vnum> <max #> <room vnum>
*The 'O' Command
The 'O 'zone command loads an object into a room. This is mostly used for unowned or immovable objects (like a stick on the ground or a fountain).
O <if-flag> <object vnum> <max #> <room vnum>
*The 'G' Command
The 'G' zone command loads an object and gives it to a mobile loaded in the command immediately previous. Note that this is different from the 'E' command below, in that the 'E'command loads an object and makes the mob equip it. A 'G' command object stays in the mob's inventory.
G <if-flag> <object vnum> <max #>
*The 'E' Command
The 'E' zone command loads an object and makes the mob loaded in the command immediately previous to this one equip it.
E <if-flag> <object vnum> <max #> <equipment position>
Where equipment position is one of the following:
        0       Light
        1       Right Finger
        2       Left Finger
        3       Neck (first slot)
        4       Neck (second slot)

        5       Body
        6       Head
        7       Legs
        8       Feet
        9       Hands

        10      Arms
        11      Shield
        12      About Body
        13      Waist
        14      Right Wrist

        15      Left Wrist
        16      Wield
        17      Hold
*The 'P' Command
The 'P' command loads an object, and places it into another object (container-type) that was previously loaded.
P <if-flag> <loaded object vnum> <max #> <container vnum>
*The 'D' Command
The 'D' command can open, close, or close and lock a door.
D <if-flag> <room vnum> <exit #> <doorstate>
Where exit # is the number equivalent of the exit, just as in the world file, like so:
                 0   4 (up)
                 | /
        (west) 3-+-1 (east)
               / |
      5 (down)   2
And Door state is:
        0       Open
        1       Closed
        2       Closed and Locked
*The 'R' Command
The 'R' Command is used to remove an object from a room. This command does not exist on all muds.
R <if-flag> <room vnum> <object vnum>
*The 'S' Command
The 'S' Command is not actually a command persay, but rather signals the end of the zone command list.

Zone Archetype

#<zone #>
name of area~
<last room in area> <reset time> <reset type> <zone commands>

Tips And Observations

[Next] On to the next section
[Back] Back to the previous section
Back to the Builders' Handbook contents

[C.A.W.] Back to the C.A.W. Homepage

Alex Fletcher
Last modified: June 24th, 1996