Difference between revisions of "Manual:Zone Manual/Zone Source File/Zone information section"

From DikuMUD Wiki
Jump to navigation Jump to search
(checked against the current code (wiki review 2026-11-15))
Line 1: Line 1:
 
=== Zone information section ===
 
=== Zone information section ===
 +
The zone information section is the zone's header: <code>%zone</code>, the zone's name, and the fields that apply to the whole zone. It is the first section of every zone file and the only one that must be there. It has only a few fields, so it is the easiest section to learn.
  
−
The zone information section is the only section that must
 
−
exist in the source file of your area.  With out this section the
 
−
compiler is unable to create the zone because frankly it doesn't
 
−
know what to call it.  It is also the easiest of the sections to
 
−
learn because there is only a few possible fields. The  Zone-section  defines  the global parameters for the current
 
−
zone. It is usually wise to place this section in the top of  the
 
−
source file to make it easy to find the zone information when editing the file.
 
 
{| class="wikitable"
 
{| class="wikitable"
−
|+Zone section field descriptions
+
|+ Zone section fields
 +
! Field !! Type !! Default !! Description
 
|-
 
|-
−
!Field
+
| <code>%zone</code> ''name'' || Symbol || the file name || The zone's name: letters, digits and <code>_</code>, at most 30 characters. It must be the name of the file without <code>.zon</code>. Without a name vmc uses the file's name. vmc doesn't check that the two match, but the server stops at boot when they don't.
−
!Type
 
−
!Description
 
 
|-
 
|-
−
|creators
+
| <code>title</code> || String || none || The zone's name for players. The <code>[[Help/Areas|areas]]</code> command lists the zones whose title has the form <code>"Name@Continent"</code>, such as <code>"Midgaard City@Mainland"</code>, with their continent. <code>help area</code> shows the part before the <code>@</code>. Leave the <code>@</code> out, or the title out, for a zone that players shouldn't see in that list, such as a zone of DIL programs.
−
|Stringlist
 
−
|This field is where you place the creators of the zone. With
 
−
this field filled out the Administrators and builders can easily find out who
 
−
the zone was written by and be able to contact them if there are problems.
 
 
|-
 
|-
−
|lifespan
+
| <code>lifespan</code> || Number || 60 || Minutes between resets. The server adds up to 3 minutes at random, so that zones don't all reset at once. With <code>lifespan 0</code> the zone never resets, not even at boot.
−
|Number
 
−
|This  defines  the interval between resets for this zone, in minutes.
 
−
Default is 60 if this field is left out of the information section.
 
 
|-
 
|-
−
|notes
+
| <code>reset</code> || Number || <code>RESET_NOT</code> || When the zone resets. Use the names from <code>vme.h</code>:
−
|String
+
* <code>RESET_NOT</code>: only once, when the server boots.
−
|This is a plain text description of the zone for administrators and builders.
+
* <code>RESET_IFEMPTY</code>: every <code>lifespan</code> minutes, but only when no player is in the zone. If there is one, the server tries again every minute.
−
It is often a good idea to
+
* <code>RESET_ANYHOW</code>: every <code>lifespan</code> minutes, even with players in the zone.
−
include your e-mail address in the notes so you can be
+
* <code>RESET_NEVER</code>: never by itself, not even at boot. A god can reset it with <code>[[Wizhelp/Reset|reset]]</code>, and a DIL program with [[Manual:DIL Manual/zonereset()|zonereset()]]; the holiday zones work this way.
−
reached easily by the administrators.
 
 
|-
 
|-
−
|reset
+
| <code>creators</code> || String list || none || The players who built the zone, by their character names. They are shown by <code>wstat zone</code>, and a creator may load the zone's objects and NPCs even below the zone's load level.
−
|Number
 
−
|This combined with 'lifespan' defines if the zone will be reset.  This field gives the condition that must be met to reset the zones you should use the defines in the ''vme.h', RESET_NOT (only reset at boot), RESET_IFEMPTY (only reset of players), RESET_ANYHOW (always reset), RESET_NEVER (will never reset, you need to reset programmatically). Default is RESET_ANYHOW, which means, the zone will be reset even if players are present within it.
 
 
|-
 
|-
−
|title
+
| <code>notes</code> || String || none || Notes for the administrators: what the zone is, how to reach you. Gods see them with <code>wstat zone</code> and <code>wizhelp notes</code>.
−
|String
 
−
|This is the title of the zone, for example Dragons Nest, Dark
 
−
station, and
 
−
creators hide out.  It is used mainly for the areas command so
 
−
players can get a list of all the areas in the game.  It can
 
−
however be accessed by the 'zoneptr' variable type in DIL.  If you
 
−
have
 
−
a zone that spans across multiple source files you only need to
 
−
define the title once.  If you put the title in all source files it
 
−
will show up multiple times in the area listing. You would also
 
−
leave this blank if the zone should not be on the areas list like an
 
−
administration zone.
 
 
|-
 
|-
−
|weather
+
| <code>help</code> || String || none || Help for players. A player in the zone sees it with <code>help area</code>.
−
|Integer
 
−
|This field sets the humidity level of the zone.  If for example you want
 
−
a hot desert like zone you would want to set this to its highest value.
 
−
The range of this field is 1000 to -1000.  This is an optional field and
 
−
will not be covered else where because it is simple to use.
 
 
|-
 
|-
−
|%zone
+
| <code>weather</code> || Number || 1000 || The zone's normal air pressure, from 960 to 1040 (vmc refuses other values). The pressure wanders around this value: low pressure brings clouds, rain and thunderstorms, high pressure clear skies. Use a high value for a desert, a low one for a stormy coast.
−
|Symbol
 
−
|This entry defines the name of the
 
−
zone. Default is the preceding  component of the current filename,
 
−
minus the trailing ".zon". Note, the symbol should be added
 
−
after the %zone tag, which should always be put, even if you
 
−
do not add a symbol after it.
 
 
|}
 
|}
−
The only field that must exist when you go to create the zone
 
−
information section is the '%zone'.  Leaving the '%zone' field out
 
−
will cause an error when you try to compile it.  We suggest you
 
−
not only put the '%zone' field but you also add a symbol or as I
 
−
call it a zone name.  The following are three legal examples of a Zone information header.  You be the judge of
 
−
which is more informative.
 
−
<nowiki>
 
−
/*very bad*/
 
−
%zone
 
  
−
/*bad but better than nothing*/
+
The fields may come in any order, and only the name is required. Watch for stray words in the header: a word that isn't a field is taken as the zone's name, so a typing error such as <code>Title</code> gives a syntax error, and a lone word changes the name without a word from vmc.
−
%zone bug_planet
 
  
−
/*The way it should be done!*/
+
=== Examples ===
−
%zone dragonst
+
Three legal headers. You be the judge of which tells the most.
−
lifespan 20
 
−
reset RESET_ANYHOW
 
−
creators {"whistler"}
 
  
−
notes
+
Very bad: the zone gets the file's name, and all the defaults.
−
"This is the dragon station I shortened it to dragonst for ease in
+
<pre>
−
loading.  If you have  any questions email me at whistler@valhalla.com"
+
%zone
 +
</pre>
  
−
help
+
Better than nothing:
−
"Not sure what could help you now. You are stuck on one of the
+
<pre>
−
weirdest space stations you have ever seen and you smell burning
+
%zone bug_planet
−
sulfur."</nowiki>
+
</pre>
−
If you felt like it you could add a '%end' to the proceeding
+
 
−
examples and compile them.  They would create an empty zone so
+
The way it should be done, in <code>dragon.zon</code>:
−
wouldn't be very exciting but at least its possible. We will not go into any compiling until we have at least one unit
+
<pre>
−
type to compile because it is pretty useless to do.
+
%zone dragon
−
  the next chapters will
+
title "The Dragon Station@Deep Space"
−
define the basic unit building blocks you will use for rooms,
+
lifespan 20
−
objects, and NPCs and start you off on compiling.
+
reset RESET_ANYHOW
 +
creators {"whistler"}
 +
 
 +
notes
 +
"The dragon station. If you have any questions, mail Whistler
 +
in the game."
 +
 
 +
help
 +
"Not sure what could help you now. You are stuck on one of the
 +
weirdest space stations you have ever seen, and you smell
 +
burning sulphur."
 +
</pre>
 +
 
 +
Each of these, with <code>#include &lt;macros.h&gt;</code> before it and <code>%end</code> after it, is a zone that compiles: an empty one. The next chapters fill it with rooms, objects and NPCs.
 +
 
 +
=== Getting the zone loaded ===
 +
The server loads only the zones listed in <code>vme/etc/zonelist</code>, one line per zone, starting with the zone's name. Copy the line of a similar zone and change the name. The server stops reading that file at the first blank line, so add your zone above any blank line, or it is quietly left out. See [[Manual:Zone_Manual/General_Compiler_Information|General Compiler Information]] for compiling and loading.
  
 
<div style='padding-top: 30px; padding-bottom: 20px; text-align: left;float:left;width:50%;'>[[Manual:Zone_Manual/Zone_Source_File|Previous: Zone Source File]]</div>
 
<div style='padding-top: 30px; padding-bottom: 20px; text-align: left;float:left;width:50%;'>[[Manual:Zone_Manual/Zone_Source_File|Previous: Zone Source File]]</div>
 
<div style='padding-top: 30px; padding-bottom: 20px; text-align: right;float:right;width:50%;'>[[Manual:Zone_Manual/Unit_Building_Blocks|Next: Unit Building Blocks]]</div>
 
<div style='padding-top: 30px; padding-bottom: 20px; text-align: right;float:right;width:50%;'>[[Manual:Zone_Manual/Unit_Building_Blocks|Next: Unit Building Blocks]]</div>

Revision as of 06:19, 15 November 2026

Zone information section

The zone information section is the zone's header: %zone, the zone's name, and the fields that apply to the whole zone. It is the first section of every zone file and the only one that must be there. It has only a few fields, so it is the easiest section to learn.

Zone section fields
Field Type Default Description
%zone name Symbol the file name The zone's name: letters, digits and _, at most 30 characters. It must be the name of the file without .zon. Without a name vmc uses the file's name. vmc doesn't check that the two match, but the server stops at boot when they don't.
title String none The zone's name for players. The areas command lists the zones whose title has the form "Name@Continent", such as "Midgaard City@Mainland", with their continent. help area shows the part before the @. Leave the @ out, or the title out, for a zone that players shouldn't see in that list, such as a zone of DIL programs.
lifespan Number 60 Minutes between resets. The server adds up to 3 minutes at random, so that zones don't all reset at once. With lifespan 0 the zone never resets, not even at boot.
reset Number RESET_NOT When the zone resets. Use the names from vme.h:
  • RESET_NOT: only once, when the server boots.
  • RESET_IFEMPTY: every lifespan minutes, but only when no player is in the zone. If there is one, the server tries again every minute.
  • RESET_ANYHOW: every lifespan minutes, even with players in the zone.
  • RESET_NEVER: never by itself, not even at boot. A god can reset it with reset, and a DIL program with zonereset(); the holiday zones work this way.
creators String list none The players who built the zone, by their character names. They are shown by wstat zone, and a creator may load the zone's objects and NPCs even below the zone's load level.
notes String none Notes for the administrators: what the zone is, how to reach you. Gods see them with wstat zone and wizhelp notes.
help String none Help for players. A player in the zone sees it with help area.
weather Number 1000 The zone's normal air pressure, from 960 to 1040 (vmc refuses other values). The pressure wanders around this value: low pressure brings clouds, rain and thunderstorms, high pressure clear skies. Use a high value for a desert, a low one for a stormy coast.

The fields may come in any order, and only the name is required. Watch for stray words in the header: a word that isn't a field is taken as the zone's name, so a typing error such as Title gives a syntax error, and a lone word changes the name without a word from vmc.

Examples

Three legal headers. You be the judge of which tells the most.

Very bad: the zone gets the file's name, and all the defaults.

%zone

Better than nothing:

%zone bug_planet

The way it should be done, in dragon.zon:

%zone dragon
title "The Dragon Station@Deep Space"
lifespan 20
reset RESET_ANYHOW
creators {"whistler"}

notes
"The dragon station. If you have any questions, mail Whistler
in the game."

help
"Not sure what could help you now. You are stuck on one of the
weirdest space stations you have ever seen, and you smell
burning sulphur."

Each of these, with #include <macros.h> before it and %end after it, is a zone that compiles: an empty one. The next chapters fill it with rooms, objects and NPCs.

Getting the zone loaded

The server loads only the zones listed in vme/etc/zonelist, one line per zone, starting with the zone's name. Copy the line of a similar zone and change the name. The server stops reading that file at the first blank line, so add your zone above any blank line, or it is quietly left out. See General Compiler Information for compiling and loading.

Previous: Zone Source File
Next: Unit Building Blocks