UGX-Mods

Call of Duty 5: World at War => Help Desk => Topic started by: conrad.multan on February 25, 2018, 10:06:40 pm

Title: Boss Fight Help
Post by: conrad.multan on February 25, 2018, 10:06:40 pm
So I have a teleporter at the end of my map where players get teleported to a "boss arena" however I have no clue how I would script a boss and make him spawn when teleported there...
Title: Re: Boss Fight Help
Post by: gympie6 on February 26, 2018, 06:48:34 pm
 :nyan:
Title: Re: Boss Fight Help
Post by: fanmagic on February 26, 2018, 08:33:14 pm
If you like to use my boss zombie, i could change the script for you, so that its compatible with your idea. :)
https://www.ugx-mods.com/forum/scripts/55/fms-napalm-zombie/15400/ (https://www.ugx-mods.com/forum/scripts/55/fms-napalm-zombie/15400/)
Title: Re: Boss Fight Help
Post by: conrad.multan on February 26, 2018, 08:39:20 pm
If you like to use my boss zombie, i could change the script for you, so that its compatible with your idea. :)
https://www.ugx-mods.com/forum/scripts/55/fms-napalm-zombie/15400/ (https://www.ugx-mods.com/forum/scripts/55/fms-napalm-zombie/15400/)
That would be very much appreciated. Im assuming i would be able to edit things like the model and movement speed correct?

Double Post Merge: February 26, 2018, 08:42:13 pm
Basically, I would need it to spawn in a specific zone when it is activated. In my case the zone is called zone_boss but is activated with script_flag/enter_zone_boss... again thanks alot :)
Title: Re: Boss Fight Help
Post by: fanmagic on February 26, 2018, 08:48:13 pm
That would be very much appreciated. Im assuming i would be able to edit things like the model and movement speed correct?

Double Post Merge: February 26, 2018, 08:42:13 pm
Basically, I would need it to spawn in a specific zone when it is activated. In my case the zone is called zone_boss but is activated with script_flag/enter_zone_boss... again thanks alot :)
Yes. You are able to change everything like speed, health, model, fx and so on. I'm not at home, so i'll post the script later on here. (to spawn the zombie in the arena)
Title: Re: Boss Fight Help
Post by: conrad.multan on February 26, 2018, 08:49:26 pm
Thanks Man, thats a +1 for you  ;D
Title: Re: Boss Fight Help
Post by: gympie6 on February 26, 2018, 10:11:32 pm
Yes. You are able to change everything like speed, health, model, fx and so on. I'm not at home, so i'll post the script later on here. (to spawn the zombie in the arena)

I remember there was something wrong with this napalm mod. Does the napalm zombie deal correctly radiusDamage instead of doDamage, if you are going to use the napalm explosion?
Title: Re: Boss Fight Help
Post by: fanmagic on February 27, 2018, 12:31:52 pm
I remember there was something wrong with this napalm mod. Does the napalm zombie deal correctly radiusDamage instead of doDamage, if you are going to use the napalm explosion?
Code Snippet
Plaintext
#include maps\_utility; 
#include common_scripts\utility;
#include maps\_zombiemode_utility;

init()
{
flag_wait( "all_players_connected" );
wait(2);
thread napalm_spawn_cycle();
}

napalm_spawn_cycle()
{
level.napalm = 0;
level.next_napalm = 6;
while(1)
{
level waittill("between_round_over");
level.napalm++;
if( level.napalm == level.next_napalm )
{
//iPrintLNBold("SPAWN_NAPALM");
thread spawn_napalm();
level.napalm = 0;
}
wait (.5);
}
}

spawn_napalm()
{
level endon("boss_killed");

    damage = 20;
    distancehurt = 200;
boss = GetEnt("napalmboss", "targetname");
zombie = spawn_zombie( boss );
zombie.is_boss = true;
    zombie.zombie_move_speed = "walk";
zombie.animname = "zombie";
zombie.health = 10000;
zombie.maxhealth = 10000;
zombie.gibbed = true;
zombie thread check_for_explosion();
zombie thread check_for_running();
zombie thread play_fire_fx();

players = getplayers();
for(i=0;i<players.size;i++)
{
players[i] thread check_for_near_players(zombie, damage);
}
while(1)
{
array_thread( players,::BurnThem,zombie,damage,distancehurt );
wait (1);
}
}

play_fire_fx()
{
level endon("boss_killed");

while(1)
{
fxTag = "j_neck";
PlayFxOnTag( level._effect["napalm_head"], self, fxTag );
wait 1;
}
}

check_for_near_players(zombie, damage)
{
level endon("boss_killed");

near_player_time = 0;

damage = damage * 2;

while(1)
{
if(is_player_valid( self ) & Distance( self.origin,zombie.origin )<50)
{
if(near_player_time == 5)
{
zombie dodamage( zombie.health + 666, zombie.origin );
if(self.health>damage) self DoDamage( damage, self.origin, zombie, zombie );
else radiusdamage(self.origin, 20, damage, 5, zombie);

fx = Spawn( "script_model", self.origin );
fx SetModel( "tag_origin" );
playfxontag(level._effect["fx_explosion_charge_large"], fx, "tag_origin");
wait 3;
fx delete();
level notify("boss_killed");
}
near_player_time++;
//iPrintLN(near_player_time);
}
wait(1);
}
}

check_for_explosion()
{
//iPrintLNBold("Check explosion");

level endon("boss_killed");

while(1)
{
if(self.health < 0)
{
fx = Spawn( "script_model", self.origin );
fx SetModel( "tag_origin" );
playfxontag(level._effect["fx_explosion_charge_large"], fx, "tag_origin");
wait 3;
fx delete();
level notify("boss_killed");
}
wait(1);
}
}

check_for_running()
{
//iPrintLNBold("Check run speed");

level endon("boss_killed");

while(IsAlive( self ))
{
if(self.health < self.maxhealth)
{
var = randomintrange(1, 4);
self set_run_anim( "sprint" + var );                       
self.run_combatanim = level.scr_anim[self.animname]["sprint" + var];
//iPrintLNBold("Sprint");
wait (10);       
self set_run_anim( "walk" + var );                         
self.run_combatanim = level.scr_anim[self.animname]["walk" + var];
//iPrintLNBold("Walk");
self.maxhealth = self.health;
}
wait(1);
}
}

BurnThem(zombie,damage,distancehurt)
{
    zombie endon("death");

ai = GetAISpeciesArray( "axis", "all");
for( i = 0; i < ai.size; i++ )
{
if (distance (ai[i].origin, zombie.origin) < 200 && ai[i].is_boss == false)
{
ai[i] dodamage( damage, ai[i].origin );
}
}

if(is_player_valid( self ) & Distance( self.origin,zombie.origin )<distancehurt)
{
self SetBurn( 1 );

if(self.health>damage) self DoDamage( damage, self.origin, zombie, zombie );
else radiusdamage(self.origin, distancehurt, damage, 5, zombie);
}
}
I think that i corrected it a while ago. Can you tell me exectly what lines of code you are talking about, if the mistake is still there?  ::)
Title: Re: Boss Fight Help
Post by: TGMKTheII on February 27, 2018, 03:37:15 pm
Code Snippet
Plaintext
#include maps\_utility; 
#include common_scripts\utility;
#include maps\_zombiemode_utility;

init()
{
flag_wait( "all_players_connected" );
wait(2);
thread napalm_spawn_cycle();
}

napalm_spawn_cycle()
{
level.napalm = 0;
level.next_napalm = 6;
while(1)
{
level waittill("between_round_over");
level.napalm++;
if( level.napalm == level.next_napalm )
{
//iPrintLNBold("SPAWN_NAPALM");
thread spawn_napalm();
level.napalm = 0;
}
wait (.5);
}
}

spawn_napalm()
{
level endon("boss_killed");

    damage = 20;
    distancehurt = 200;
boss = GetEnt("napalmboss", "targetname");
zombie = spawn_zombie( boss );
zombie.is_boss = true;
    zombie.zombie_move_speed = "walk";
zombie.animname = "zombie";
zombie.health = 10000;
zombie.maxhealth = 10000;
zombie.gibbed = true;
zombie thread check_for_explosion();
zombie thread check_for_running();
zombie thread play_fire_fx();

players = getplayers();
for(i=0;i<players.size;i++)
{
players[i] thread check_for_near_players(zombie, damage);
}
while(1)
{
array_thread( players,::BurnThem,zombie,damage,distancehurt );
wait (1);
}
}

play_fire_fx()
{
level endon("boss_killed");

while(1)
{
fxTag = "j_neck";
PlayFxOnTag( level._effect["napalm_head"], self, fxTag );
wait 1;
}
}

check_for_near_players(zombie, damage)
{
level endon("boss_killed");

near_player_time = 0;

damage = damage * 2;

while(1)
{
if(is_player_valid( self ) & Distance( self.origin,zombie.origin )<50)
{
if(near_player_time == 5)
{
zombie dodamage( zombie.health + 666, zombie.origin );
if(self.health>damage) self DoDamage( damage, self.origin, zombie, zombie );
else radiusdamage(self.origin, 20, damage, 5, zombie);

fx = Spawn( "script_model", self.origin );
fx SetModel( "tag_origin" );
playfxontag(level._effect["fx_explosion_charge_large"], fx, "tag_origin");
wait 3;
fx delete();
level notify("boss_killed");
}
near_player_time++;
//iPrintLN(near_player_time);
}
wait(1);
}
}

check_for_explosion()
{
//iPrintLNBold("Check explosion");

level endon("boss_killed");

while(1)
{
if(self.health < 0)
{
fx = Spawn( "script_model", self.origin );
fx SetModel( "tag_origin" );
playfxontag(level._effect["fx_explosion_charge_large"], fx, "tag_origin");
wait 3;
fx delete();
level notify("boss_killed");
}
wait(1);
}
}

check_for_running()
{
//iPrintLNBold("Check run speed");

level endon("boss_killed");

while(IsAlive( self ))
{
if(self.health < self.maxhealth)
{
var = randomintrange(1, 4);
self set_run_anim( "sprint" + var );                       
self.run_combatanim = level.scr_anim[self.animname]["sprint" + var];
//iPrintLNBold("Sprint");
wait (10);       
self set_run_anim( "walk" + var );                         
self.run_combatanim = level.scr_anim[self.animname]["walk" + var];
//iPrintLNBold("Walk");
self.maxhealth = self.health;
}
wait(1);
}
}

BurnThem(zombie,damage,distancehurt)
{
    zombie endon("death");

ai = GetAISpeciesArray( "axis", "all");
for( i = 0; i < ai.size; i++ )
{
if (distance (ai[i].origin, zombie.origin) < 200 && ai[i].is_boss == false)
{
ai[i] dodamage( damage, ai[i].origin );
}
}

if(is_player_valid( self ) & Distance( self.origin,zombie.origin )<distancehurt)
{
self SetBurn( 1 );

if(self.health>damage) self DoDamage( damage, self.origin, zombie, zombie );
else radiusdamage(self.origin, distancehurt, damage, 5, zombie);
}
}
I think that i corrected it a while ago. Can you tell me exectly what lines of code you are talking about, if the mistake is still there?  ::)

I know you posted it here for all to see but seeing as how you created it I figured it was only right to ask permission to use it. Would you mind?  :)
Title: Re: Boss Fight Help
Post by: gympie6 on February 27, 2018, 06:41:14 pm
Code Snippet
Plaintext
#include maps\_utility; 
#include common_scripts\utility;
#include maps\_zombiemode_utility;

init()
{
flag_wait( "all_players_connected" );
wait(2);
thread napalm_spawn_cycle();
}

napalm_spawn_cycle()
{
level.napalm = 0;
level.next_napalm = 6;
while(1)
{
level waittill("between_round_over");
level.napalm++;
if( level.napalm == level.next_napalm )
{
//iPrintLNBold("SPAWN_NAPALM");
thread spawn_napalm();
level.napalm = 0;
}
wait (.5);
}
}

spawn_napalm()
{
level endon("boss_killed");

    damage = 20;
    distancehurt = 200;
boss = GetEnt("napalmboss", "targetname");
zombie = spawn_zombie( boss );
zombie.is_boss = true;
    zombie.zombie_move_speed = "walk";
zombie.animname = "zombie";
zombie.health = 10000;
zombie.maxhealth = 10000;
zombie.gibbed = true;
zombie thread check_for_explosion();
zombie thread check_for_running();
zombie thread play_fire_fx();

players = getplayers();
for(i=0;i<players.size;i++)
{
players[i] thread check_for_near_players(zombie, damage);
}
while(1)
{
array_thread( players,::BurnThem,zombie,damage,distancehurt );
wait (1);
}
}

play_fire_fx()
{
level endon("boss_killed");

while(1)
{
fxTag = "j_neck";
PlayFxOnTag( level._effect["napalm_head"], self, fxTag );
wait 1;
}
}

check_for_near_players(zombie, damage)
{
level endon("boss_killed");

near_player_time = 0;

damage = damage * 2;

while(1)
{
if(is_player_valid( self ) & Distance( self.origin,zombie.origin )<50)
{
if(near_player_time == 5)
{
zombie dodamage( zombie.health + 666, zombie.origin );
if(self.health>damage) self DoDamage( damage, self.origin, zombie, zombie );
else radiusdamage(self.origin, 20, damage, 5, zombie);

fx = Spawn( "script_model", self.origin );
fx SetModel( "tag_origin" );
playfxontag(level._effect["fx_explosion_charge_large"], fx, "tag_origin");
wait 3;
fx delete();
level notify("boss_killed");
}
near_player_time++;
//iPrintLN(near_player_time);
}
wait(1);
}
}

check_for_explosion()
{
//iPrintLNBold("Check explosion");

level endon("boss_killed");

while(1)
{
if(self.health < 0)
{
fx = Spawn( "script_model", self.origin );
fx SetModel( "tag_origin" );
playfxontag(level._effect["fx_explosion_charge_large"], fx, "tag_origin");
wait 3;
fx delete();
level notify("boss_killed");
}
wait(1);
}
}

check_for_running()
{
//iPrintLNBold("Check run speed");

level endon("boss_killed");

while(IsAlive( self ))
{
if(self.health < self.maxhealth)
{
var = randomintrange(1, 4);
self set_run_anim( "sprint" + var );                       
self.run_combatanim = level.scr_anim[self.animname]["sprint" + var];
//iPrintLNBold("Sprint");
wait (10);       
self set_run_anim( "walk" + var );                         
self.run_combatanim = level.scr_anim[self.animname]["walk" + var];
//iPrintLNBold("Walk");
self.maxhealth = self.health;
}
wait(1);
}
}

BurnThem(zombie,damage,distancehurt)
{
    zombie endon("death");

ai = GetAISpeciesArray( "axis", "all");
for( i = 0; i < ai.size; i++ )
{
if (distance (ai[i].origin, zombie.origin) < 200 && ai[i].is_boss == false)
{
ai[i] dodamage( damage, ai[i].origin );
}
}

if(is_player_valid( self ) & Distance( self.origin,zombie.origin )<distancehurt)
{
self SetBurn( 1 );

if(self.health>damage) self DoDamage( damage, self.origin, zombie, zombie );
else radiusdamage(self.origin, distancehurt, damage, 5, zombie);
}
}
I think that i corrected it a while ago. Can you tell me exectly what lines of code you are talking about, if the mistake is still there?  ::)

I think I still see the line of code which is causing the problem.

in
Code Snippet
Plaintext
check_for_near_players(zombie, damage)
scroll down to

Code Snippet
Plaintext
if(self.health>damage) self DoDamage( damage, self.origin, zombie, zombie );
The "self" in this function is the player and when the player's health is very low it will activate the singleplayer's defeat.
I were you I should change "self" to "zombie" or change DoDamage to RadiusDamage. I think don't think I have to explain it further.  :)
Title: Re: Boss Fight Help
Post by: fanmagic on February 27, 2018, 10:12:32 pm
I think I still see the line of code which is causing the problem.

in
Code Snippet
Plaintext
check_for_near_players(zombie, damage)
scroll down to

Code Snippet
Plaintext
if(self.health>damage) self DoDamage( damage, self.origin, zombie, zombie );
The "self" in this function is the player and when the player's health is very low it will activate the singleplayer's defeat.
I were you I should change "self" to "zombie" or change DoDamage to RadiusDamage. I think don't think I have to explain it further.  :)
I just use doDamage if the player's health is bigger than the damage. If the player has less health the else-statement uses radiusDamage to kill the player and prevant the singleplayer restart. But i havn't tested the script that much in coop, so you could be right. :)


Double Post Merge: February 27, 2018, 10:14:08 pm
I know you posted it here for all to see but seeing as how you created it I figured it was only right to ask permission to use it. Would you mind?  :)
You can use it. Just give credits to everyone ;)
Title: Re: Boss Fight Help
Post by: conrad.multan on February 27, 2018, 10:17:21 pm
So would i download your older version, install it, and then replace the .gsc with this?





Code Snippet
Plaintext
#include maps\_utility; 
#include common_scripts\utility;
#include maps\_zombiemode_utility;

init()
{
flag_wait( "all_players_connected" );
wait(2);
thread napalm_spawn_cycle();
}

napalm_spawn_cycle()
{
level.napalm = 0;
level.next_napalm = 6;
while(1)
{
level waittill("between_round_over");
level.napalm++;
if( level.napalm == level.next_napalm )
{
//iPrintLNBold("SPAWN_NAPALM");
thread spawn_napalm();
level.napalm = 0;
}
wait (.5);
}
}

spawn_napalm()
{
level endon("boss_killed");

    damage = 20;
    distancehurt = 200;
boss = GetEnt("napalmboss", "targetname");
zombie = spawn_zombie( boss );
zombie.is_boss = true;
    zombie.zombie_move_speed = "walk";
zombie.animname = "zombie";
zombie.health = 10000;
zombie.maxhealth = 10000;
zombie.gibbed = true;
zombie thread check_for_explosion();
zombie thread check_for_running();
zombie thread play_fire_fx();

players = getplayers();
for(i=0;i<players.size;i++)
{
players[i] thread check_for_near_players(zombie, damage);
}
while(1)
{
array_thread( players,::BurnThem,zombie,damage,distancehurt );
wait (1);
}
}

play_fire_fx()
{
level endon("boss_killed");

while(1)
{
fxTag = "j_neck";
PlayFxOnTag( level._effect["napalm_head"], self, fxTag );
wait 1;
}
}

check_for_near_players(zombie, damage)
{
level endon("boss_killed");

near_player_time = 0;

damage = damage * 2;

while(1)
{
if(is_player_valid( self ) & Distance( self.origin,zombie.origin )<50)
{
if(near_player_time == 5)
{
zombie dodamage( zombie.health + 666, zombie.origin );
if(self.health>damage) self DoDamage( damage, self.origin, zombie, zombie );
else radiusdamage(self.origin, 20, damage, 5, zombie);

fx = Spawn( "script_model", self.origin );
fx SetModel( "tag_origin" );
playfxontag(level._effect["fx_explosion_charge_large"], fx, "tag_origin");
wait 3;
fx delete();
level notify("boss_killed");
}
near_player_time++;
//iPrintLN(near_player_time);
}
wait(1);
}
}

check_for_explosion()
{
//iPrintLNBold("Check explosion");

level endon("boss_killed");

while(1)
{
if(self.health < 0)
{
fx = Spawn( "script_model", self.origin );
fx SetModel( "tag_origin" );
playfxontag(level._effect["fx_explosion_charge_large"], fx, "tag_origin");
wait 3;
fx delete();
level notify("boss_killed");
}
wait(1);
}
}

check_for_running()
{
//iPrintLNBold("Check run speed");

level endon("boss_killed");

while(IsAlive( self ))
{
if(self.health < self.maxhealth)
{
var = randomintrange(1, 4);
self set_run_anim( "sprint" + var );                       
self.run_combatanim = level.scr_anim[self.animname]["sprint" + var];
//iPrintLNBold("Sprint");
wait (10);       
self set_run_anim( "walk" + var );                         
self.run_combatanim = level.scr_anim[self.animname]["walk" + var];
//iPrintLNBold("Walk");
self.maxhealth = self.health;
}
wait(1);
}
}

BurnThem(zombie,damage,distancehurt)
{
    zombie endon("death");

ai = GetAISpeciesArray( "axis", "all");
for( i = 0; i < ai.size; i++ )
{
if (distance (ai[i].origin, zombie.origin) < 200 && ai[i].is_boss == false)
{
ai[i] dodamage( damage, ai[i].origin );
}
}

if(is_player_valid( self ) & Distance( self.origin,zombie.origin )<distancehurt)
{
self SetBurn( 1 );

if(self.health>damage) self DoDamage( damage, self.origin, zombie, zombie );
else radiusdamage(self.origin, distancehurt, damage, 5, zombie);
}
}
I think that i corrected it a while ago. Can you tell me exectly what lines of code you are talking about, if the mistake is still there?  ::)

Title: Re: Boss Fight Help
Post by: fanmagic on February 27, 2018, 10:20:32 pm
Yes. You are able to change everything like speed, health, model, fx and so on. I'm not at home, so i'll post the script later on here. (to spawn the zombie in the arena)
If you want the boss to spawn after you activate a trigger, you can use something like this:
Code Snippet
Plaintext
 napalm_spawn_cycle()
{
trig = getEnt("boss_trigger","targetname");

trig waittill("trigger" );
thread spawn_napalm();

}
Title: Re: Boss Fight Help
Post by: conrad.multan on February 27, 2018, 10:21:42 pm
Ok awesome thanks man
Greatly appreciated
Title: Re: Boss Fight Help
Post by: fanmagic on February 27, 2018, 10:22:24 pm
So would i download your older version, install it, and then replace the .gsc with this?
It's the same code as the one from the download. Just replace the function like i wrote above.
Title: Re: Boss Fight Help
Post by: conrad.multan on February 28, 2018, 05:24:28 am
Hey man so I finally got to adding the script and:
1. when i spawn i get a fire screen overlay effect
2. zombies don't target me
3. I don;t spawn in with as many points as i should and when I kill zombies the points don;t collect

Was just wondering how I could fix this, again wanted to thank you for what u had already helped me with.
Title: Re: Boss Fight Help
Post by: AllMoDs on February 28, 2018, 04:56:08 pm
I have a boss Script set up i made  you're more than welcome to use if you want
I have two different setups one where you can give your boss a guns and it could shoot projectiles and one without
and the way it's set up you can give your boss multiple attacks PM me if you want the scripts and I'll have no problem helping you set it up with animation sound whatever else you want

this is one of my setup ingame
 
Title: Re: Boss Fight Help
Post by: conrad.multan on March 01, 2018, 12:50:46 am
 :nyan:
Title: Re: Boss Fight Help
Post by: conrad.multan on March 03, 2018, 03:45:04 pm
Hey guys was still hoping for some help with this.
Title: Re: Boss Fight Help
Post by: gympie6 on March 03, 2018, 06:29:06 pm
Hey guys was still hoping for some help with this.

Do you want help with the boss or is it something else? I am confused.
Title: Re: Boss Fight Help
Post by: conrad.multan on March 03, 2018, 06:33:32 pm
The Boss and making it spawn i with a trigger, the boss that i got from fanmagic didn't work and allmods hasn't responded to me, (I PMed him).
Title: Re: Boss Fight Help
Post by: fanmagic on March 03, 2018, 07:52:28 pm
Hey man so I finally got to adding the script and:
1. when i spawn i get a fire screen overlay effect
2. zombies don't target me
3. I don;t spawn in with as many points as i should and when I kill zombies the points don;t collect

Was just wondering how I could fix this, again wanted to thank you for what u had already helped me with.
Most of the bugs you've got doesn't come from my script. You have to let the boss spawn behind a wallhop, if you have windows on your map.
And the fire screen appears, because the script can't find the zombie itself, so you maybe did something wrong.
Title: Re: Boss Fight Help
Post by: conrad.multan on March 03, 2018, 11:12:30 pm
If I were to make him spawn in a separate open area without windows would it work?
Title: Re: Boss Fight Help
Post by: fanmagic on March 03, 2018, 11:38:33 pm
If I were to make him spawn in a separate open area without windows would it work?
He needs a traverse node to start "searching" the player.
Title: Re: Boss Fight Help
Post by: conrad.multan on March 03, 2018, 11:39:36 pm
what if i put find_flesh?

Double Post Merge: March 03, 2018, 11:55:41 pm
Uhh so i tried all of that but the zombies spawns by it self without the trigger and again the issues with points and other zombies chasing the player happened
Title: Re: Boss Fight Help
Post by: fanmagic on March 04, 2018, 12:22:13 am
what if i put find_flesh?

Double Post Merge: March 03, 2018, 11:55:41 pm
Uhh so i tried all of that but the zombies spawns by it self without the trigger and again the issues with points and other zombies chasing the player happened
Then make sure that all of the kvp's in radiant are correct.