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

Detect when zombie dies?

broken avatar :(
Created 8 years ago
by kamalam
0 Members and 1 Guest are viewing this topic.
1,864 views
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 14 October 2016
Last active: 7 years ago
Posts
7
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
kamalam's Groups
kamalam's Contact & Social Links
How can I detect if a zombie is killed by a player or if he dies in a special area?

I tried to edit the _zm_spawner.gsc but it didnt load my own commands...

Code Snippet
Plaintext
function zombie_death_event( zombie )
{

zombie.marked_for_recycle = 0;

force_explode = 0;
force_head_gib = 0;
zombie waittill( "death", attacker);
soulboxes::sendkill(zombie);
time_of_death = gettime();
if(isDefined(zombie))
{
zombie StopSounds();
}
Marked as best answer by kamalam 8 years ago
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
I didn't look into spawner when I did this, cause I'm a bit gun shy from the previous bugs and stuff, perhaps after beta, but what I did in the mean time is get an array of zombies continuously, in a while loop, and then thread a function on each of them in a foreach loop. In this function I would check if a specific attribute was defined, and if it wasn't, then I would define it and thread a function that would waittill death and do what I wanted, or what ever you want to do with this zombie, waittill damage or whatever. If the attribute was defined, I would simply return, meaning I was already tracking this zombies life.

In waw I didn't do things this way, I edited zombiemode or spawner, I forget already which, when they were damaged I would thread my function with my checks.

Here's a similar example:
Code Snippet
Plaintext
function TrackZombies(){
while(1){
zombies = GetAiSpeciesArray( "axis", "all" );
for(i=0;i<zombies.size;i++){
if(isdefined(zombies[i].mytracking)) continue;
else zombies[i] thread WatchMe();
}
wait(.05);
}
}
function WatchMe(){
        self.mytracking = true;
//self endon("death");
//while... do stuff
//or
// self waittill("death");
//do stuff
}

Once more is sorted out, I would rather just use a function already thread on each zombie as they spawn.
Last Edit: November 01, 2016, 06:29:06 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 14 October 2016
Last active: 7 years ago
Posts
7
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
kamalam's Groups
kamalam's Contact & Social Links
I didn't look into spawner when I did this, cause I'm a bit gun shy from the previous bugs and stuff, perhaps after beta, but what I did in the mean time is get an array of zombies continuously, in a while loop, and then thread a function on each of them in a foreach loop. In this function I would check if a specific attribute was defined, and if it wasn't, then I would define it and thread a function that would waittill death and do what I wanted, or what ever you want to do with this zombie, waittill damage or whatever. If the attribute was defined, I would simply return, meaning I was already tracking this zombies life.

In waw I didn't do things this way, I edited zombiemode or spawner, I forget already which, when they were damaged I would thread my function with my checks.

Here's a similar example:
Code Snippet
Plaintext
function TrackZombies(){
while(1){
zombies = GetAiSpeciesArray( "axis", "all" );
for(i=0;i<zombies.size;i++){
if(isdefined(zombies[i].mytracking)) continue;
else zombies[i] thread WatchMe();
}
wait(.05);
}
}
function WatchMe(){
        self.mytracking = true;
//self endon("death");
//while... do stuff
//or
// self waittill("death");
//do stuff
}

Once more is sorted out, I would rather just use a function already thread on each zombie as they spawn.

Thx it worked perfectly :)

 
Loading ...