Modme Forums

[Tutorial] Continuous spawn dog on certain round

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


ModmeBot:

Thread By: Kabe
Using this script you can:
Add continuous spawn dog from a certain round.

Choose a round.
Indicate a minimum number of enemies to stop spawn dogs and change round.
Indicates the minimum and maximum delay between dog spawns.


// Add to top of the script

#using scripts\shared\flag_shared; //add this if it is not already
#using scripts\shared\ai\zombie_utility; //add this if it is not already
#using scripts\zm\_zm_ai_dogs;

// Add directly after zm_usermap::main();

level.dognon_stop = true;
level thread dog_non_stop();

// Paste function way down the bottom, not inside any other functions :

function dog_non_stop()
{
	level endon( "intermission" );
	
	n_start_spawning_from_round 			= 15; 		// Round number for continuous spawn dog
	n_minimum_zombie_total_for_spawn 		= 3;		// Minimum zombies remaining either "now" or "left to spawn" - if less the do spawning will pause till the next round
	n_minimum_delay_between_spawns 			= 2;		// Minimum wait in seconds between spawning dogs
	n_maximum_delay_between_spawns 			= 3;		// Maximum wait in seconds between spawning dogs
	
	while ( 1 )
	{
		level waittill( "start_of_round" ); // Wait till the start round
		
		if ( !isDefined( level.round_number ) || level.round_number < n_start_spawning_from_round || ( level flag::exists( "dog_round" ) && level flag::get( "dog_round" ) ) || !isDefined( level.zombie_total )) // If round number is less that decided above, loop back to start
			continue;
		
		n_count_total_zombie = level.zombie_total;  // level.zombie_total by default, this number is updated while (n_count_total_zombie >= n_minimum_zombie_total_for_spawn) using "n_count_total_zombie = n_count_zombies_spawn + level.zombie_total;"
		while ( n_count_total_zombie >= n_minimum_zombie_total_for_spawn ) // Loop this block of code "only" while there is a high enough zombie total either spawned or spawning
		{
			wait randomIntRange( n_minimum_delay_between_spawns, n_maximum_delay_between_spawns ); // Use the random delay
			n_count_zombies_spawn = zombie_utility::get_current_zombie_count(); //Get enemies spawned
			n_count_total_zombie = n_count_zombies_spawn + level.zombie_total; //Update n_count_total_zombie = enemies spawned + zombies spawning
			
			if( n_count_zombies_spawn < level.zombie_ai_limit && IS_TRUE( level.dognon_stop ) ){ zm_ai_dogs::special_dog_spawn(1); } // Force spawn a dog if it does not reach the zombie_ai_limit and level.dognon_stop = true
		}
	}
}


If you need to cancel the dog spawn, use: "level.dognon_stop = false" and activate it again with "level.dognon_stop = true" in any script without needing to call it.
Enjoy the game;)


Credits
Harry Bo21
Kabe!!


ModmeBot:

Reply By: Psh
Huge


ModmeBot:

Reply By: MyNameIsNobody
Thanks again! +


ModmeBot:

Reply By: TheRipppa
this this not work with timed gameplay?..i just tested it, and the zombies stopped spawning and had nothing but dogs..
edit:, it works, just like after the 5 rounds like normal the zombies stop spawning, til dogs are killed, then continues on like new round started with zombies and dogs


ModmeBot:

Reply By: Kabe

TheRipppa
this this not work with timed gameplay?..i just tested it, and the zombies stopped spawning and had nothing but dogs.. edit:, it works, just like after the 5 rounds like normal the zombies stop spawning, til dogs are killed, then continues on like new round started with zombies and dogs

the dogs work if "level.dog non_stop = true"
if the zombies + other enemies is greater than 3
and if it does not exceed the level.zombie_ai_limit


ModmeBot:

Reply By: TCM
if you use teleporting zombies as well it bugs the dogs out, I had to make it so when one is spawning the other is temporary disabled until the other isn't