Author Topic: [SOLVED] Custom Zombie Boss (During Rounds)  (Read 3430 times)

0 Members and 1 Guest are viewing this topic.

Offline MJPWGaming

  • *
  • - Original Poster (OP) -
  • Pack-a-Puncher
  • Posts: 199
  • Country: us
  • Respect: 50
    • View Profile

Custom Zombie Boss (During Rounds)

« on: June 02, 2015, 12: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: [Select]
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.
« Last Edit: June 02, 2015, 12:50:22 pm by MJPWGaming »

This topic contains a post which is marked as the Best Answer. Click here to view it.

Offline BluntStuffy

  • *
  • The Decider
  • Posts: 961
  • Country: nl
  • Respect: 1112
  • It aint much, if it aint Dutch
    • @BluntZombie' Twitter Feed
    • StuffyZombie's YouTube Channel
    • View Profile
  • Skype: Bluntstuffy
  • WaW: BluntStuffy

Re: Custom Zombie Boss (During Rounds)

« Reply #1 on: June 02, 2015, 01: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: [Select]
	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: [Select]
	boss_round_reset()
{
level waittill( "between_round_over" );
level.boss_spawned = false;
}


And also add this function under that:

Code: [Select]
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




« Last Edit: June 02, 2015, 01:37:19 pm by BluntStuffy »
["BETA" RELEASE] Relinquished: https://ugx-mods.com/forum/index.php/topic,13170
[RELEASED] Panzersoldat: http://ugx-mods.com/forum/index.php/topic,12208

Realism MOD 3.0 under construction...
Support my work here:  [You are not allowed to view external links. Register or Login to see them]

Offline MJPWGaming

  • *
  • - Original Poster (OP) -
  • Pack-a-Puncher
  • Posts: 199
  • Country: us
  • Respect: 50
    • View Profile

Re: Custom Zombie Boss (During Rounds)

« Reply #2 on: June 02, 2015, 04:17:46 pm »
Thanks! I get a error straight off:

Uninitialised variable 'hewhealth'

Offline Harry Bo21

  • *
  • Immortal
  • Posts: 6,634
  • Country: gb
  • Respect: 901
    • HarryBo21
    • View Profile
  • Skype: [email protected]
  • WaW: HarryBo000

Re: Custom Zombie Boss (During Rounds)

« Reply #3 on: June 02, 2015, 04:22:07 pm »
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: [Select]
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
« Last Edit: June 02, 2015, 04:23:38 pm by Harry Bo21 »
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)

Offline MJPWGaming

  • *
  • - Original Poster (OP) -
  • Pack-a-Puncher
  • Posts: 199
  • Country: us
  • Respect: 50
    • View Profile

Re: Custom Zombie Boss (During Rounds)

« Reply #4 on: June 02, 2015, 05:15:41 pm »
Nice! So now it all works, sound and all, BUT the character just looks like any of the other zombies that spawn. :/

Offline Harry Bo21

  • *
  • Immortal
  • Posts: 6,634
  • Country: gb
  • Respect: 901
    • HarryBo21
    • View Profile
  • Skype: [email protected]
  • WaW: HarryBo000

Re: Custom Zombie Boss (During Rounds)

« Reply #5 on: June 02, 2015, 06:06:13 pm »
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: [Select]
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

Offline HitmanVere

  • Eviscerator
  • UGX V.I.P.
  • Posts: 3,852
  • Country: fi
  • Respect: 764
    • View Profile

Re: Custom Zombie Boss (During Rounds)

« Reply #6 on: June 02, 2015, 06:19:23 pm »
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

Offline MJPWGaming

  • *
  • - Original Poster (OP) -
  • Pack-a-Puncher
  • Posts: 199
  • Country: us
  • Respect: 50
    • View Profile

Re: Custom Zombie Boss (During Rounds)

« Reply #7 on: June 02, 2015, 06:35:17 pm »
change these to you desired models

Code: [Select]
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 :/

Offline Harry Bo21

  • *
  • Immortal
  • Posts: 6,634
  • Country: gb
  • Respect: 901
    • HarryBo21
    • View Profile
  • Skype: [email protected]
  • WaW: HarryBo000

Re: Custom Zombie Boss (During Rounds)

« Reply #8 on: June 02, 2015, 06:44:19 pm »
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 ;)

Offline MJPWGaming

  • *
  • - Original Poster (OP) -
  • Pack-a-Puncher
  • Posts: 199
  • Country: us
  • Respect: 50
    • View Profile

Re: Custom Zombie Boss (During Rounds)

« Reply #9 on: June 02, 2015, 07:01:13 pm »
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

Offline BluntStuffy

  • *
  • The Decider
  • Posts: 961
  • Country: nl
  • Respect: 1112
  • It aint much, if it aint Dutch
    • @BluntZombie' Twitter Feed
    • StuffyZombie's YouTube Channel
    • View Profile
  • Skype: Bluntstuffy
  • WaW: BluntStuffy

Re: Custom Zombie Boss (During Rounds)

« Reply #10 on: June 02, 2015, 07:57:03 pm »
In _zombiemode in the precache_models() function add:

Code: [Select]
	precachemodel( "char_ger_ansel_body" ); 
precachemodel( "char_ger_honorgd_zombiehead1_1" );

and try again..



EDIT: And also set
Code: [Select]
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.
« Last Edit: June 02, 2015, 08:16:24 pm by BluntStuffy »

Marked as best answer by MJPWGaming. [23/02/2017, 23:32:30]

Offline MJPWGaming

  • *
  • - Original Poster (OP) -
  • Pack-a-Puncher
  • Posts: 199
  • Country: us
  • Respect: 50
    • View Profile

Re: Custom Zombie Boss (During Rounds)

« Reply #11 on: June 02, 2015, 09:33:25 pm »
In _zombiemode in the precache_models() function add:

Code: [Select]
	precachemodel( "char_ger_ansel_body" ); 
precachemodel( "char_ger_honorgd_zombiehead1_1" );

and try again..



EDIT: And also set
Code: [Select]
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
« Last Edit: June 02, 2015, 09:37:08 pm by Harry Bo21 »

Offline ElTitoPricus

  • Rotting Walker
  • Posts: 77
  • Country: es
  • Respect: 84
    • ElTitoPricus
    • View Profile
  • Skype: ElTitoPricus

Re: Custom Zombie Boss (During Rounds)

« Reply #12 on: June 02, 2015, 10:33:14 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
« Last Edit: June 02, 2015, 10:33:52 pm by ElTitoPricus »

Offline Eternal_Fire

  • *
  • Pack-a-Puncher
  • Posts: 165
  • Country: au
  • Respect: 16
    • View Profile

Re: Custom Zombie Boss (During Rounds)

« Reply #13 on: June 02, 2015, 10:54:56 pm »
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?
« Last Edit: June 03, 2015, 01:19:21 am by Eternal_Fire »
Money isn't everything but everything has a price

Offline BluntStuffy

  • *
  • The Decider
  • Posts: 961
  • Country: nl
  • Respect: 1112
  • It aint much, if it aint Dutch
    • @BluntZombie' Twitter Feed
    • StuffyZombie's YouTube Channel
    • View Profile
  • Skype: Bluntstuffy
  • WaW: BluntStuffy

Re: Custom Zombie Boss (During Rounds)

« Reply #14 on: June 03, 2015, 07:08:07 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

In spawner add this instead:

Code: [Select]
	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: [Select]
          level thread boss_round_check();



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

Code: [Select]
	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..