NZ:P Icon ⇑
⇑

JSON Data-Driving

Introduction

Nazi Zombies: Portable allows users and map makers to define gameplay behavior and HUD assets through .json files. Map authors can ship settings for one level, while users can select an overlay that applies to every map they play.

You do not need to copy the whole default configuration into a map or overlay file. Any omitted field keeps the value supplied by the previous file.

Both // line comments and /* block comments */ are accepted. Duplicate keys, values of the wrong type, and values outside the listed ranges cause the entire file to be rejected. A rejected map or overlay file leaves the settings from the previous layer alone.

Load Order

data/configuration/default.json defines the base set of NZ:P gameplay behaviors and is shipped with the game. It is always loaded first and should not be altered or overwritten by mods or usermaps.

After default.json, NZ:P attempts to load a map-specific JSON file from data/configuration/maps/<mapname>.json. This should be used by usermap authors who want settings tied to their own level.

Lastly, NZ:P attempts to load an overlay from data/configuration/overlays/<overlay>.json, where <overlay> is the value of the sv_gameconfig cvar. The cvar takes a filename without a path or .json extension.

The resulting order is:

  1. data/configuration/default.json
  2. data/configuration/maps/<mapname>.json
  3. data/configuration/overlays/<overlay>.json

Later files replace values from earlier files. Arrays are replaced as a whole. If a map defines two zombie attack sounds, for example, it will use those two sounds instead of keeping the remaining sounds from default.json.

JSON Specification

The values listed as defaults below are the values supplied by default.json.

gameplay

global

perksacola

packapunch

powerups

sounds

Options shared by every Power-Up

The objects powerup_max_ammo, powerup_instakill, powerup_double_points, powerup_carpenter, powerup_nuke, powerup_free_perk, powerup_bonus_points, and powerup_weapon_upgrade share the following fields:

The shared defaults for each Power-Up are:

Object enabled chance_to_allow_in_rotation disabled_before_round toast show_toast model voiceover
powerup_max_ammo true 1 0 Max Ammo! true models/pu/maxammo!.mdl sounds/pu/maxammo.wav
powerup_instakill true 1 0 Insta-Kill! false models/pu/instakill!.mdl sounds/pu/insta_kill.wav
powerup_double_points true 1 0 Double Points! false models/pu/x2!.mdl sounds/pu/double_points.wav
powerup_carpenter true 1 0 Carpenter! false models/pu/carpenter!.mdl sounds/pu/carpenter.wav
powerup_nuke true 1 0 Ka-Boom! false models/pu/nuke!.mdl sounds/pu/kaboom.wav
powerup_free_perk false 0.25 15 Random Perk! false models/pu/perkbottle!.mdl ""
powerup_bonus_points false 1 0 Bonus Points! false models/pu/points!.mdl ""
powerup_weapon_upgrade false 1 0 Weapon Upgrade! false models/pu/pack!.mdl ""

powerup_max_ammo

Max Ammo is enabled by default. Its rotation chance is 1, and it is available from the start of the game.

powerup_instakill

Insta-Kill is enabled by default. Its rotation chance is 1, and it is available from the start of the game.

powerup_double_points

Double Points is enabled by default. Its rotation chance is 1, and it is available from the start of the game.

powerup_carpenter

Carpenter is enabled by default. Its rotation chance is 1, and it is available from the start of the game.

powerup_nuke

Nuke is enabled by default. Its rotation chance is 1, and it is available from the start of the game.

powerup_free_perk

Free Perk is disabled by default. Its default rotation chance is 0.25, and it is unavailable before round 15.

powerup_bonus_points

Bonus Points is disabled by default. Its rotation chance is 1, and it is available from the start of the game.

powerup_weapon_upgrade

Weapon Upgrade is disabled by default. Its rotation chance is 1, and it is available from the start of the game.

ai

zombie.walk_styles

These booleans define which movement animations zombies may use. At least one must be true. If the preferred style is disabled, the zombie chooses the closest permitted style. Super sprint moves at 210 units per second.

zombie.sounds

Each field is an array containing up to 12 sound paths. One sound is selected at random when the corresponding event occurs. Empty entries are rejected, so remove an unwanted entry instead of leaving an empty string in the middle of the array.

player

health_regeneration

rounds

sounds

interface

Interface asset paths omit the file extension, path strings are limited to 63 characters.

perksacola

graphics

Each field defines the HUD image used for that perk:

powerups.graphics

rounds

graphics

equipment.graphics

score

graphics