Hello,
In order to stop Zombies from dying by being Idle for too long & if they are far from you, you change these functions ( This is for Origins, Other maps should be the same by replacing the names and some don't use a function from this ), First Idle:
tomb_round_spawn_failsafe()//tomp is Origins name
replace OR comment out:
self dodamage( self.health + 100, ( 0, 0, 0 ) );
level.zombie_total++;
level.zombie_total_subtract++;
zombie_damage_failsafe()//this for damaged or missing limbs
replace OR comment out:
self.enemy dodamage( self.enemy.health + 1000, self.enemy.origin, self, self, "none", "MOD_RIFLE_BULLET" );
continue_failsafe_damage = 1;
for far away:
delete_zombie_noone_looking( how_close, how_high )//every map has this
replace OR comment out:
self notify( "zombie_delete" );
self delete();
level.zombie_total++; level.zombie_respawned_health[level.zombie_respawned_health.size] = self.health;
here is a GSC script for Origins:
#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\zombies\_zm_utility;
main()
{
replaceFunc(maps\mp\zm_tomb_distance_tracking::delete_zombie_noone_looking, ::delete_zombie_noone_looking);
replaceFunc(maps\mp\zm_tomb::tomb_round_spawn_failsafe, ::tomb_round_spawn_failsafe);// tomb is origins name
replaceFunc(maps\mp\zombies\_zm::round_spawn_failsafe, ::round_spawn_failsafe);
}
delete_zombie_noone_looking( how_close, how_high )
{
self endon( "death" );
if ( !isdefined( how_close ) )
how_close = 1500;
if ( !isdefined( how_high ) )
how_high = 600;
distance_squared_check = how_close * how_close;
too_far_dist = distance_squared_check * 3;
if ( isdefined( level.zombie_tracking_too_far_dist ) )
too_far_dist = level.zombie_tracking_too_far_dist * level.zombie_tracking_too_far_dist;
self.inview = 0;
self.player_close = 0;
n_distance_squared = 0;
n_height_difference = 0;
players = get_players();
for ( i = 0; i < players.size; i++ )
{
if ( players[i].sessionstate == "spectator" )
continue;
if ( isdefined( level.only_track_targeted_players ) )
{
if ( !isdefined( self.favoriteenemy ) || self.favoriteenemy != players[i] )
continue;
}
can_be_seen = self player_can_see_me( players[i] );
if ( can_be_seen && distancesquared( self.origin, players[i].origin ) < too_far_dist )
self.inview++;
n_modifier = 1.0;
if ( isdefined( players[i].b_in_tunnels ) && players[i].b_in_tunnels )
n_modifier = 2.25;
n_distance_squared = distancesquared( self.origin, players[i].origin );
n_height_difference = abs( self.origin[2] - players[i].origin[2] );
if ( n_distance_squared < distance_squared_check * n_modifier && n_height_difference < how_high )
self.player_close++;
}
if ( self.inview == 0 && self.player_close == 0 )
{
if ( !isdefined( self.animname ) || self.animname != "zombie" && self.animname != "mechz_zombie" )
return;
if ( isdefined( self.electrified ) && self.electrified == 1 )
return;
if ( isdefined( self.in_the_ground ) && self.in_the_ground == 1 )
return;
zombies = getaiarray( "axis" );
if ( ( !isdefined( self.damagemod ) || self.damagemod == "MOD_UNKNOWN" ) && self.health < self.maxhealth )
{
if ( !( isdefined( self.exclude_distance_cleanup_adding_to_total ) && self.exclude_distance_cleanup_adding_to_total ) && !( isdefined( self.isscreecher ) && self.isscreecher ) )
{
empty = 0;
//level.zombie_total++;
//level.zombie_respawned_health[level.zombie_respawned_health.size] = self.health;
}
}
else if ( zombies.size + level.zombie_total > 24 || zombies.size + level.zombie_total <= 24 && self.health >= self.maxhealth )
{
if ( !( isdefined( self.exclude_distance_cleanup_adding_to_total ) && self.exclude_distance_cleanup_adding_to_total ) && !( isdefined( self.isscreecher ) && self.isscreecher ) )
{
empty = 1;
//level.zombie_total++;
if ( self.health < level.zombie_health )
level.zombie_respawned_health[level.zombie_respawned_health.size] = self.health;
}
}
self maps\mp\zombies\_zm_spawner::reset_attack_spot();
//self notify( "zombie_delete" );
empty = 0;
if ( isdefined( self.is_mechz ) && self.is_mechz )
{
self notify( "mechz_cleanup" );
level.mechz_left_to_spawn++;
wait_network_frame();
level notify( "spawn_mechz" );
}
empty = 0;
//self delete();
recalc_zombie_array();
}
}
tomb_round_spawn_failsafe()
{
self endon( "death" );
prevorigin = self.origin;
while ( true )
{
if ( isdefined( self.ignore_round_spawn_failsafe ) && self.ignore_round_spawn_failsafe )
return;
wait 15;
if ( isdefined( self.is_inert ) && self.is_inert )
continue;
if ( isdefined( self.lastchunk_destroy_time ) )
{
if ( gettime() - self.lastchunk_destroy_time < 8000 )
continue;
}
if ( self.origin[2] < -3000 )
{
if ( isdefined( level.put_timed_out_zombies_back_in_queue ) && level.put_timed_out_zombies_back_in_queue && !flag( "dog_round" ) && !( isdefined( self.isscreecher ) && self.isscreecher ) )
{
empty = 0;
//level.zombie_total++;
//level.zombie_total_subtract++;
}
empty = 0;
//self dodamage( self.health + 100, ( 0, 0, 0 ) );
break;
}
if ( distancesquared( self.origin, prevorigin ) < 576 )
{
if ( isdefined( level.put_timed_out_zombies_back_in_queue ) && level.put_timed_out_zombies_back_in_queue && !flag( "dog_round" ) )
{
if ( !self.ignoreall && !( isdefined( self.nuked ) && self.nuked ) && !( isdefined( self.marked_for_death ) && self.marked_for_death ) && !( isdefined( self.isscreecher ) && self.isscreecher ) && ( isdefined( self.has_legs ) && self.has_legs ) && !( isdefined( self.is_brutus ) && self.is_brutus ) )
{
empty = 0;
//level.zombie_total++;
//level.zombie_total_subtract++;
}
}
level.zombies_timeout_playspace++;
empty = 0;
//self dodamage( self.health + 100, ( 0, 0, 0 ) );
break;
}
prevorigin = self.origin;
}
}
round_spawn_failsafe()
{
self endon( "death" );
prevorigin = self.origin;
while ( true )
{
if ( !level.zombie_vars["zombie_use_failsafe"] )
return;
if ( isdefined( self.ignore_round_spawn_failsafe ) && self.ignore_round_spawn_failsafe )
return;
wait 30;
if ( !self.has_legs )
wait 10.0;
if ( isdefined( self.is_inert ) && self.is_inert )
continue;
if ( isdefined( self.lastchunk_destroy_time ) )
{
if ( gettime() - self.lastchunk_destroy_time < 8000 )
continue;
}
if ( self.origin[2] < level.zombie_vars["below_world_check"] )
{
if ( isdefined( level.put_timed_out_zombies_back_in_queue ) && level.put_timed_out_zombies_back_in_queue && !flag( "dog_round" ) && !( isdefined( self.isscreecher ) && self.isscreecher ) )
{
empty = 0;
//level.zombie_total++;
//level.zombie_total_subtract++;
}
/#
#/
empty = 0;
//self dodamage( self.health + 100, ( 0, 0, 0 ) );
break;
}
if ( distancesquared( self.origin, prevorigin ) < 576 )
{
if ( isdefined( level.put_timed_out_zombies_back_in_queue ) && level.put_timed_out_zombies_back_in_queue && !flag( "dog_round" ) )
{
if ( !self.ignoreall && !( isdefined( self.nuked ) && self.nuked ) && !( isdefined( self.marked_for_death ) && self.marked_for_death ) && !( isdefined( self.isscreecher ) && self.isscreecher ) && ( isdefined( self.has_legs ) && self.has_legs ) )
{
empty = 0;
//level.zombie_total++;
//level.zombie_total_subtract++;
}
}
level.zombies_timeout_playspace++;
/#
#/
empty = 0;
//self dodamage( self.health + 100, ( 0, 0, 0 ) );
break;
}
prevorigin = self.origin;
}
}
here is a GSC script for Buried:
#include maps\mp\gametypes_zm\_hud_util;
#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\zombies\_zm_utility;
#include maps\mp\gametypes_zm\_spawnlogic;
main()
{
replaceFunc(maps\mp\zm_buried_distance_tracking::delete_zombie_noone_looking, ::delete_zombie_noone_looking);
replaceFunc(maps\mp\zombies\_zm::round_spawn_failsafe, ::round_spawn_failsafe);
}
delete_zombie_noone_looking( how_close, how_high )
{
self endon( "death" );
if ( self can_be_deleted_from_buried_special_zones() )
{
self.inview = 0;
self.player_close = 0;
}
else
{
if ( !isdefined( how_close ) )
how_close = 1000;
if ( !isdefined( how_high ) )
how_high = 500;
if ( !( isdefined( self.has_legs ) && self.has_legs ) )
how_close = how_close * 1.5;
distance_squared_check = how_close * how_close;
height_squared_check = how_high * how_high;
too_far_dist = distance_squared_check * 3;
if ( isdefined( level.zombie_tracking_too_far_dist ) )
too_far_dist = level.zombie_tracking_too_far_dist * level.zombie_tracking_too_far_dist;
self.inview = 0;
self.player_close = 0;
players = get_players();
foreach ( player in players )
{
if ( player.sessionstate == "spectator" )
continue;
if ( isdefined( player.laststand ) && player.laststand && ( isdefined( self.favoriteenemy ) && self.favoriteenemy == player ) )
{
if ( !self can_zombie_see_any_player() )
{
self.favoriteenemy = undefined;
self.zombie_path_bad = 1;
self thread escaped_zombies_cleanup();
}
}
if ( isdefined( level.only_track_targeted_players ) )
{
if ( !isdefined( self.favoriteenemy ) || self.favoriteenemy != player )
continue;
}
can_be_seen = self player_can_see_me( player );
distance_squared = distancesquared( self.origin, player.origin );
if ( can_be_seen && distance_squared < too_far_dist )
self.inview++;
if ( distance_squared < distance_squared_check && abs( self.origin[2] - player.origin[2] ) < how_high )
self.player_close++;
}
}
wait 0.1;
if ( self.inview == 0 && self.player_close == 0 )
{
if ( !isdefined( self.animname ) || isdefined( self.animname ) && self.animname != "zombie" )
return;
if ( isdefined( self.electrified ) && self.electrified == 1 )
return;
zombies = getaiarray( "axis" );
if ( zombies.size + level.zombie_total > 24 || zombies.size + level.zombie_total <= 24 && self.health >= self.maxhealth )
{
if ( !( isdefined( self.exclude_distance_cleanup_adding_to_total ) && self.exclude_distance_cleanup_adding_to_total ) && !( isdefined( self.isscreecher ) && self.isscreecher ) )
{
//level.zombie_total++;
if ( self.health < level.zombie_health )
level.zombie_respawned_health[level.zombie_respawned_health.size] = self.health;
}
}
self maps\mp\zombies\_zm_spawner::reset_attack_spot();
//self notify( "zombie_delete" );
if ( isdefined( self.anchor ) )
//self.anchor delete();
//self delete();
recalc_zombie_array();
}
}
round_spawn_failsafe()
{
self endon( "death" );
prevorigin = self.origin;
while ( true )
{
if ( !level.zombie_vars["zombie_use_failsafe"] )
return;
if ( isdefined( self.ignore_round_spawn_failsafe ) && self.ignore_round_spawn_failsafe )
return;
wait 30;
if ( !self.has_legs )
wait 10.0;
if ( isdefined( self.is_inert ) && self.is_inert )
continue;
if ( isdefined( self.lastchunk_destroy_time ) )
{
if ( gettime() - self.lastchunk_destroy_time < 8000 )
continue;
}
if ( self.origin[2] < level.zombie_vars["below_world_check"] )
{
if ( isdefined( level.put_timed_out_zombies_back_in_queue ) && level.put_timed_out_zombies_back_in_queue && !flag( "dog_round" ) && !( isdefined( self.isscreecher ) && self.isscreecher ) )
{
empty = 0;
//level.zombie_total++;
//level.zombie_total_subtract++;
}
/#
#/
empty = 0;
//self dodamage( self.health + 100, ( 0, 0, 0 ) );
break;
}
if ( distancesquared( self.origin, prevorigin ) < 576 )
{
if ( isdefined( level.put_timed_out_zombies_back_in_queue ) && level.put_timed_out_zombies_back_in_queue && !flag( "dog_round" ) )
{
if ( !self.ignoreall && !( isdefined( self.nuked ) && self.nuked ) && !( isdefined( self.marked_for_death ) && self.marked_for_death ) && !( isdefined( self.isscreecher ) && self.isscreecher ) && ( isdefined( self.has_legs ) && self.has_legs ) )
{
empty = 0;
//level.zombie_total++;
//level.zombie_total_subtract++;
}
}
level.zombies_timeout_playspace++;
/#
#/
empty = 0;
//self dodamage( self.health + 100, ( 0, 0, 0 ) );
break;
}
prevorigin = self.origin;
}
}
here is a GSC script for Mob of the Dead:
#include maps\mp\gametypes_zm\_hud_util;
#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\zombies\_zm_utility;
#include maps\mp\gametypes_zm\_spawnlogic;
main()
{
replaceFunc(maps\mp\zm_alcatraz_distance_tracking::delete_zombie_noone_looking, ::delete_zombie_noone_looking);
replaceFunc(maps\mp\zm_prison::alcatraz_round_spawn_failsafe, ::alcatraz_round_spawn_failsafe);// tomb is origins name
replaceFunc(maps\mp\zombies\_zm::round_spawn_failsafe, ::round_spawn_failsafe);
}
delete_zombie_noone_looking( how_close, how_high )
{
self endon( "death" );
if ( !isdefined( how_close ) )
how_close = 1500;
if ( !isdefined( how_high ) )
how_close = 600;
distance_squared_check = how_close * how_close;
too_far_dist = distance_squared_check * 3;
if ( isdefined( level.zombie_tracking_too_far_dist ) )
too_far_dist = level.zombie_tracking_too_far_dist * level.zombie_tracking_too_far_dist;
self.inview = 0;
self.player_close = 0;
players = get_players();
for ( i = 0; i < players.size; i++ )
{
if ( players[i].sessionstate == "spectator" )
continue;
if ( isdefined( level.only_track_targeted_players ) )
{
if ( !isdefined( self.favoriteenemy ) || self.favoriteenemy != players[i] )
continue;
}
can_be_seen = self player_can_see_me( players[i] );
if ( can_be_seen && distancesquared( self.origin, players[i].origin ) < too_far_dist )
self.inview++;
if ( distancesquared( self.origin, players[i].origin ) < distance_squared_check && abs( self.origin[2] - players[i].origin[2] ) < how_high )
self.player_close++;
}
wait 0.1;
if ( self.inview == 0 && self.player_close == 0 )
{
if ( !isdefined( self.animname ) || isdefined( self.animname ) && self.animname != "zombie" )
return;
if ( isdefined( self.electrified ) && self.electrified == 1 )
return;
if ( isdefined( self.in_the_ground ) && self.in_the_ground == 1 )
return;
zombies = getaiarray( "axis" );
if ( ( !isdefined( self.damagemod ) || self.damagemod == "MOD_UNKNOWN" ) && self.health < self.maxhealth )
{
if ( !( isdefined( self.exclude_distance_cleanup_adding_to_total ) && self.exclude_distance_cleanup_adding_to_total ) && !( isdefined( self.isscreecher ) && self.isscreecher ) )
{
//level.zombie_total++;
//level.zombie_respawned_health[level.zombie_respawned_health.size] = self.health;
}
}
else if ( zombies.size + level.zombie_total > 24 || zombies.size + level.zombie_total <= 24 && self.health >= self.maxhealth )
{
if ( !( isdefined( self.exclude_distance_cleanup_adding_to_total ) && self.exclude_distance_cleanup_adding_to_total ) && !( isdefined( self.isscreecher ) && self.isscreecher ) )
{
//level.zombie_total++;
if ( self.health < level.zombie_health )
level.zombie_respawned_health[level.zombie_respawned_health.size] = self.health;
}
}
self maps\mp\zombies\_zm_spawner::reset_attack_spot();
//self notify( "zombie_delete" );
//self delete();
recalc_zombie_array();
}
}
alcatraz_round_spawn_failsafe()
{
self endon( "death" );
prevorigin = self.origin;
while ( true )
{
if ( isdefined( self.ignore_round_spawn_failsafe ) && self.ignore_round_spawn_failsafe )
return;
wait 15;
if ( isdefined( self.is_inert ) && self.is_inert )
continue;
if ( isdefined( self.lastchunk_destroy_time ) )
{
if ( gettime() - self.lastchunk_destroy_time < 8000 )
continue;
}
if ( self.origin[2] < -15000 )
{
if ( isdefined( level.put_timed_out_zombies_back_in_queue ) && level.put_timed_out_zombies_back_in_queue && !flag( "dog_round" ) && !( isdefined( self.isscreecher ) && self.isscreecher ) )
{
//level.zombie_total++;
//level.zombie_total_subtract++;
}
/#
#/
self dodamage( self.health + 100, ( 0, 0, 0 ) );
break;
}
if ( distancesquared( self.origin, prevorigin ) < 576 )
{
if ( isdefined( level.put_timed_out_zombies_back_in_queue ) && level.put_timed_out_zombies_back_in_queue && !flag( "dog_round" ) )
{
if ( !( isdefined( self.nuked ) && self.nuked ) && !( isdefined( self.marked_for_death ) && self.marked_for_death ) && !( isdefined( self.isscreecher ) && self.isscreecher ) && ( isdefined( self.has_legs ) && self.has_legs ) && !( isdefined( self.is_brutus ) && self.is_brutus ) )
{
//level.zombie_total++;
//level.zombie_total_subtract++;
}
}
level.zombies_timeout_playspace++;
/#
#/
if ( isdefined( self.is_brutus ) && self.is_brutus )
{
self.suppress_brutus_powerup_drop = 1;
self.brutus_round_spawn_failsafe = 1;
}
//self dodamage( self.health + 100, ( 0, 0, 0 ) );
break;
}
prevorigin = self.origin;
}
}
round_spawn_failsafe()
{
self endon( "death" );
prevorigin = self.origin;
while ( true )
{
if ( !level.zombie_vars["zombie_use_failsafe"] )
return;
if ( isdefined( self.ignore_round_spawn_failsafe ) && self.ignore_round_spawn_failsafe )
return;
wait 30;
if ( !self.has_legs )
wait 10.0;
if ( isdefined( self.is_inert ) && self.is_inert )
continue;
if ( isdefined( self.lastchunk_destroy_time ) )
{
if ( gettime() - self.lastchunk_destroy_time < 8000 )
continue;
}
if ( self.origin[2] < level.zombie_vars["below_world_check"] )
{
if ( isdefined( level.put_timed_out_zombies_back_in_queue ) && level.put_timed_out_zombies_back_in_queue && !flag( "dog_round" ) && !( isdefined( self.isscreecher ) && self.isscreecher ) )
{
empty = 0;
//level.zombie_total++;
//level.zombie_total_subtract++;
}
/#
#/
empty = 0;
//self dodamage( self.health + 100, ( 0, 0, 0 ) );
break;
}
if ( distancesquared( self.origin, prevorigin ) < 576 )
{
if ( isdefined( level.put_timed_out_zombies_back_in_queue ) && level.put_timed_out_zombies_back_in_queue && !flag( "dog_round" ) )
{
if ( !self.ignoreall && !( isdefined( self.nuked ) && self.nuked ) && !( isdefined( self.marked_for_death ) && self.marked_for_death ) && !( isdefined( self.isscreecher ) && self.isscreecher ) && ( isdefined( self.has_legs ) && self.has_legs ) )
{
empty = 0;
//level.zombie_total++;
//level.zombie_total_subtract++;
}
}
level.zombies_timeout_playspace++;
/#
#/
empty = 0;
//self dodamage( self.health + 100, ( 0, 0, 0 ) );
break;
}
prevorigin = self.origin;
}
}
here is a GSC script for Die Rise:
#include maps\mp\gametypes_zm\_hud_util;
#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\zombies\_zm_utility;
#include maps\mp\gametypes_zm\_spawnlogic;
main()
{
replaceFunc(maps\mp\zm_highrise_distance_tracking::delete_zombie_noone_looking, ::delete_zombie_noone_looking);
replaceFunc(maps\mp\zombies\_zm::round_spawn_failsafe, ::round_spawn_failsafe);
}
delete_zombie_noone_looking( how_close, how_high )
{
self endon( "death" );
if ( !isdefined( how_close ) )
how_close = 1000;
if ( !isdefined( how_high ) )
how_high = 500;
distance_squared_check = how_close * how_close;
height_squared_check = how_high * how_high;
too_far_dist = distance_squared_check * 3;
if ( isdefined( level.zombie_tracking_too_far_dist ) )
too_far_dist = level.zombie_tracking_too_far_dist * level.zombie_tracking_too_far_dist;
self.inview = 0;
self.player_close = 0;
players = get_players();
for ( i = 0; i < players.size; i++ )
{
if ( players[i].sessionstate == "spectator" )
continue;
if ( isdefined( level.only_track_targeted_players ) )
{
if ( !isdefined( self.favoriteenemy ) || self.favoriteenemy != players[i] )
continue;
}
can_be_seen = self player_can_see_me( players[i] );
if ( can_be_seen && distancesquared( self.origin, players[i].origin ) < too_far_dist )
self.inview++;
if ( distancesquared( self.origin, players[i].origin ) < distance_squared_check && abs( self.origin[2] - players[i].origin[2] ) < how_high )
self.player_close++;
}
wait 0.1;
if ( self.inview == 0 && self.player_close == 0 )
{
if ( !isdefined( self.animname ) || isdefined( self.animname ) && self.animname != "zombie" )
return;
if ( isdefined( self.electrified ) && self.electrified == 1 )
return;
zombies = getaiarray( "axis" );
if ( zombies.size + level.zombie_total > 24 || zombies.size + level.zombie_total <= 24 && self.health >= self.maxhealth )
{
if ( !( isdefined( self.exclude_distance_cleanup_adding_to_total ) && self.exclude_distance_cleanup_adding_to_total ) && !( isdefined( self.isscreecher ) && self.isscreecher ) )
{
//level.zombie_total++;
if ( self.health < level.zombie_health )
level.zombie_respawned_health[level.zombie_respawned_health.size] = self.health;
}
}
self maps\mp\zombies\_zm_spawner::reset_attack_spot();
//self notify( "zombie_delete" );
//self delete();
recalc_zombie_array();
}
}
round_spawn_failsafe()
{
self endon( "death" );
prevorigin = self.origin;
while ( true )
{
if ( !level.zombie_vars["zombie_use_failsafe"] )
return;
if ( isdefined( self.ignore_round_spawn_failsafe ) && self.ignore_round_spawn_failsafe )
return;
wait 30;
if ( !self.has_legs )
wait 10.0;
if ( isdefined( self.is_inert ) && self.is_inert )
continue;
if ( isdefined( self.lastchunk_destroy_time ) )
{
if ( gettime() - self.lastchunk_destroy_time < 8000 )
continue;
}
if ( self.origin[2] < level.zombie_vars["below_world_check"] )
{
if ( isdefined( level.put_timed_out_zombies_back_in_queue ) && level.put_timed_out_zombies_back_in_queue && !flag( "dog_round" ) && !( isdefined( self.isscreecher ) && self.isscreecher ) )
{
empty = 0;
//level.zombie_total++;
//level.zombie_total_subtract++;
}
/#
#/
empty = 0;
//self dodamage( self.health + 100, ( 0, 0, 0 ) );
break;
}
if ( distancesquared( self.origin, prevorigin ) < 576 )
{
if ( isdefined( level.put_timed_out_zombies_back_in_queue ) && level.put_timed_out_zombies_back_in_queue && !flag( "dog_round" ) )
{
if ( !self.ignoreall && !( isdefined( self.nuked ) && self.nuked ) && !( isdefined( self.marked_for_death ) && self.marked_for_death ) && !( isdefined( self.isscreecher ) && self.isscreecher ) && ( isdefined( self.has_legs ) && self.has_legs ) )
{
empty = 0;
//level.zombie_total++;
//level.zombie_total_subtract++;
}
}
level.zombies_timeout_playspace++;
/#
#/
empty = 0;
//self dodamage( self.health + 100, ( 0, 0, 0 ) );
break;
}
prevorigin = self.origin;
}
}
here is a GSC script for Tranzit:
#include maps\mp\gametypes_zm\_hud_util;
#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\zombies\_zm_utility;
#include maps\mp\gametypes_zm\_spawnlogic;
main()
{
replaceFunc(maps\mp\zm_transit_distance_tracking::delete_zombie_noone_looking, ::delete_zombie_noone_looking);
replaceFunc(maps\mp\zombies\_zm::round_spawn_failsafe, ::round_spawn_failsafe);
}
delete_zombie_noone_looking( how_close )
{
self endon( "death" );
if ( !isdefined( how_close ) )
how_close = 1000;
distance_squared_check = how_close * how_close;
too_far_dist = distance_squared_check * 3;
if ( isdefined( level.zombie_tracking_too_far_dist ) )
too_far_dist = level.zombie_tracking_too_far_dist * level.zombie_tracking_too_far_dist;
self.inview = 0;
self.player_close = 0;
players = get_players();
for ( i = 0; i < players.size; i++ )
{
if ( players[i].sessionstate == "spectator" )
continue;
if ( isdefined( level.only_track_targeted_players ) )
{
if ( !isdefined( self.favoriteenemy ) || self.favoriteenemy != players[i] )
continue;
}
can_be_seen = self player_can_see_me( players[i] );
if ( can_be_seen && distancesquared( self.origin, players[i].origin ) < too_far_dist )
self.inview++;
if ( distancesquared( self.origin, players[i].origin ) < distance_squared_check )
self.player_close++;
}
wait 0.1;
if ( self.inview == 0 && self.player_close == 0 )
{
if ( !isdefined( self.animname ) || isdefined( self.animname ) && self.animname != "zombie" )
return;
if ( isdefined( self.electrified ) && self.electrified == 1 )
return;
if ( isdefined( self.in_the_ground ) && self.in_the_ground == 1 )
return;
zombies = getaiarray( "axis" );
if ( ( !isdefined( self.damagemod ) || self.damagemod == "MOD_UNKNOWN" ) && self.health < self.maxhealth )
{
if ( !( isdefined( self.exclude_distance_cleanup_adding_to_total ) && self.exclude_distance_cleanup_adding_to_total ) && !( isdefined( self.isscreecher ) && self.isscreecher ) )
{
//level.zombie_total++;
//level.zombie_respawned_health[level.zombie_respawned_health.size] = self.health;
}
}
else if ( zombies.size + level.zombie_total > 24 || zombies.size + level.zombie_total <= 24 && self.health >= self.maxhealth )
{
if ( !( isdefined( self.exclude_distance_cleanup_adding_to_total ) && self.exclude_distance_cleanup_adding_to_total ) && !( isdefined( self.isscreecher ) && self.isscreecher ) )
{
//level.zombie_total++;
if ( self.health < level.zombie_health )
level.zombie_respawned_health[level.zombie_respawned_health.size] = self.health;
}
}
self maps\mp\zombies\_zm_spawner::reset_attack_spot();
//self notify( "zombie_delete" );
//self delete();
recalc_zombie_array();
}
}
round_spawn_failsafe()
{
self endon( "death" );
prevorigin = self.origin;
while ( true )
{
if ( !level.zombie_vars["zombie_use_failsafe"] )
return;
if ( isdefined( self.ignore_round_spawn_failsafe ) && self.ignore_round_spawn_failsafe )
return;
wait 30;
if ( !self.has_legs )
wait 10.0;
if ( isdefined( self.is_inert ) && self.is_inert )
continue;
if ( isdefined( self.lastchunk_destroy_time ) )
{
if ( gettime() - self.lastchunk_destroy_time < 8000 )
continue;
}
if ( self.origin[2] < level.zombie_vars["below_world_check"] )
{
if ( isdefined( level.put_timed_out_zombies_back_in_queue ) && level.put_timed_out_zombies_back_in_queue && !flag( "dog_round" ) && !( isdefined( self.isscreecher ) && self.isscreecher ) )
{
empty = 0;
//level.zombie_total++;
//level.zombie_total_subtract++;
}
/#
#/
empty = 0;
//self dodamage( self.health + 100, ( 0, 0, 0 ) );
break;
}
if ( distancesquared( self.origin, prevorigin ) < 576 )
{
if ( isdefined( level.put_timed_out_zombies_back_in_queue ) && level.put_timed_out_zombies_back_in_queue && !flag( "dog_round" ) )
{
if ( !self.ignoreall && !( isdefined( self.nuked ) && self.nuked ) && !( isdefined( self.marked_for_death ) && self.marked_for_death ) && !( isdefined( self.isscreecher ) && self.isscreecher ) && ( isdefined( self.has_legs ) && self.has_legs ) )
{
empty = 0;
//level.zombie_total++;
//level.zombie_total_subtract++;
}
}
level.zombies_timeout_playspace++;
/#
#/
empty = 0;
//self dodamage( self.health + 100, ( 0, 0, 0 ) );
break;
}
prevorigin = self.origin;
}
}