UGX-Mods

Call of Duty: Black Ops 3 => Tutorial Desk => Scripting => Topic started by: death_reaper0 on January 08, 2018, 08:16:22 am

Title: [tutorial] Teleportation Zombie Mini Boss
Post by: death_reaper0 on January 08, 2018, 08:16:22 am
this is a script i made for a zombie that would randomly spawn in place of a normal zombie and teleport after every few seconds a few meters away from where it was. nothing too spectacular but it can throw people off guard if one spawns in the middle of a horde.

for this tutorial i will be using the model called "c_54i_cqb_fullbody" for the zombie, if you want a different one change this at any point in the tutorial to your own model.

first go into your maps zone file and add

Code Snippet
Plaintext
xmodel,c_54i_cqb_fullbody

then go into your mapname.gsc and add
Code Snippet
Plaintext
#precache("xmodel", "c_54i_cqb_fullbody");
above main

then place this

Code Snippet
Plaintext
	level.teleport_zombie_reap_dist = 190;				//teleporting distance
level.teleport_zombie_reap_time_min = 3; //minimum time to teleport
level.teleport_zombie_reap_time_max = 3; //max time to teleport (time to teleport random between min and min + max)
level.teleport_zombie_reap_health_multiplier = 3; //health modifier, this many times more health than a normal zombie
level.teleport_zombie_reap_percent = 15; //spawn rate percent, this many out of 100 will become teleporters
level thread reap_special_zombies();


under

Code Snippet
Plaintext
	level.pathdist_type = PATHDIST_ORIGINAL;


then place this at the bottom of mapname.gsc

Code Snippet
Plaintext
function reap_special_zombies()
{
while(1)
{
zombies = getaispeciesarray( "axis", "all" );
for( i = 0; i < zombies.size; i++ )
{
if( !isDefined( zombies[i].reap_special_zombies ) )
{
zombies[i].reap_special_zombies = true;
if(randomint(100) < level.teleport_zombie_reap_percent)
zombies[i] thread reap_special_zombie_teleporter();
}
}
wait 0.1;
}
}

function reap_special_zombie_teleporter()
{
self endon( "death" );
self.is_teleport_zombie = true;
self.force_gib = false;
self.gibbed = true;
self.maxhealth = self.maxhealth*level.teleport_zombie_reap_health_multiplier;
self.health = self.health*level.teleport_zombie_reap_health_multiplier;
self.is_on_fire = true;
self.no_gib = 1;
self.head_gibbed = true;
self.needs_run_update = true;
self.allowpain = false;
self.ignore_nuke = true;
self.is_boss = true;
self detach( self.headModel, "" );
self detach( self.hatModel, "" );
self setmodel( "c_54i_cqb_fullbody" );
while(1)
{
wait randomint(level.teleport_zombie_reap_time_min)+level.teleport_zombie_reap_time_max;
front = AnglesToForward(self.angles);
dist_pos = self.origin + VectorScale( front, level.teleport_zombie_reap_dist );
if( bullettracepassed( self.origin + (0, 0, 10), dist_pos + (0, 0, 10), false, undefined ) &&
(IsDefined(self.in_the_ground) && self.in_the_ground == false || !IsDefined(self.in_the_ground)))
{
if( IsVehicle( self ) )
self clientfield::set( "tesla_shock_eyes_fx_veh", 1 );
else
self clientfield::set( "tesla_shock_eyes_fx", 1 );
self PlaySound( "zmb_elec_jib_zombie" );
wait .2;
self hide();
wait .2;
self forceteleport(dist_pos);
wait .2;
self show();
wait .2;
if( IsVehicle( self ) )
self clientfield::set( "tesla_shock_eyes_fx_veh", 0 );
else
self clientfield::set( "tesla_shock_eyes_fx", 0 );
}
}
}

that should be it, if you have any questions or issues let me know
Title: Re: [tutorial] Teleportation Zombie Mini Boss
Post by: Psh on January 09, 2018, 07:31:49 pm
Anything to add variety, sounds to me like that blue zombie from the ZCT mod :gusta:
Title: Re: [tutorial] Teleportation Zombie Mini Boss
Post by: Ping998 on January 10, 2018, 09:18:29 pm
Anything to add variety, sounds to me like that blue zombie from the ZCT mod :gusta:

Exactly what I was thinking. They've returned... :alone:
Title: Re: [tutorial] Teleportation Zombie Mini Boss
Post by: novadex on January 29, 2018, 08:01:37 pm
 This is really cool, but in testing i found it messes up Dog rounds. Some dogs become zombies walking backwards on all fours. lol
Title: Re: [tutorial] Teleportation Zombie Mini Boss
Post by: death_reaper0 on January 31, 2018, 01:01:40 pm
This is really cool, but in testing i found it messes up Dog rounds. Some dogs become zombies walking backwards on all fours. lol
i dont use dog rounds in my mod so i didnt know, should of thought of it though, i'll fix this tomorrow
Title: Re: [tutorial] Teleportation Zombie Mini Boss
Post by: novadex on January 31, 2018, 11:31:42 pm
 Another thing ive noticed after playing with these guys further is their teleportation function is not limted to a player volume ( teleporting outside zones and even though monster clipping ). stairs and floors/levels they can even temporally teleport  in the air, skipping past traversals and nodes.

 I really think these guys are valuable, this is a really good idea, nice work, and thanks for looking into fixing them up. 

Title: Re: [tutorial] Teleportation Zombie Mini Boss
Post by: Ping998 on June 11, 2018, 07:01:20 pm
Hey for some reason the fx and sounds don't work for me?

Any suggestions for a fix? :)