UGX-Mods

Call of Duty 5: World at War => Help Desk => Modding => Topic started by: MJPWGaming on June 02, 2015, 09:47:10 pm

Title: Custom Zombie Boss (During Rounds)
Post by: MJPWGaming on June 02, 2015, 09:47:10 pm
Hi I was wondering how to do a Zombie Boss in the rounds?
This will just be a random zombie that stands out from the others and has more health.
Also he needs to go with the same speed as the others (slow at the beginning and faster later).

The custom zombie boss that I'm doing is a secret project that will be revealed during release so I cant go into more
details about the specific boss but he would need to just go off the regular anims as all the others (not a panzer or Brutus).

The character model also came out as two pieces (head and body).
So lets say I were to use:

Code Snippet
Plaintext
char_ger_ansel_body
char_ger_honorgd_zombiehead1_1

If there's a easy tut or script someone is willing to help me out with I'd greatly appreciate it!

EDIT: Also one other thing, a sound has to be played after his death.
Title: Re: Custom Zombie Boss (During Rounds)
Post by: BluntStuffy on June 02, 2015, 10:02:38 pm
In _zombiemode_spawner::zombie_spawn_init(), somewhere around the end of the function, under     self.flame_damage_time = 0;     for example, add something like this:

Code Snippet
Plaintext
	if( ( !isdefined( level.boss_spawned ) || isdefined( level.boss_spawned ) && !level.boss_spawned ) && randomint( 100 ) < 40 )
{
level.boss_spawned = true;
self.boss = true; // you can use this in other scripts to check
self detachall();
self setModel("char_ger_ansel_body");
self.headModel = "char_ger_honorgd_zombiehead1_1";
self attach(self.headModel, "", true);

self.maxhealth = HEWHEALTH;
self.health = HEWHEALTH;
level thread boss_round_reset();
                self thread play_sound_on_death();
}

Then add this new function at the bottom of the file:

Code Snippet
Plaintext
	boss_round_reset()
{
level waittill( "between_round_over" );
level.boss_spawned = false;
}


And also add this function under that:

Code Snippet
Plaintext
play_sound_on_death()
{
      self waittill( "death" );

      playsoundatposition( "SOUND_ALIAS", self.origin );
}

Then one boss max will spawn each round, should work. Untested though  :P


EDIT:
Also added the sound when he dies now




Title: Re: Custom Zombie Boss (During Rounds)
Post by: MJPWGaming on June 03, 2015, 01:17:46 am
Thanks! I get a error straight off:

Uninitialised variable 'hewhealth'
Title: Re: Custom Zombie Boss (During Rounds)
Post by: Harry Bo21 on June 03, 2015, 01:22:07 am
Thanks! I get a error straight off:

Uninitialised variable 'hewhealth'

I think he meant "newhealth" and I also think he intended for you to replace that with a number, multiplication or reference to a variable you set

something like :

Code Snippet
Plaintext
newHealth = level.round_number * 250;
self.maxhealth = newHealth;
self.health = newHealth;

the above would mean as the rounds go up, as does the boss zombies health
Title: Re: Custom Zombie Boss (During Rounds)
Post by: MJPWGaming on June 03, 2015, 02:15:41 am
Nice! So now it all works, sound and all, BUT the character just looks like any of the other zombies that spawn. :/
Title: Re: Custom Zombie Boss (During Rounds)
Post by: Harry Bo21 on June 03, 2015, 03:06:13 am
Nice! So now it all works, sound and all, BUT the character just looks like any of the other zombies that spawn. :/

change these to you desired models

Code Snippet
Plaintext
self setModel("char_ger_ansel_body");
self.headModel = "char_ger_honorgd_zombiehead1_1";

if the model has a head, just skip the head. comment it out or delete it

I believe the ones in the example are for the normal zombies
Title: Re: Custom Zombie Boss (During Rounds)
Post by: HitmanVere on June 03, 2015, 03:19:23 am
Nice! So now it all works, sound and all, BUT the character just looks like any of the other zombies that spawn. :/

Remember to also add models in mod.csv
Title: Re: Custom Zombie Boss (During Rounds)
Post by: MJPWGaming on June 03, 2015, 03:35:17 am
change these to you desired models

Code Snippet
Plaintext
self setModel("char_ger_ansel_body");
self.headModel = "char_ger_honorgd_zombiehead1_1";

if the model has a head, just skip the head. comment it out or delete it

I believe the ones in the example are for the normal zombies


I changed it to the actual models it was supposed to be :(

Remember to also add models in mod.csv

Already done :/
Title: Re: Custom Zombie Boss (During Rounds)
Post by: Harry Bo21 on June 03, 2015, 03:44:19 am
well he did say it was untested, might need a slight adjustment. Maybe a wait till spawn check before swapping the models or something

Im sure Stuffy will reappear with the solution before long, he always does ;)
Title: Re: Custom Zombie Boss (During Rounds)
Post by: MJPWGaming on June 03, 2015, 04:01:13 am
well he did say it was untested, might need a slight adjustment. Maybe a wait till spawn check before swapping the models or something

Im sure Stuffy will reappear with the solution before long, he always does ;)

Indeed he does haha. I really hope it works so far my little project is pretty sweet :D
Title: Re: Custom Zombie Boss (During Rounds)
Post by: BluntStuffy on June 03, 2015, 04:57:03 am
In _zombiemode in the precache_models() function add:

Code Snippet
Plaintext
	precachemodel( "char_ger_ansel_body" ); 
precachemodel( "char_ger_honorgd_zombiehead1_1" );

and try again..



EDIT: And also set
Code Snippet
Plaintext
self.gibbed = true;

for the boss in the piece of code you added in _zombiemode_spawner, else he will change back to a normal zombie when you shoot of an arm/leg.
Title: Re: Custom Zombie Boss (During Rounds)
Post by: MJPWGaming on June 03, 2015, 06:33:25 am
In _zombiemode in the precache_models() function add:

Code Snippet
Plaintext
	precachemodel( "char_ger_ansel_body" ); 
precachemodel( "char_ger_honorgd_zombiehead1_1" );

and try again..



EDIT: And also set
Code Snippet
Plaintext
self.gibbed = true;

for the boss in the piece of code you added in _zombiemode_spawner, else he will change back to a normal zombie when you shoot of an arm/leg.

It works! Thank you! Now I just gotta find out how to export AW player models correctly haha thanks
Title: Re: Custom Zombie Boss (During Rounds)
Post by: ElTitoPricus on June 03, 2015, 07:33:14 am
Sorry to bump on your topic MJPWGaming :)

Anyone knows how to make it work for specific rounds?

Let's say round 5-10-15 etc

Thanks
Title: Re: Custom Zombie Boss (During Rounds)
Post by: Eternal_Fire on June 03, 2015, 07:54:56 am
Ok so I put stuffys script in under self.flame = 0 but it doesnt work, Harry is not sure why and i put an iprint in and it doesnt print on the screen so that means that it isnt using the code... Any help?
Title: Re: Custom Zombie Boss (During Rounds)
Post by: BluntStuffy on June 03, 2015, 04:08:07 pm
Sorry to bump on your topic MJPWGaming :)

Anyone knows how to make it work for specific rounds?

Let's say round 5-10-15 etc

Thanks

In spawner add this instead:

Code Snippet
Plaintext
	if( level.boss_spawned == 1 && randomint( 100 ) < 40 )
{
level.boss_spawned--;
self.boss = true; // you can use this in other scripts to check
self detachall();
self setModel("char_ger_ansel_body");
self.headModel = "char_ger_honorgd_zombiehead1_1";
self attach(self.headModel, "", true);

self.maxhealth = HEWHEALTH;
self.health = HEWHEALTH;
self thread play_sound_on_death();
}

and then in _zombiemode.gsc for example, in the main() function under this:     DisableGrenadeSuicide();     add:

Code Snippet
Plaintext
          level thread boss_round_check();



  and then at the bottom of the file for example, add:

Code Snippet
Plaintext
	boss_round_check()
{
level.next_boss_round = 5;
level.boss_spawned = 0;

while(1)
{
level waittill( "between_round_over" );
if( level.round_number == level.next_boss_round )
{
level.next_boss_round+=5;
level.boss_spawned = 1;
}
}
}






Ok so I put stuffys script in under self.flame = 0 but it doesnt work, Harry is not sure why and i put an iprint in and it doesnt print on the screen so that means that it isnt using the code... Any help?

If you havent solved it yet: DId you add the models to your mod.csv and to the precache-function in _zombiemode?
Otherwise post the piece of script from spawner, maybe something messed up..
Title: Re: Custom Zombie Boss (During Rounds)
Post by: ElTitoPricus on June 03, 2015, 04:52:24 pm
Thank You BlunStuffy ;)
Title: Re: Custom Zombie Boss (During Rounds)
Post by: Eternal_Fire on June 07, 2015, 08:29:14 am
If you havent solved it yet: DId you add the models to your mod.csv and to the precache-function in _zombiemode?
Otherwise post the piece of script from spawner, maybe something messed up..

Oh what do you mean by add the precache-function in _zombiemode?
Title: Re: Custom Zombie Boss (During Rounds)
Post by: BluntStuffy on June 07, 2015, 09:44:01 am
Oh what do you mean by add the precache-function in _zombiemode?

(http://imgur.com/kWQShef.png)

 :-X
Title: Re: Custom Zombie Boss (During Rounds)
Post by: Eternal_Fire on June 07, 2015, 11:39:28 am
(http://imgur.com/kWQShef.png)

 :-X

Oh yes i did do that, sorry, not sure what the problem is then :/