Zone Config - torilmud/docs GitHub Wiki

Zone Config

The zone config file is used to set overall zone flags and settings. It also serves as the initial entry point for loading zone templates, which contain all of the commands used to load NPCs, items, squads, etc.

Example

{
  "name": "God Rooms",
  "id": 0,
  "climate": "arid",
  "filename": "god_rooms",
  "resetTime": 10,
  "resetMode": "always",
  "lastRoom": 99,
  "flags" : [
    "no teleport"
  ],
  "templateLoadList": [
    {
      "name": "standard",
      "mode": "overlay"
    }
  ]
}

Fields

  • name: The name of the zone.
  • id: The zone's vnum.
  • filename: The filename prefix of the zone.
  • climate: The zone's weather pattern. Valid options are: none, polar, cold, temperate, arid, or tropical.
  • resetTime: The number of minutes until the zone refreshes.
  • resetMode: The type of zone refresh. Valid options are: never, empty, always.
  • lastRoom: The vnum of the highest room in the zone.
  • description: The description of your zone when the player uses the world info <keyword> command. Optional, but must include this, keywords, and maker if you wish to use this feature. See this page for more info.
  • keywords: A list of keywords players may use to look up your zone. Optional.
  • maker: The name of the zone writer. Optional.
  • flags: A list of zone flags.
  • palette: Color palette for the zone.
  • templateLoadList: A list of templates to load. See the template section for more detail.
  • templateLoadSingle: A list of templates where only one will be chosen to load at boot time.
  • distros: A list of room distro definitions.
  • subzones: A list of subzone definitions.

Zone Flags

The following flags can be set, with their values being additive:

Flag Name Comments
"silent" Entire zone is silent
"safe" Entire zone is safe
"hometown" Zone is a hometown
"auto convert"
"no teleport"
"no magic"
"no recall"
"no summon"
"newbie recall" (RESTRICTED USE) allows -20 to recall to scardale
"evermeet" For zones located on evermeet
"high circle teleport" (summon, dimension door, dimensional fold and teleport won't work)
"no camp" (RESTRICTED USE) Voiding or camping here will send players to a safe room
"no clairvoyance" Can't use clairvoyance on players inside this zone

Color Palette

See: Colors - Palettes

Zone Templates

Zone templates contain all of the commands to make a zone come alive, including loading NPCs, items, and squads. They can also contain triggers that cause commands to be executed when a certain event happens in the zone. Templates can be loaded at boot from the .config file and also as a result of a zone command or trigger.

Zones can have as many templates as needed, and they can be stored in subdirectories inside of your zone. As long as the file ends in .tpl somewhere inside of your zone's directory, it can be loaded. Because of this, templates are a convenient way to organize your zone commands. You can divide them up however makes the most sense to you. For example, you may want to put all of your standard mob loads in one file, and create separate files for each invasion. You could also split it up by command type, and put all of your door flags in one file, NPCs in another, etc.

Template Loads

Wherever you load a template, the format follows a standard JSON object that looks like this:

{
  "name": "standard",
  "mode": "overlay",
  "chance": 100
}
  • name: This is the name of the template to load. This should match the name field in the template file that you want to load. You can also load your old .zon file using this as well to make a hybrid of both versions. The name must be legacy to load that file as a template. If you are loading the old .zon file as a legacy template, you MUST load a new .tpl file as well. This can be as simple as a single npc or door load.
  • mode: When loading a template, you can choose whether it overlays the existing commands or replaces them. The options are overlay or replace. It will default to overlay.
  • chance: This is the 0-100% chance to load the template. Defaults to 100.

templateLoadList

Use this field to load a list of templates. You can assign a chance to template loads here to handle rare events. For instance, you may want to load all of your standard templates here as well as an "invasion" style template that has a chance to load, like this:

  "templateLoadList": [
    {
      "name": "Doors",
      "mode": "overlay"
    },
    {
      "name": "NPCs",
      "mode": "overlay"
    },
    {
      "name": "Myconid Invasion",
      "mode": "replace",
      "chance": 10
    }
  ]

templateLoadSingle

Use this field to randomly load just one template from a list. This can be used in conjunction with templateLoadList. This could be used for selecting between various invasions or are load patterns in a boot. For example, you could use something like the below to randomly select between a different invasion each boot. Note that the chance field is processed after a template has been selected. So in this case, there is an equal chance to select any of the invasions below, but each one then has to pass a 5% check to actually be loaded.

  "templateLoadSingle": [
    {
      "name": "Fire Giant Invasion",
      "mode": "replace",
      "chance": 5
    },
    {
      "name": "Frost Giant Invasion",
      "mode": "replace",
      "chance": 5
    },
    {
      "name": "Cloud Giant Invasion",
      "mode": "replace",
      "chance": 5
    }
  ]

Subzones

Subzones are collections of rooms within a zone that are grouped together. You can use limit NPCs to these subzones and also use them as a target for loading NPCs and items. Subzones can be defined in the .config file and the specified rooms will be automatically configured as belonging to their subzone. A room can only belong to one subzone at a time.

"subzones": [
    {
      "id": 1,
      "name": "Pirate Ship",
      "vnums": [98375],
      "vnumStart": 98344,
      "vnumEnd": 98366,
      "excludedVnums": [98364],
      "roomFlags": ["indoors"]
    }
]
  • id: Id of the subzone. Required.
  • name: The name of the subzone. This will be used when loading NPCs/items randomly into the subzone.
  • vnums: An array of room numbers belonging to the subzone. Optional
  • vnumStart: The start of a range of vnums to add to the subzone. Optional.
  • vnumEnd: The end of a range of vnums to add to the subzone. Required if vnumStart is used.
  • excludedVnums: An array of rooms to exclude from the subzone. This is only needed to exclude vnums that would otherwise be added due to the vnum ranges. In the example above, we added 98344 through 98366, but excluded 98364 even though it was in that range. This is handy because ranges of vnums aren't always dependable.
  • roomFlags: Sets room flags for specified subzone. Optional.

Distros

Distros are a simple collection of rooms used to distribute NPCs and items randomly to an area in your zone. Rooms can belong to an infinite number of distros. They look similar to subzones:

"distros": [
    {
      "name": "Exterior Beach",
      "vnumStart": 98301,
      "vnumEnd": 98313,
      "excludedVnums": [98303]
    }
]
  • name: The name of the distro. This is used when targeting an NPC or item to this distro.
  • vnums: An array of room numbers belonging to the distro. Optional
  • vnumStart: The start of a range of vnums to add to the distro. Optional.
  • vnumEnd: The end of a range of vnums to add to the distro. Required if vnumStart is used.
  • excludedVnums: An array of rooms to exclude from the distro. This is only needed to exclude vnums that would otherwise be added due to the vnum ranges. In the example above, we added 98301 through 98313, but excluded 98303 even though it was in that range. This is handy because ranges of vnums aren't always dependable.
  • sector: Sector type(s) to load NPCs or Items into. Optional
  • excludeSector: Sector types to exclude loading NPCs or Items into. Optional.
  • includeRoomFlags: Room flags to load NPCs or Items into. Optional.
  • excludeRoomFlags: Room flags to exclude NPCs or Items from loading into. Optional.

Loot Tables

See: Zone Docs - Loot Tables

⚠️ **GitHub.com Fallback** ⚠️