Modme Forums

Kill all zombies / die out faster

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


ModmeBot:

Thread By: mathfag

How to kill all zombies via script, pause spawning and make them die out faster?

Also max distance from player.

I'm making a map where you teleport far away and the zombies take forever to die out. Kind of like on "moon" where you tp from area 51 to the moon.


ModmeBot:

Reply By: TCM

mathfag
How to kill all zombies via script, pause spawning and make them die out faster?Also max distance from player. I'm making a map where you teleport far away and the zombies take forever to die out. Kind of like on "moon" where you tp from area 51 to the moon.

I am sure you figured this out by now just wanted to post this in case it helps someone.

To kill all zombies instantly you can do this
function zombiekill()
{
	zombs = getaiarray( "axis" );
	level.zombie_total = 0;
	if( IsDefined( zombs ) )
	{
		i = 0;
		while( i < zombs.size )
		{
			zombs[ i] dodamage( zombs[ i].health * 5000, ( 0, 0, 0 ), self );
			wait 0.05;
			i++;
		}
	}
}

To pause it you can do something like this

BreakIt()
{
waitforbreaktime = 30;
OldActorLimit = level.zombie_actor_limit;	
OldAiLimt = level.zombie_ai_limit;
level.zombie_actor_limit = 0;
level.zombie_ai_limit = 0;
wait waitforbreaktime;
level.zombie_actor_limit = OldActorLimit;
level.zombie_ai_limit = OldAiLimt;
}


ModmeBot:

Reply By: Harry Bo21

TCM
mathfag How to kill all zombies via script, pause spawning and make them die out faster?Also max distance from player. I'm making a map where you teleport far away and the zombies take forever to die out. Kind of like on "moon" where you tp from area 51 to the moon. I am sure you figured this out by now just wanted to post this in case it helps someone. To kill all zombies instantly you can do this function zombiekill() { zombs = getaiarray( "axis" ); level.zombie_total = 0; if( IsDefined( zombs ) ) { i = 0; while( i < zombs.size ) { zombs[ i] dodamage( zombs[ i].health * 5000, ( 0, 0, 0 ), self ); wait 0.05; i++; } } } To pause it you can do something like this BreakIt() { waitforbreaktime = 30; OldActorLimit = level.zombie_actor_limit; OldAiLimt = level.zombie_ai_limit; level.zombie_actor_limit = 0; level.zombie_ai_limit = 0; wait waitforbreaktime; level.zombie_actor_limit = OldActorLimit; level.zombie_ai_limit = OldAiLimt; }


zm_giant_cleanup_mgr.gsc


just add this to your zone and add a using for it

respawns zombies when you are too far away and is adjustable

#define TRACKING_INNER_DIST					2000
#define TRACKING_OUTER_DIST					2200
#define TOO_HIGH_DIST						800

#define N_CLEANUP_INTERVAL_MIN				3000	// Minimum time in msec for cleanup checks
#define N_CLEANUP_AGE_MIN					5000	// You must be this old (in msec) before considering for cleanup
#define N_CLEANUP_AGE_TIMEOUT				45000	// If you are at least this old (in msec) then allow cleanup no matter what
#define N_CLEANUP_EVALS_PER_FRAME_MAX		1		// Maximum number of AI to process per frame
#define N_CLEANUP_FOV_COS					0.766	// cos(40) == 80 degree FOV
#define N_CLEANUP_DIST_SQ_MIN_AGGRESSIVE	189225	// Minimum distance squared.  435^2
#define N_CLEANUP_DIST_SQ_MIN				250000	// Minimum distance squared.  500^2
#define N_CLEANUP_DIST_SQ_ROUND_END			2250000	// Minimum distance squared.  1500^2


as for pausing spawning - its just a flag, unset it

"spawn_zombies"


if(flag::exists("world_is_paused"))
		{
			level flag::wait_till_clear("world_is_paused");
		}

		// added ability to pause zombie spawning
		level flag::wait_till( "spawn_zombies" );
		
		//Not great fix for this being zero - which it should NEVER be! (2 days to ship - PETER)
		while( level.zm_loc_types[ "zombie_location" ].size &lt;= 0 )
		{
			wait( 0.1 );
		}


_zm.gsc ^^


ModmeBot:

Reply By: mathfag

TCM
mathfag How to kill all zombies via script, pause spawning and make them die out faster?Also max distance from player. I'm making a map where you teleport far away and the zombies take forever to die out. Kind of like on "moon" where you tp from area 51 to the moon. I am sure you figured this out by now just wanted to post this in case it helps someone. To kill all zombies instantly you can do this function zombiekill() { zombs = getaiarray( "axis" ); level.zombie_total = 0; if( IsDefined( zombs ) ) { i = 0; while( i < zombs.size ) { zombs[ i] dodamage( zombs[ i].health * 5000, ( 0, 0, 0 ), self ); wait 0.05; i++; } } } To pause it you can do something like this BreakIt() { waitforbreaktime = 30; OldActorLimit = level.zombie_actor_limit; OldAiLimt = level.zombie_ai_limit; level.zombie_actor_limit = 0; level.zombie_ai_limit = 0; wait waitforbreaktime; level.zombie_actor_limit = OldActorLimit; level.zombie_ai_limit = OldAiLimt; }

Bruh did you seriously go back a year and a half?
I don't even remember what map this was for :)


ModmeBot:

Reply By: TCM

mathfag
TCM mathfag How to kill all zombies via script, pause spawning and make them die out faster?Also max distance from player. I'm making a map where you teleport far away and the zombies take forever to die out. Kind of like on "moon" where you tp from area 51 to the moon. I am sure you figured this out by now just wanted to post this in case it helps someone. To kill all zombies instantly you can do this function zombiekill() { zombs = getaiarray( "axis" ); level.zombie_total = 0; if( IsDefined( zombs ) ) { i = 0; while( i < zombs.size ) { zombs[ i] dodamage( zombs[ i].health * 5000, ( 0, 0, 0 ), self ); wait 0.05; i++; } } } To pause it you can do something like this BreakIt() { waitforbreaktime = 30; OldActorLimit = level.zombie_actor_limit; OldAiLimt = level.zombie_ai_limit; level.zombie_actor_limit = 0; level.zombie_ai_limit = 0; wait waitforbreaktime; level.zombie_actor_limit = OldActorLimit; level.zombie_ai_limit = OldAiLimt; } Bruh did you seriously go back a year and a half? I don't even remember what map this was for :)

I am sorry, I started from the last page and started making myself to the first just reading through.