What are zones? Why do I need them?
Zones are used to divide your map into "areas" or "sections". Each section has one or more zombie spawn locations which are activated when players are standing within the zone, and deactivated when no players are present. At least one zone is required in order for zombies to spawn on a map which runs the latest Mod Tools scripts (v1.4).
What are "adjacent" zones?
Adjacent zones are exactly what the name implies. They are zones which are directly adjacent to (or "neighboring", "bordering") another zone. The game uses adjacent zones to activate nearby zones to the players to give the illusion that zombies are "coming from all directions". It makes it harder for the players to escape an oncoming wave of zombies.
How to set up Zones
To create a zone volume in Radiant, right-click the 2d view and from the Info menu, click Volume. This will create a brush with the "Volume Texture" on it. You must create volumes this way. You cannot just draw a normal brush and then apply the Volume tool-texture to it.
Stretch the brush to cover a section of your map. You want each zone to represent an area which has been sectioned off by buy-able barriers/debris.
Make sure you cover ALL playable area with zones volumes. If a player steps outside of a zone at any time, the game will freeze for a few seconds and zombies will not be able to find the player.
In order to accurately cover an area with a zone volume, you may need to use multiple brushes (see Fig. 1). This is OK as long as you give the additional zone pieces the same KVPs.
Setting the KVP's
NOTE: KVP is an abbreviation for "Key-Value Pair". When entering a KVP in the Radiant Entity Window, ensure that you have the entity selected first. If you do not have an entity selected, Radiant will automatically add the KVP to the "worldspawn" entity. This is BAD and will likely cause your map to crash while loading! In these pages, KVP's are referred to in this format: Key | Value. Note they are separated by a pipe ( | ) character. This character should be ignored when entering the Key-Value Pair.
To properly add a KVP to an entity:
- Select the entity by holding the Shift key on your keyboard followed by clicking the entity(ies) that you wish to add a KVP to.
- Enter the first value (this is the Key) into the text field labeled "Key"
- Enter the second value (this is the Value) into the text field labaled "Value".
- Press the Enter key on your keyboard to save the KVP to the entity. You should see the KVP appear in the entity's KVP table (located above the Key text field).
Select the zone volume(s) and give them the following KVP's:
- Replace <zone_name> with a name for the zone. Remember the names you give these zones because you will need to recall them later.
Make sure to append "_spawners" to the zone name when entering the target value - this will tell the zone which zombie spawners it will activate.Note: Each area should have its own unique name to prevent conflict with other areas you have created. Your names can be as simple as "zone1", "zone2", etc, or you can name them specifically like "twostory_house_2nd_floor".
Each zone's purpose is to activate/deactive the zombie spawners it is linked to. In order for this to work properly you must correctly link your zombie & dog spawners to your zones.
For more info on how to create a zombie or dog spawner, see
Select the spawners which you want to link to a zone. Give them the following KVP:
Select the zone volume(s) and give them the following KVP's:
- Replace <zone_name> with the zone name which this spawner should be linked to. This should match the value you set for the "target" key of the zone volumes. A zombie AI spawner which is properly linked to a zone will be connected to the zone with a yellow line in Radiant, assuming the zone has not been hidden.
Remember that all of your riser and dog structs need to have the proper targetname to work properly with zones. See Creating Zombie and Dog Spawners for more info.
NOTE: "mapname.gsc" refers to your map's main gsc file, which is named the same name as your map. For example, a map called "nazi_zombie_example" would have a mapname.gsc named "nazi_zombie_example.gsc". This file is commonly used to call custom scripts for a map. Lines which precache items such as models need to be called BEFORE the gamestate starts and should not be threaded. Lines which do not precache any items should be called AFTER the gamestate starts and should be threaded. The gamestate is started by this line in mapname.gsc: To add lines to your mapname.gsc:
NOTE: "mapname.gsc" refers to your map's main gsc file, which is named the same name as your map.
For example, a map called "nazi_zombie_example" would have a mapname.gsc named "nazi_zombie_example.gsc". This file is commonly used to call custom scripts for a map.
Lines which precache items such as models need to be called BEFORE the gamestate starts and should not be threaded. Lines which do not precache any items should be called AFTER the gamestate starts and should be threaded.
The gamestate is started by this line in mapname.gsc:
To add lines to your mapname.gsc:
Declaring the start zone
You must tell the game the name of the zone which players spawn inside at the start of the game. Since this zone is not activated by debris, it is declared differently than normal zones.
Find this line in your mapname.gsc
Change "initial_zone" to match the name of your start zone. Typically people use "start_zone" as their name, but if you want to save a step you could just use "initial_zone".
Declaring Adjacent Zones
Find this block of code in your mapname.gsc:
Here you should see that Treyarch has already been kind enough to provide a brief description of how to set up your zones. I will not go to the trouble of repeating what is already written there, instead I will expand upon it for clarity.
Below the "Outside East Door" example is where you will be adding your own adjacent zone definitions. To begin, copy this code below the example add_adjacent_zone line (which has been commented out):
- "zone_name" should be replaced with the name of the area which you are declaring adjacency to.
- "adjacent_zone_name" should be replaced with the name of the area which is adjacent to the zone you specified for "zone_name".
- "flag_to_activate_zone_name" should be replaced with a unique text string which matches the script_flag of the debris that activates the zone. Traditionally people use "enter_<zone_name>", but you can use whatever you like.
- The last parameter, "one_way", is rarely ever used and therefore was not specified in the sample line. This is a true/false bool which defaults to false when not specified. If set to true, once the zone is activated, the game assumes that the adjacency from one zone to another is not bi-directional. In certain cases you may have a drop-off where players can drop to a new area but cannot climb back up the drop. This an example scenario where you should set "one_way" to true.
For every area you created in Radiant (ex; "zone1", "zone2", etc), you will need to paste a copy of the sample line at least once. If there are multiple zones adjacent to your zone then you will have multiple add_adjacent_zone() calls for the same zone_name.
The best way is to learn by example. Consider the following snippet from UGX Comosea's mapname.gsc:
As you can see, one zone can have multiple adjacent ones.
Zones must be activated by the script_flag KVP on a barrier, blocker, debris, or door. Ensure the script_flag matches what you specified for the zone in your mapname.gsc
Help! I get a script_runtime error or my game lags...
...when I spawn into my map
You probably forgot to set up your start_zone in your mapname.gsc. See Declaring the start zone.
...when I enter a new zone
Add zone_debugger.iwd to your C:\Users\<USERNAME>\AppData\Local\Activision\CoDWaW\mods\mapname folder and run the map. Pause the game and check the console output after you spawn.
Scroll all the way to the bottom of the console window and look for any yellow] lines or red lines ]. You need to resolve all of these yellow/red issues to solve this script_runtime error.
If you don't see any yellow ['s or red [ , then proceed by buying your way to the zone which causes the error/freeze. Now check the console again for any yellow 's or red . Follow the directions that the lines give you.
Please remember to REMOVE the zone_debugger IWD from your map folder before releasing your map.