-
Notifications
You must be signed in to change notification settings - Fork 12
[ZM] Tweakables
There are many different variables that can be altered from a custom script because they are global(level) variables. This page will go over them so allowing you to get an idea of what you can easily tweak by setting a value.
Zombie vars are initialized and set by maps/mp/zombies/_zm_utility::set_zombie_var( var, value, is_float, column, is_team_based )
and are stored in an array called level.zombie_vars. The is_team_based
argument indicates whether the zombie var is also an array where each team gets a different value. Zombie vars are useful for storing and accessing data controlling certain aspects of the game.
A list of all zombie vars and their default values is below. All zombie vars can be set from an init() function in a custom script.
Team Vars:
level.zombie_vars[ "allies" ][ "zombie_insta_kill" ] = false;
//Stores whether insta kill powerup effect is currently active for the allies team.
level.zombie_vars[ "allies" ][ "zombie_point_scalar" ] = 1;
//Stores the current points multiplier for the allies team.
level.zombie_vars[ "allies" ][ "zombie_powerup_insta_kill_on" ] = false;
//Stores whether insta kill is active for the allies team for hud purposes.
level.zombie_vars[ "allies" ][ "zombie_powerup_insta_kill_time" ] = 30;
//Stores the current duration of an insta kill powerup for the allies team. Manually setting this won't change the effective duration.
level.zombie_vars[ "allies" ][ "zombie_powerup_point_doubler_on" ] = false;
//Stores whether double points is active for the allies team for hud purposes.
level.zombie_vars[ "allies" ][ "zombie_powerup_point_doubler_time" ] = 30;
//Stores the current duration of a double points powerup for the allies team. Manually setting this won't change the effective duration.
level.zombie_vars[ "axis" ][ "zombie_insta_kill" ] = false;
//Stores whether insta kill powerup effect is currently active for the axis team.
level.zombie_vars[ "axis" ][ "zombie_point_scalar" ] = 1;
//Stores the current points multiplier for the axis team.
level.zombie_vars[ "axis" ][ "zombie_powerup_insta_kill_on" ] = false;
//Stores whether insta kill is active for the axis team for hud purposes.
level.zombie_vars[ "axis" ][ "zombie_powerup_insta_kill_time" ] = 30;
//Stores the current duration of an insta kill powerup for the axis team. Manually setting this won't change the effective duration.
level.zombie_vars[ "axis" ][ "zombie_powerup_point_doubler_on" ] = false;
//Stores whether double points is active for the axis team for hud purposes.
level.zombie_vars[ "axis" ][ "zombie_powerup_point_doubler_time" ] = 30;
//Stores the current duration of a double points powerup for the axis team. Manually setting this won't change the effective duration.
Normal Vars:
level.zombie_vars[ "below_world_check" ] = -1000;
//If an actor goes below this value in the z coordinate that zombie will be respawned.
level.zombie_vars[ "dog_fire_trail_percent" ] = 50;
//Chance that a hellhound will spawn with the fire effect.
level.zombie_vars[ "game_start_delay" ] = 0;
//Time the game will wait for the first round to start.
level.zombie_vars[ "penalty_died" ] = 0.0;
//Player loses this percentage of points when they die.
level.zombie_vars[ "penalty_downed" ] = 0.05;
//Player loses this percentage of points when they down. Reviver gets these points on revive.
level.zombie_vars[ "penalty_no_revive" ] = 0.1;
//Alive players on a team lose this percentage of points when a player dies.
level.zombie_vars[ "spectators_respawn" ] = true;
//When false players do not respawn at the end of a round.
level.zombie_vars[ "starting_lives" ] = 0;
//Unused
level.zombie_vars[ "zombie_ai_per_player" ] = 6;
//A part of the formula for determining the amount of zombies per round. Acts as a multiplier.
level.zombie_vars[ "zombie_between_round_time" ] = 10;
//Delay between rounds before new zombies can spawn.
level.zombie_vars[ "zombie_drop_item" ] = false;
//When true the next zombie killed will drop a powerup. Set to false when a powerup drops this way.
level.zombie_vars[ "zombie_flame_dmg_point_delay" ] = 500;
//Part of unused flamethrower related code.
level.zombie_vars[ "zombie_health_increase" ] = 100;
//Flat amount of health gained as a part of the zombie health formula. Only applies to the first ten rounds of zombies spawned.
level.zombie_vars[ "zombie_health_increase_multiplier" ] = 0.1;
//Exponential multiplier of health for the zombie health formula. Applies to rounds after ten.
level.zombie_vars[ "zombie_health_start" ] = 150;
//Starting health for zombies spawned and the zombie health formula.
level.zombie_vars[ "zombie_intermission_time" ] = 15;
//Delay after the end game intermission starts and leads into the fade to black.
level.zombie_vars[ "zombie_max_ai" ] = 24;
//Part of the zombies per round formula. Acts as the base value.
level.zombie_vars[ "zombie_move_speed_multiplier" ] = 8;
//A part of the zombie speed up formula. Acts as a multiplier. Used when the gametype setting "zmDifficulty" is 1.
level.zombie_vars[ "zombie_move_speed_multiplier_easy" ] = 2;
//A part of the zombie speed up formula. Acts as a multiplier. Used when the gametype setting "zmDifficulty" is 0.
level.zombie_vars[ "zombie_new_runner_interval" ] = 10;
//Unused
level.zombie_vars[ "zombie_perk_cost" ] = 2000;
//Failsafe price for unknown perks.
level.zombie_vars[ "zombie_perk_juggernaut_health" ] = 250;
//Health set for the Juggernog perk.
level.zombie_vars[ "zombie_perk_juggernaut_health_upgrade" ] = 190;
//Health set for the Juggernog perma perk. Stacks with normal Juggernog.
level.zombie_vars[ "zombie_powerup_bonfire_sale_on" ] = false;
//Part of an unused feature.
level.zombie_vars[ "zombie_powerup_bonfire_sale_time" ] = 30;
//Part of an unused feature.
level.zombie_vars[ "zombie_powerup_drop_increment" ] = 2000;
//Starting value for the guaranteed powerup drop formula. Lower values causes powerups to drop very often until
level.zombie_vars[ "zombie_powerup_drop_max_per_round" ] = 4;
//Maximum number of powerups that can drop per round.
level.zombie_vars[ "zombie_powerup_fire_sale_on" ] = false;
//Stores whether firesale is active.
level.zombie_vars[ "zombie_powerup_fire_sale_time" ] = 30;
//Stores the current duration of a firesale powerup. Manually setting this won't change the effective duration.
level.zombie_vars[ "zombie_score_bonus_burn" ] = 10;
//Part of unused flamethrower related code.
level.zombie_vars[ "zombie_score_bonus_head" ] = 50;
//Flat increase for the points formula when getting a head shot kill.
level.zombie_vars[ "zombie_score_bonus_melee" ] = 80;
//Flat increase for the points formula when getting a melee kill.
level.zombie_vars[ "zombie_score_bonus_neck" ] = 20;
//Flat increase for the points formula when getting a neck kill.
level.zombie_vars[ "zombie_score_bonus_torso" ] = 10;
//Flat increase for the points formula when getting a torso kill.
level.zombie_vars[ "zombie_score_damage_light" ] = 10;
//Unused
level.zombie_vars[ "zombie_score_damage_normal" ] = 10;
//Points earned for damaging a zombie.
level.zombie_vars[ "zombie_score_kill_1p_team" ] = 0;
//Part of unused team points feature.
level.zombie_vars[ "zombie_score_kill_1player" ] = 50;
//Base points for the points formula for killing a zombie. Only used when there is only one player in the match.
level.zombie_vars[ "zombie_score_kill_2p_team" ] = 0;
//Part of unused team points feature.
level.zombie_vars[ "zombie_score_kill_2player" ] = 50;
//Base points for the points formula for killing a zombie. Only used when there is two players in the match.
level.zombie_vars[ "zombie_score_kill_3p_team" ] = 0;
//Part of unused team points feature.
level.zombie_vars[ "zombie_score_kill_3player" ] = 50;
//Base points for the points formula for killing a zombie. Only used when there is three players in the match.
level.zombie_vars[ "zombie_score_kill_4p_team" ] = 0;
//Part of unused team points feature.
level.zombie_vars[ "zombie_score_kill_4player" ] = 50;
//Base points for the points formula for killing a zombie. Always used when there are four or more players in a match.
level.zombie_vars[ "zombie_spawn_delay" ] = 2.0;
//Time in seconds before a new zombie can be spawned. Min delay is 0.08, but in the spawning function, wait_network_frame() causes the delay to be
//0.18 actual seconds.
level.zombie_vars[ "zombie_timer_offset" ] = 350;
//Used by the max ammo powerup for the hud message.
level.zombie_vars[ "zombie_timer_offset_interval" ] = 30;
//Used by the max ammo powerup for the hud message.
level.zombie_vars[ "zombie_use_failsafe" ] = true;
//Whether a zombie will be respawned if they end up in the same spot they were at 30 seconds ago.
level.zombie_vars[ "zombify_player" ] = false;
//Prototype feature to Turned gametype.
Function overrides are functions stored as a variable allowing you to override them by pointing the variable to a new function. Using a function pointer will allow you to easily modify more of the game's mechanics by writing your own code or simply modifying the values of local variables.
Function overrides sometimes vary at which times in the script load they can be overridden, and in some cases they are already being overridden by the base game. In cases where the game logic only reads from the override once, using replacefunc() to replace the function the override is pointing to is recommended. Recommended override method is indicated in the corresponding comment.
level.callbackactordamage = maps/mp/zombies/_zm::actor_damage_override_wrapper;
//Best overridden with init().
//This is called by code when an actor is damaged to allow script to modify the final outcome.
//It allows easily modifying the damage and much more before damage to the actor is finalized by code.
level.callbackactorkilled = maps/mp/zombies/_zm::actor_killed_override;
//Best overridden with init().
//This is called by code when an actor is killed to allow script to receive data about the death.
//The actor is already dead by the time it reaches this callback.
level.callbackhostmigration = maps/mp/gametypes_zm/_hostmigration::callback_hostmigration;
//Best overridden with init(). Called when a hostmigration occurs. Not currently relevant to Plutonium.
level.callbackhostmigrationsave = maps/mp/gametypes_zm/_hostmigration::callback_hostmigrationsave;
//Best overridden with init(). Called when a host migration save occurs. Default logic is blank.
level.callbackplayerconnect = maps/mp/gametypes_zm/_globallogic_player::callback_playerconnect;
//Best overridden with init(). Called when a player connects.
level.callbackplayerdamage = maps/mp/zombies/_zm::callback_playerdamage;
//Best overridden with init(). Called when a player takes damage.
//Can be used to modify the damage taken or receive data about the damage instance.
level.callbackplayerdisconnect = maps/mp/gametypes_zm/_globallogic_player::callback_playerdisconnect;
//Best overridden with init(). Called when a player disconnects. Uses self to represent the disconnected player.
level.callbackplayerkilled = maps/mp/zombies/_zm::player_killed_override;
//Best overridden with init(). In ZM this is set to do nothing and instead laststand is what is used.
level.callbackplayerlaststand = maps/mp/zombies/_zm::callback_playerlaststand;
//Best overridden with init(). Called when a player goes into laststand, usually on taking too much damage.
level.callbackplayermelee = maps/mp/gametypes_zm/_globallogic_player::callback_playermelee;
//Best overridden with init(). Called when a player melees.
//Can be used to prevent melee hits from causing damage or making the stab sound.
level.callbackplayermigrated = maps/mp/gametypes_zm/_globallogic_player::callback_playermigrated;
//Best overridden with init(). Called when a player is migrated during hostmigration.
level.callbackstartgametype = maps/mp/gametypes_zm/_globallogic::callback_startgametype;
//Difficult to override as the gametype::main() sets it which comes after custom_script::main(), and
//custom_script::init() executes after this is executed. Replacefunc() is recommended instead.
//Sets up the gametype logic.
level.callbackvehicledamage = maps/mp/gametypes_zm/_globallogic::blank;
//Best overridden with init(). Unused in ZM.
level.canplayersuicide = maps/mp/gametypes_zm/_zm_gametype::canplayersuicide;
//Best overridden with init(). Used for the suicide prompt for tombstone when in laststand.
level._game_module_custom_spawn_init_func = maps/mp/gametypes_zm/_zm_gametype::custom_spawn_init_func;
//Difficult to override as the mapname::main() sets it which comes after custom_script::main(), and
//custom_script::init() executes after this is executed. Replacefunc() is recommended instead.
//Adds some spawn functions for zombies spawners.
level.global_damage_func = maps/mp/zombies/_zm_spawner::zombie_damage;
//Best overridden with init().
//Function that executes whenever a zombie takes damage from all sources except from an ADSing player.
level.global_damage_func_ads = maps/mp/zombies/_zm_spawner::zombie_damage_ads;
//Best overridden with init().
//Function that executes whenever a zombie takes damage from an ADSing player.
level.onspawnplayerunified = maps/mp/gametypes_zm/_zm_gametype::onspawnplayerunified;
//Best overridden with init().
//Executes whenever a player is spawned. Executes different logic on subsequent spawns versus first spawn.
level.overrideplayerdamage = maps/mp/zombies/_zm::player_damage_override;
//Best overridden with init().
//Used to override damage taken by players from all sources.
level.player_becomes_zombie = maps/mp/zombies/_zm::zombify_player;
//Best overridden with init().
//Subtracts player died penalty zombie var value from all players on player death.
//Turns self into a spectator unless zombie var "zombify_player" is true.
level.player_too_many_weapons_monitor_func = maps/mp/zombies/_zm::player_too_many_weapons_monitor;
//Best overridden with init().
//Watcher that takes all players weapons and points when they exceed the weapon limit.
//Weapon limit is two and three without and with mule kick respectively.
level.playerlaststand_func = maps/mp/zombies/_zm::player_laststand;
//Best overridden with init().
//Function is called when a player is put into laststand.
level.prevent_player_damage = maps/mp/zombies/_zm::player_prevent_damage;
//Best overridden with init().
//Function overrides damage dealt to another player on the same team.
level.round_spawn_func = maps/mp/zombies/_zm::round_spawning;
//Best overridden with init().
//Function used to spawn enemies for the round. Used normally for hellhound round spawning.
level.round_think_func = maps/mp/zombies/_zm::round_think;
//Best overridden with init().
//Function used to manage the round system.
level.round_wait_func = maps/mp/zombies/_zm::round_wait;
//Best overridden with init().
//Function acts as a waiter which ends when the last zombie dies allowing the round to end.
These are variables which are attached to the level script entity and are generally useful to modify or read from.
level.default_laststandpistol = "m1911_zm";
//Best overridden with init(). Sets the default laststand pistol for coop.
//This is "c96_zm" on Origins.
level.default_solo_laststandpistol = "m1911_upgraded_zm";
//Best overridden with init(). Sets the default laststand pistol for solo.
//This is "c96_upgraded_zm" on Origins.
level.dog_health = 100;
//This gets overridden every dog round so its recommended to replacefunc() dog_health_increase() instead.
level.perk_purchase_limit = 4;
//Best overridden with init(). Sets the global perk purchases limit.
//Origins uses a perk purchase limit per player for the golden shovel which has a higher priority than this one.
level.player_out_of_playable_area_monitor = true;
//Best overridden with init(). Enables the out of playable area monitor.
level.player_starting_points = 500;
//Best overridden with init(). Sets the starting points when a player joins.
level.player_too_many_weapons_monitor = true;
//Best overridden with init(). Enables the too many weapons monitor.
//level.players = [];
//Array of all the players in the match. Automatically allocated and deallocated when a player joins or leaves.
level.round_number = 1;
//Best overridden with init(). Requires more code to properly set the spawn rate, and speed of the zombies.
//Current round number the match is at.
level.scr_zm_map_start_location = "nuked";
//The current location the map is on.
level.scr_zm_ui_gametype = "zstandard";
//The current gametype.
level.scr_zm_ui_gametype_group = "zsurvival";
//The current gamemode group.
level.start_weapon = "m1911_zm";
//On Origins this is "c96_zm".
level.zombie_total = 0;
//The max amount of zombies spawned in each round.