Modme Forums

How i can change the zombies health

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


ModmeBot:

Thread By: ByKris
I need change the zombies health but i dont know how, please help me


ModmeBot:

Reply By: natesmithzombies
Are you trying to change the health of every zombie or just one? Do you want the health of the zombies to be dependent on the round or a set health? All AI, and even vehicles, have a self.health variable on them. Check out my code below for an example of how you might go about changing zombie health.



function new_zombie_health( starting_health )
{
	level endon( "intermission" ); 		// kill this function when the players die and the game enters intermission
	
	while(1)	// always do this 
	{
		zoms = GetAISpeciesArray( "axis" ); // Get all of the enemies
		foreach( zom in zoms )	// Do this for all of the enemies 
		{
			if( isDefined(zom.animname) && zom.animname == "zombie" && !isDefined(zom.health_reset) )	// Lets be sure they are a zombie before we do this
			{
				zom.health = health_think( starting_health ); // Reassign their health to the value returned by the function health_think
				zom.health_reset = true;	// this is so we dont keep reassigning the same health to a zombie 
			}
		}
		wait(0.25); // we will wait 0.25 seconds because the zombies spawn in rather slow. No need to run this very fast 
	}
}

function health_think( starting_health )	// This function does the default math to assign health per round customize it anyway you want
{
	round = level.round_number;	// Get the round number
	if( round )	// if it is round 1 do this
		health = starting_health; 
	else if( round < 10 )	// if the round is less than 10 do this
		health = starting_health + round*100 - 100; 
	else	// if the round is not 1 or less than 10 do this
		health = (starting_health + 800) * 1.1^round; 
	
	return health; // return the health value 
}



You could paste this code at the bottom of mapname.gsc and then call is like this in the "function main" of your mapname.gsc:

function main()
{
	thread new_zombie_health( 150 ); // 150 is the default starting health 



This code is entirely untested but hopefully it gets the ball rolling for you


ModmeBot:

Reply By: ByKris

natesmithzombiesAre you trying to change the health of every zombie or just one? Do you want the health of the zombies to be dependent on the round or a set health? All AI, and even vehicles, have a self.health variable on them. Check out my code below for an example of how you might go about changing zombie health.



function new_zombie_health( starting_health )
{
	level endon( "intermission" ); 		// kill this function when the players die and the game enters intermission
	
	while(1)	// always do this 
	{
		zoms = GetAISpeciesArray( "axis" ); // Get all of the enemies
		foreach( zom in zoms )	// Do this for all of the enemies 
		{
			if( isDefined(zom.animname) && zom.animname == "zombie" && !isDefined(zom.health_reset) )	// Lets be sure they are a zombie before we do this
			{
				zom.health = health_think( starting_health ); // Reassign their health to the value returned by the function health_think
				zom.health_reset = true;	// this is so we dont keep reassigning the same health to a zombie 
			}
		}
		wait(0.25); // we will wait 0.25 seconds because the zombies spawn in rather slow. No need to run this very fast 
	}
}

function health_think( starting_health )	// This function does the default math to assign health per round customize it anyway you want
{
	round = level.round_number;	// Get the round number
	if( round )	// if it is round 1 do this
		health = starting_health; 
	else if( round < 10 )	// if the round is less than 10 do this
		health = starting_health + round*100 - 100; 
	else	// if the round is not 1 or less than 10 do this
		health = (starting_health + 800) * 1.1^round; 
	
	return health; // return the health value 
}



You could paste this code at the bottom of mapname.gsc and then call is like this in the "function main" of your mapname.gsc:

function main()
{
	thread new_zombie_health( 150 ); // 150 is the default starting health 



This code is entirely untested but hopefully it gets the ball rolling for you


I need that all zombies having the same health because i need kill with 1 shoot in all rounds, I tested the script but doesnt work or I put it wrong (sorry for my english, im spanish)


ModmeBot:

Reply By: natesmithzombies

ByKrisI need that all zombies having the same health because i need kill with 1 shoot in all rounds, I tested the script but doesnt work or I put it wrong (sorry for my english, im spanish)


Alright that is even easier now. Try this:

Step 1) Paste this at the bottom of mapname.gsc:

function new_zombie_health( starting_health )
{
    level endon( "intermission" );      // kill this function when the players die and the game enters intermission
     
    while(1)    // always do this
    {
        zoms = GetAISpeciesArray( "axis" ); // Get all of the enemies
        foreach( zom in zoms )  // Do this for all of the enemies
        {
            if( isDefined(zom.animname) && zom.animname == "zombie" && !isDefined(zom.health_reset) )   // Lets be sure they are a zombie before we do this
            {
                zom.health = starting_health; 
                zom.health_reset = true;    // this is so we dont keep reassigning the same health to a zombie
            }
        }
        wait(0.25); // we will wait 0.25 seconds because the zombies spawn in rather slow. No need to run this very fast
    }
}



Step 2) Paste this under

function main()
{

in your mapname.gsc

thread new_zombie_health(5); 



Let me know if it works, haven't tested it out myself as I have been bouncing between work and University all day


ModmeBot:

Reply By: ByKris

natesmithzombies
ByKris Necesito que todos los zombies que tienen la misma salud porque necesito matar con 1 disparar en todas las rondas, he probado el guión, pero no funciona o lo pongo mal (lo siento por mi Inglés, español im)


Está bien que es incluso más fácil ahora. Prueba esto:

Paso 1) pega este en la parte inferior de mapname.gsc: Paso 2) Pega este bajo en su mapname.gsc Avísame si funciona, no lo he probado a mí mismo como he estado rebotando entre el trabajo y la Universidad todo el dia

function new_zombie_health( starting_health )
{
    level endon( "intermission" );      // kill this function when the players die and the game enters intermission
     
    while(1)    // always do this
    {
        zoms = GetAISpeciesArray( "axis" ); // Get all of the enemies
        foreach( zom in zoms )  // Do this for all of the enemies
        {
            if( isDefined(zom.animname) && zom.animname == "zombie" && !isDefined(zom.health_reset) )   // Lets be sure they are a zombie before we do this
            {
                zom.health = starting_health; 
                zom.health_reset = true;    // this is so we dont keep reassigning the same health to a zombie
            }
        }
        wait(0.25); // we will wait 0.25 seconds because the zombies spawn in rather slow. No need to run this very fast
    }
}





function main()
{



thread new_zombie_health(5); 





^1thread new_zombie_health(5);

^1---------------------------^

^1ERR(0) scripts/zm/zm_pistol.gsc (106,28) : syntax error, unexpected $end, expecting TOKEN_RIGHT_CURLY : thread new_zombie_health(5);


ModmeBot:

Reply By: natesmithzombies

ByKris^1thread new_zombie_health(5);

^1---------------------------^

^1ERR(0) scripts/zm/zm_pistol.gsc (106,28) : syntax error, unexpected $end, expecting TOKEN_RIGHT_CURLY : thread new_zombie_health(5);


Paste your mapnmame.gsc here and send the link over


ModmeBot:

Reply By: ByKris

natesmithzombies
ByKris^1thread new_zombie_health(5);

^1---------------------------^

^1ERR(0) scripts/zm/zm_pistol.gsc (106,28) : syntax error, unexpected $end, expecting TOKEN_RIGHT_CURLY : thread new_zombie_health(5);


Paste your mapnmame.gsc here and send the link over


http://paste.md-5.net/yiseyudofu.tex <--kill with 1 shoot ,and for other custom need that each x time appear a zombie with a lot of health--> http://paste.md-5.net/cuforurowu.tex


ModmeBot:

Reply By: natesmithzombies

ByKris
natesmithzombies
ByKris^1thread new_zombie_health(5);

^1---------------------------^

^1ERR(0) scripts/zm/zm_pistol.gsc (106,28) : syntax error, unexpected $end, expecting TOKEN_RIGHT_CURLY : thread new_zombie_health(5);


Paste your mapnmame.gsc here and send the link over


http://paste.md-5.net/yiseyudofu.tex <--kill with 1 shoot ,and for other custom need that each x time appear a zombie with a lot of health--> http://paste.md-5.net/cuforurowu.tex


This should work for you now


ModmeBot:

Reply By: ByKris

natesmithzombies
ByKris
natesmithzombies
ByKris^1thread new_zombie_health(5);

^1---------------------------^

^1ERR(0) scripts/zm/zm_pistol.gsc (106,28) : syntax error, unexpected $end, expecting TOKEN_RIGHT_CURLY : thread new_zombie_health(5);


Paste your mapnmame.gsc here and send the link over


http://paste.md-5.net/yiseyudofu.tex <--kill with 1 shoot ,and for other custom need that each x time appear a zombie with a lot of health--> http://paste.md-5.net/cuforurowu.tex


This should work for you now


woks! thanx, and I need that every 2 rounds teleport you to a random room (there are 4), how?


ModmeBot:

Reply By: natesmithzombies

ByKris
natesmithzombies
ByKris
natesmithzombies
ByKris^1thread new_zombie_health(5);

^1---------------------------^

^1ERR(0) scripts/zm/zm_pistol.gsc (106,28) : syntax error, unexpected $end, expecting TOKEN_RIGHT_CURLY : thread new_zombie_health(5);


Paste your mapnmame.gsc here and send the link over


http://paste.md-5.net/yiseyudofu.tex <--kill with 1 shoot ,and for other custom need that each x time appear a zombie with a lot of health--> http://paste.md-5.net/cuforurowu.tex


This should work for you now


woks! thanx, and I need that every 2 rounds teleport you to a random room (there are 4), how?


Not sure what you mean. Can you explain


ModmeBot:

Reply By: Hero115

natesmithzombies
ByKris
natesmithzombies
ByKris
natesmithzombies
ByKris^1thread new_zombie_health(5);

^1---------------------------^

^1ERR(0) scripts/zm/zm_pistol.gsc (106,28) : syntax error, unexpected $end, expecting TOKEN_RIGHT_CURLY : thread new_zombie_health(5);


Paste your mapnmame.gsc here and send the link over


http://paste.md-5.net/yiseyudofu.tex <--kill with 1 shoot ,and for other custom need that each x time appear a zombie with a lot of health--> http://paste.md-5.net/cuforurowu.tex


This should work for you now


woks! thanx, and I need that every 2 rounds teleport you to a random room (there are 4), how?


Not sure what you mean. Can you explain


I think he needs a script For "Teleporting" him every 2 rounds to a random room (There are 4 rooms). Kinda like that map Gun defense


ModmeBot:

Reply By: ByKris

Hero115
natesmithzombies
ByKris
natesmithzombies
ByKris
natesmithzombies
ByKris^1thread new_zombie_health(5);

^1---------------------------^

^1ERR(0) scripts/zm/zm_pistol.gsc (106,28) : syntax error, unexpected $end, expecting TOKEN_RIGHT_CURLY : thread new_zombie_health(5);


Paste your mapnmame.gsc here and send the link over


http://paste.md-5.net/yiseyudofu.tex <--kill with 1 shoot ,and for other custom need that each x time appear a zombie with a lot of health--> http://paste.md-5.net/cuforurowu.tex


This should work for you now


woks! thanx, and I need that every 2 rounds teleport you to a random room (there are 4), how?


Not sure what you mean. Can you explain


I think he needs a script For "Teleporting" him every 2 rounds to a random room (There are 4 rooms). Kinda like that map Gun defense


Exactly