Modme Forums

Disable zombie respawn

Game Modding | Call of Duty: Black Ops 3 | Scripting


ModmeBot:

Thread By: ReviveMePlz
Hi guys, so today I spent a long ass time looking for the function that respawns the zombies when you are in another zone and are not looking at them but I couldn't find it anywhere at all. Just wondering if anyone can point me in the right direction. Thanks :P


ModmeBot:

Reply By: modric
Maybe ask Abnormal, his Brutus Boss script despawns zombies when u trigger the start of his boss fight


ModmeBot:

Reply By: Symbo
to disable zombies spawn you need that:

level flag::clear( "spawn_zombies" );
zombies = zombie_utility::get_round_enemy_array();
if ( isdefined( zombies ) )
{
array::run_all( zombies, &Kill );
}

and to spawn them back:

level flag::set( "spawn_zombies" );

But I think what you are asking for is how the zombies respawn when too far away and not looking at them. You might need to study the giant script. At the end you can find this but idk if it's usefull:

function factory_custom_spawn_location_selection( a_spots )
{
if( level.zombie_respawns > 0 )
{
if( !isdefined(level.n_player_spawn_selection_index) )
{
level.n_player_spawn_selection_index = 0;
}
// Get a player to spawn close by
a_players = GetPlayers();
level.n_player_spawn_selection_index++;
if( level.n_player_spawn_selection_index >= a_players.size )
{
level.n_player_spawn_selection_index = 0;
}
e_player = a_players[ level.n_player_spawn_selection_index ];
// Order the spots so they are closest to the player
ArraySortClosest( a_spots, e_player.origin );
a_candidates = [];
// Now pick the first 10 spots ahead of the player
v_player_dir = anglestoforward( e_player.angles );
for( i=0; i<a_spots.size; i++=""></a_spots.size;>
{
v_dir = a_spots.origin - e_player.origin;
dp = vectordot( v_player_dir, v_dir );
if( dp >= 0.0 )
{
a_candidates[a_candidates.size] = a_spots;
if( a_candidates.size > 10 )
{
break;
}
}
}
if( a_candidates.size )
{
s_spot = array::random(a_candidates);
}
else
{
s_spot = array::random(a_spots);
}
}
else
{
s_spot = array::random(a_spots);
}

return( s_spot );
}


ModmeBot:

Reply By: ReviveMePlz

Symbo
to disable zombies spawn you need that: level flag::clear( "spawn_zombies" ); zombies = zombie_utility::get_round_enemy_array(); if ( isdefined( zombies ) ) { array::run_all( zombies, &Kill ); } and to spawn them back: level flag::set( "spawn_zombies" ); But I think what you are asking for is how the zombies respawn when too far away and not looking at them. You might need to study the giant script. At the end you can find this but idk if it's usefull: function factory_custom_spawn_location_selection( a_spots ){ if( level.zombie_respawns > 0 ) { if( !isdefined(level.n_player_spawn_selection_index) ) { level.n_player_spawn_selection_index = 0; } // Get a player to spawn close by a_players = GetPlayers(); level.n_player_spawn_selection_index++; if( level.n_player_spawn_selection_index >= a_players.size ) { level.n_player_spawn_selection_index = 0; } e_player = a_players[ level.n_player_spawn_selection_index ]; // Order the spots so they are closest to the player ArraySortClosest( a_spots, e_player.origin ); a_candidates = []; // Now pick the first 10 spots ahead of the player v_player_dir = anglestoforward( e_player.angles ); for( i=0; i<a_spots.size; i++="" )="" {="" v_dir="a_spots.origin" -="" e_player.origin;="" dp="vectordot(" v_player_dir,="" v_dir="" );="" if(="" dp="">= 0.0 ) { a_candidates[a_candidates.size] = a_spots; if( a_candidates.size > 10 ) { break; } } } if( a_candidates.size ) { s_spot = array::random(a_candidates); } else { s_spot = array::random(a_spots); } } else { s_spot = array::random(a_spots); } return( s_spot );}
Thanks for replying, I believe this script is used in the logic of spawning zombies in general. I don't want to mess with where the zombies spawn, I want to disable them from respawning. I will keep looking myself :)</a_spots.size;>


ModmeBot:

Reply By: ReviveMePlz
I ended up solving my own problem

All I had to do was add the line of code below to zombie_spawn_init (_zm_spawner.gsc)

self.b_ignore_cleanup = true;
More information as to how this works can be found inside do_cleanup_check (zm_giant_cleanup_mgr.gsc)