Difference between revisions of "Manual:Zone Manual/Zone Source File/Zone information section"
(bonusband: the zone's treasure band) |
|||
| (One intermediate revision by the same user not shown) | |||
| 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. | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
{| class="wikitable" | {| class="wikitable" | ||
| − | |+Zone section | + | |+ Zone section fields |
| + | ! Field !! Type !! Default !! Description | ||
|- | |- | ||
| − | + | | <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. | |
| − | |||
| − | |||
|- | |- | ||
| − | | | + | | <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. |
| − | | | ||
| − | | | ||
| − | |||
| − | |||
|- | |- | ||
| − | |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 | ||
| − | | | ||
| − | |||
|- | |- | ||
| − | | | + | | <code>reset</code> || Number || <code>RESET_NOT</code> || When the zone resets. Use the names from <code>vme.h</code>: |
| − | + | * <code>RESET_NOT</code>: only once, when the server boots. | |
| − | + | * <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. | |
| − | + | * <code>RESET_ANYHOW</code>: every <code>lifespan</code> minutes, even with players in the zone. | |
| − | + | * <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. | |
| − | |||
|- | |- | ||
| − | | | + | | <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. |
| − | | | ||
| − | | | ||
|- | |- | ||
| − | | | + | | <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 | ||
| − | | | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
|- | |- | ||
| − | | | + | | <code>help</code> || String || none || Help for players. A player in the zone sees it with <code>help area</code>. |
| − | | | ||
| − | | | ||
| − | |||
| − | |||
| − | |||
|- | |- | ||
| − | | | + | | <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. |
| − | | | + | |- |
| − | | | + | | <code>bonusband</code> || Number || <code>BONUS_NOT_APPLICABLE</code> (-1) || The zone's treasure band: how strong the treasure players earn here should be, from <code>BONUS_AVERAGE</code> (0) to <code>BONUS_ARTIFACT</code> (7), the scale items' bonuses use. Random treasure dropped by the zone's NPCs is at most this band (and at most the band of the NPC's own level). Towns, guilds and other zones outside the bands leave it out or give <code>BONUS_NOT_APPLICABLE</code>: no random treasure drops there. vmc refuses other values. DIL reads it as <code>z.bonusband</code>. |
| − | |||
| − | |||
| − | |||
| − | |||
|} | |} | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | 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. | |
| − | + | ||
| + | === 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. | ||
| + | <pre> | ||
| + | %zone | ||
| + | </pre> | ||
| + | |||
| + | Better than nothing: | ||
| + | <pre> | ||
| + | %zone bug_planet | ||
| + | </pre> | ||
| + | |||
| + | The way it should be done, in <code>dragon.zon</code>: | ||
| + | <pre> | ||
| + | %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." | |
| − | + | </pre> | |
| − | + | Each of these, with <code>#include <macros.h></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> | ||
Latest revision as of 12:06, 20 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.
| 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:
|
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. |
bonusband |
Number | BONUS_NOT_APPLICABLE (-1) |
The zone's treasure band: how strong the treasure players earn here should be, from BONUS_AVERAGE (0) to BONUS_ARTIFACT (7), the scale items' bonuses use. Random treasure dropped by the zone's NPCs is at most this band (and at most the band of the NPC's own level). Towns, guilds and other zones outside the bands leave it out or give BONUS_NOT_APPLICABLE: no random treasure drops there. vmc refuses other values. DIL reads it as z.bonusband.
|
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.