Writing a Zone File

The zone file contains many essential facts that the game needs in order to load a zone and the monsters, doors and objects in it correctly. The zone file begins by listing the general information the game needs to assign status for autoexits, reset time and how large the zone is and ends with a far more extensive list which details where everything loads, when and how often.


Zone Creation Fields

<Zone number>

Every zone has a unique zone number associated with it. The zone number is used with many immortal commands inside the running game.

<Top room of the zone>

The game actually needs the top room number of each zone to start correctly.

<Zone lifespan>

The zone lifespan is the length of time the zone will be active between resets. When the lifespan elapses it will be queued to reset at the earliest opportunity.

<Reset mode>

The zone's reset mode will determine the conditions under which a zone will reset when its lifespan has elapsed. Chose a reset mode from the following table:

 Value
Purpose

0
The zone will only reset when the game crashes.

1
The zone will reset as soon as it is deserted.

2
The zone will reset no matter what.

<Autoexits status>

An interesting feature of the JediMUD code is the ability to turn off the autoexits command by zone. When autoexits are disabled, players are forced to slow down and be more careful when they initially explore a zone than might be the case otherwise. If this value is 0, then autoexits will not work in the zone. If the value in this field is a 1, then autoexits will function.


The Command Table

The command table is the list of commands that the game will attempt to execute every time the zone is reset. Each command consists of a letter, which identifies the command type, followed by three or four fields.

<Command type>

Each command type has a unique letter associated with it. Chose the appropriate command type from the table below:

Function

Flag
Load a monster and place it into a room.

M
Percentile load a monster and place it into a room.

W
Load an object and place it into a room.

O
Percentile load an object and place it into a room.

X
Load an object and give it to the last monster loaded.

G
Percentile load an object and give it to the last monster loaded.

Y
Load an object into the equipment list of a monster.

E
Percentile load an object and place it into the equipment list of a monster.

Z
Load one object into another object.

P
Percentile load an object and place it into another object.

Q
Load a door.

D

<If flag>

The first field is common to all commands. It is called the If flag and will tell the game specific conditions that must be met for the command on that line to execute. The following If commands are available on JediMUD:

Conditions for the Load Command to Execute

If Flag
Execute no matter what.

 0
Execute only if the last command was successful.

1
Execute only if the last command was not successful.

2
Execute if the last monster load command was successful.

3
Execute if the last monster load command failed because of a probability test.

4
Execute if the last monster load command was successful.

5
Execute if the last monster load command did not succeed for any reason.

6


How to use each type of load command

M- Load a monster and place it into a room

W- Percentile load a monster and place it into a room

O- Load an object and place it into a room

X- Percentile load an object and place it into a room

G- Load an object and give it to the last monster loaded

Y- Percentile load an object and give it to the last monster loaded

E- Load an object into the equipment list of the last monster loaded

 Location

Number
Light

0
Finger (right)

1
Finger (left)

2
Neck (one)

3
Neck (two)

4
Body

5
Head

6
Legs

7
Feet

8
Hands

9
Arms

10
Shield

11
About the Body

12
Waist

13
Wrist (right)

14
Wrist (left)

15
Wield

16
Hold

17

Z- Percetile load an object into the equipment list of the last monster loaded

 Location

Number
Light

0
Finger (right)

1
Finger (left)

2
Neck (one)

3
Neck (two)

4
Body

5
Head

6
Legs

7
Feet

8
Hands

9
Arms

10
Shield

11
About the Body

12
Waist

13
Wrist (right)

14
Wrist (left)

15
Wield

16
Hold

17

P- Load an object and place it into another object

Q- Percentile load an object and place it into another object

D- Loading a door into a room

Format: D <if flag> <room number> <exit number> <state>

Open 0
Closed 1
Closed and Locked 2


Questions? Send mail to the Build Team: areas@jedi.america.net