UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

How do i define a zombie as a boss?

broken avatar :(
Created 7 years ago
by whippytrout
0 Members and 1 Guest are viewing this topic.
1,586 views
broken avatar :(
×
broken avatar :(
Location: usgeorgia
Date Registered: 24 April 2013
Last active: 7 months ago
Posts
560
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Mapper
×
whippytrout's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
whippytrout's Contact & Social LinksWhippyTroutWhippyTrout
Hey guys I really need some help with this simple task in order to complete my Alcatraz map.

So I used a public script from AllMods that allows you to spawn a normal zombie but give him a weapon and follow you around. It works great but I want to know how to make the zombie immune to powerups and round changes. (You know the typical stuff a boss needs to be immune from) My problem is that its not working like I thought it should. I set the zombie animname to "boss_zombie" and for a few test runs it worked flawless. But then all of a sudden the zombie is not being defined as a boss anymore. Cod waw is working its evil magic against me again and I've struggled for days and countless hours trying to get this to work.  :'(  Also the only other boss I have in my map is Panzers I'm not sure those play a role in this issue.

Here is the script:

Spoiler: click to open...
Code Snippet
Plaintext
#include maps\_anim; 
#include maps\_utility;
#include common_scripts\utility;
#include maps\_zombiemode_utility;
#include animscripts\utility;
#include animscripts\traverse\shared;
#using_animtree ("generic_human");

freeze_init()
{
//precachemodel("YOUR MODEL NAME HERE");
thread spawn_freeze();
Precacheitem("ray_gun"); // new gun here replace ray_gun every where its name SHOWS
}

spawn_freeze()
{

freezeSpawns = GetEnt( "freeze_boss", "targetname" );

while(1)
{

if(getNumfreeze() == 0)
{


wait 15;

thread spawn_freeze_zombie(freezeSpawns);
wait 60*randomintrange( 2, 3 );
}

wait 1;
}
}

getNumfreeze()
{

count = 0;

zombies = getaiarray( "axis" );

for(i=0;i<zombies.size;i++)
{
if(isDefined(zombies[i].isfreeze))
count++;
}

return count;

}

spawn_freeze_zombie(freezeSpawn)
{

zombies = getaiarray( "axis" );

while(zombies.size > 23)
{
wait .1;
}

playfx(level._effect[ "elec_torso" ],freezeSpawn.origin); //playfx on spawn spot
playsoundatposition( "pre_spawn", freezeSpawn.origin ); //play sound on spawn spot
wait 1.5;
playsoundatposition( "bolt", freezeSpawn.origin ); //play sound on spawn spot
zombie = spawn_zombie(freezeSpawn);
zombie.team = "axis";
zombie.isfreeze = true;

//zombie setModel("YOUR MODEL NAME HERE", true); //add properly rigged model
zombie thread makefreeze();
zombie.IsGunner = true;
zombie.gibbed = true;
                zombie.head_gibbed = true;
                zombie.grenadeawareness = 1;
                zombie.ignoreSuppression = false;
                zombie.suppressionThreshold = 0;
                zombie.noDodgeMove = false;
                zombie.dontShootWhileMoving = true;
               
zombie.goalradius = 1000;
zombie.pathenemyfightdist = 1000;
zombie.pathenemylookahead = 1000;
               
zombie.chatInitialized = true;
                zombie.zombie_move_speed = "run";
                zombie AllowedStances( "crouch" );
zombie animscripts\init::initWeapon( "ray_gun", "primary" );  // new gun here replace ray_gun
zombie animscripts\shared::placeWeaponOn( "ray_gun", "right" ); // new gun here replace ray_gun
                zombie PushPlayer( false );
                zombie.disableArrivals = false;
                zombie.disableExits = false;
                zombie OrientMode( "face point" );
zombie.is_zombie = false;
zombie thread zombdoshoot();
zombie notify( "zombie_acquire_enemy" );
zombie GiveWeapon( "ray_gun", 0 ); // new gun here replace ray_gun
zombie SwitchToWeapon( "ray_gun" ); // new gun here replace ray_gun


}
makefreeze()
{
        self.animname = "boss_zombie";       // I added this to make him immune to powerups and round changes
self.boss = true;                              // This too, but it doesn't work.
self maps\_zombiemode_spawner::zombie_spawn_init("zombie");
self maps\_zombiemode_spawner::zombie_think();
self maps\_zombiemode_spawner::zombie_setup_attack_properties();
self maps\_zombiemode_spawner::find_flesh();
}

zombdoshoot()

{

self endon( "death" );

for(;;)

{

self notify( "zombie_acquire_enemy" );

close_zombie = get_closest_valid_player( self.origin, true );

close_zombie.favoriteenemy = self;

lockspot = close_zombie gettagorigin("b_c_head");

//if (distance(self.origin, close_zombie.origin) < 1000 ) // Checks if there is a known enemy in distance for my boss if [true] shoot
//if(self CanSee(close_zombie)) //shots you if mele range
if ( self IsKnownEnemyInRadius( self.origin, 400 ) ) // Checks if there is a known enemy in a radius from my boss if [true]  dus not shoot teal yore out of Radius
{

self SetLookAt( lockspot, 0.05 );
self AimAtPos( lockspot, 0.09 );
self shoot(5.1);
self notify( "zombie_acquire_enemy" );
}

else

{

self SetLookAt( lockspot, 0.05 );

self AimAtPos( lockspot, 0.09 );

self SetRunToPos( close_zombie.origin );
self notify( "zombie_acquire_enemy" );

}

wait (randomfloatrange(0.2, 1.1)); // how often ai shoots

}

}

If somebody can help me out I'd be extremely grateful,

WhippyTrout

Double Post Merge: February 23, 2017, 04:42:27 am
Oh my god I just got it!!!!!  :nyan: :nyan: :nyan:

All it took was hours of frustration and one UGX help topic to make a light bulb click in my head.

So I just learned that I can use the .variable such as zombie.isfreeze and then add an exception in zombiemode_utility.gsc and zombiemode_powerups.gsc in order to prevent that zombie from being killed and not having to be killed to progress to the next round.

Man I feel relieved. Like that feeling when you take a massive dump after holding it all day.  ;)

Last Edit: February 23, 2017, 04:42:27 am by whippytrout

 
Loading ...