^It's FacingIdeal In AI.qc
#3518 posted by
ranger on 2024/12/27 05:22:16
delta
Bug Where Monster Turns Into Solid BSP But Is Still Alive
#3519 posted by
ranger on 2024/12/27 09:30:35
I was following one of the tutorials to add strafing to monsters,and i think it might have caused this bug - but i am not familiar with
nothing looks wrong?
have any ideas?
if it helps i vaguely remember reading that if a fiend kills a nuclear box, it took becomes treated as BSP event though it's still alive?
Nvm I Found The Cuase, It's FoundTarget ... I Can't See What's Wrong?
#3520 posted by
ranger on 2024/12/27 10:12:06
void () FoundTarget = //causes invincible bug??
{
local entity head; //new
local float alertRadius; //new
if ( (self.enemy.flags & FL_MONSTER) || (self.enemy.classname == "player") || (self.enemy.classname == "hologram") || (self.enemy.classname == "cbot") || (self.enemy.classname == "CBot_Create")) //new
{
// let other monsters see this monster for a while
sight_entity = self;
sight_entity_time = time;
}
self.show_hostile = time + 2.00; // was 1 wake up other monsters
alertRadius = 512; // Large radius for alert spread (default was usually 1000)?
// Alert all monsters in radius
head = findradius(self.origin, alertRadius);
while(head)
{
if (head.flags & FL_MONSTER)
{
if (head != self) // Don't alert self
{
// Make other monsters aggressive
head.show_hostile = time + 2;
head.enemy = self.enemy;
head.think = head.th_run;
head.nextthink = time + random() * 0.5; // Stagger response times
// Chance to alert even more distant monsters
//if (random() < 0.3) // 30% chance
// {
// head.noise_time = time + 2; // Make noise to attract others
// }
}
}
head = head.chain;
}
//end new
SightSound ();
HuntTarget ();
};