Post: Friendly Dogs (Little Help)
01-08-2013, 06:39 AM #1
coolbunny1234
the bunny who started it all
(adsbygoogle = window.adsbygoogle || []).push({}); Sup guys, just made a quick video showing you the issue I'm experiencing with a code I'm currently working on. The title explains it, it's a spawn friendly dogs function and it works perfectly up to the part of actually doing damage to the dogs. Here's the link to the video, any ideas as to why it's like this please comment or message me if you feel you know how to fix it. I'll also post the snippet of code that is supposed to be doing damage to the zombies via the dogs. Thanks!



And here is the attack zombie function.

    
DogAttack(){
while(1)
{
zombies = GetAISpeciesArray( "axis", "zombie" );
zombiedogs = GetAiSpeciesArray( "allies", "dog" );
for(d=0;d<zombies.size;d++)
{
for(i=0;i<zombiedogs.size;i++)
{
if(distance(zombiedogs[i].origin, zombies[d].origin) < 50)
{
zombiedogs[i] dodamage(zombies[i].health + 666, zombies[i].origin);
zomb=GetAiSpeciesArray( "axis", "all" );
RadiusDamage(zomb[i].origin, 60, 185, 175);
//zombiedogs thread Think(self);
//zombiedogs thread fry(self);
}
level waittill("zom_kill");
wait 0.05;
}
}
}
}
(adsbygoogle = window.adsbygoogle || []).push({});

The following user thanked coolbunny1234 for this useful post:

AndresKid
01-10-2013, 08:20 PM #2
coolbunny1234
the bunny who started it all
nobody? Would be a great help
01-10-2013, 09:13 PM #3
Taylor
Former Black Knight.
Originally posted by coolbunny1234 View Post
Sup guys, just made a quick video showing you the issue I'm experiencing with a code I'm currently working on. The title explains it, it's a spawn friendly dogs function and it works perfectly up to the part of actually doing damage to the dogs. Here's the link to the video, any ideas as to why it's like this please comment or message me if you feel you know how to fix it. I'll also post the snippet of code that is supposed to be doing damage to the zombies via the dogs. Thanks!



And here is the attack zombie function.

    
DogAttack(){
while(1)
{
zombies = GetAISpeciesArray( "axis", "zombie" );
zombiedogs = GetAiSpeciesArray( "allies", "dog" );
for(d=0;d<zombies.size;d++)
{
for(i=0;i<zombiedogs.size;i++)
{
if(distance(zombiedogs[i].origin, zombies[d].origin) < 50)
{
zombiedogs[i] dodamage(zombies[i].health + 666, zombies[i].origin);
zomb=GetAiSpeciesArray( "axis", "all" );
RadiusDamage(zomb[i].origin, 60, 185, 175);
//zombiedogs thread Think(self);
//zombiedogs thread fry(self);
}
level waittill("zom_kill");
wait 0.05;
}
}
}
}


Maybe try doing a radius damage or something? That might work.
01-13-2013, 11:16 PM #4
nay1995
The Master
Originally posted by coolbunny1234 View Post
Sup guys, just made a quick video showing you the issue I'm experiencing with a code I'm currently working on. The title explains it, it's a spawn friendly dogs function and it works perfectly up to the part of actually doing damage to the dogs. Here's the link to the video, any ideas as to why it's like this please comment or message me if you feel you know how to fix it. I'll also post the snippet of code that is supposed to be doing damage to the zombies via the dogs. Thanks!



And here is the attack zombie function.

    
DogAttack(){
while(1)
{
zombies = GetAISpeciesArray( "axis", "zombie" );
zombiedogs = GetAiSpeciesArray( "allies", "dog" );
for(d=0;d<zombies.size;d++)
{
for(i=0;i<zombiedogs.size;i++)
{
if(distance(zombiedogs[i].origin, zombies[d].origin) < 50)
{
zombiedogs[i] dodamage(zombies[i].health + 666, zombies[i].origin);
zomb=GetAiSpeciesArray( "axis", "all" );
RadiusDamage(zomb[i].origin, 60, 185, 175);
//zombiedogs thread Think(self);
//zombiedogs thread fry(self);
}
level waittill("zom_kill");
wait 0.05;
}
}
}
}


what do you mean, the dogs dont do damage to the zombies? if so ile do a little psuedo code for you

i is going to have to be given to each zombie spawned
if dog.radius <= zombies then
zombie.health -= 50

this is what i would do, anyway this is just psuedo code, hope this inspiers / helps

The following 2 users say thank you to nay1995 for this useful post:

AndresKid, coolbunny1234
01-14-2013, 11:30 PM #5
AndresKid
Error… Cat invasion!
Originally posted by nay View Post
what do you mean, the dogs dont do damage to the zombies? if so ile do a little psuedo code for you

i is going to have to be given to each zombie spawned
if dog.radius <= zombies then
zombie.health -= 50

this is what i would do, anyway this is just psuedo code, hope this inspiers / helps


works perfect thanks.
01-15-2013, 05:46 PM #6
nay1995
The Master
Originally posted by AndresKid View Post
works perfect thanks.


good Smile you took his code and added this?
01-16-2013, 04:45 PM #7
coolbunny1234
the bunny who started it all
Originally posted by nay View Post
good Smile you took his code and added this?

I guess he did, I'll try it in a little bit

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo