Here its more AI for dummies :D
//TODO: self inconscious, self sleep? :D
if(self.dead)
return;
if (CanSee(Enemy.origin))
{
//TODO: reaction time, and vision angle,etc.. realism
self.goalorigin = Enemy.location;
if (self.gunReady && self.ammo)
{
self.status = HUNTING;
}
/*
//TODO: implement reloading and dumbass
else
if (!self.ammo)
{
self.status = RELOADING;
}
else
{
self.status = LOOKDUMB;
}*/
}
else
{
CanSee(self.goalorigin);
//TODO: detect for holes in ground :D
self.status = PATHFINDING;
}
switch(self.status)
{
default:
//idle
RandomNoise(IDLE);
//TODO: change angle? pick a random trace_path and follow?, start a
dialogue with other foe?
break;
case HUNTING:
AnimateShooting();
//TODO: implement precision and mental state (happy, stressed, pain,
fear, etc..)
if (self.frame == FIRING_FRAME)
Shot(self.weapon);
break;
case PATHFINDING:
self.WalkTo(
self.origin +
normalize(self.goalorigin - self.origin) *
self.speed
);
//TODO: read self.speed from a array?
//TODO: sidesteep walking, target forgeting? target change?
break
}
On Wed, 27 Oct 2004 18:18:33 -0500, Jeffrey botman Broome
<[EMAIL PROTECTED]> wrote:
Hasan Aljudy wrote:
> you have teh SDK? what about me?!!!11111 :'(
Yes, here's some of the incredible AI code...
if (CanSeeEnemy())
{
ShootGunsAndShit(); // pow! pow!
}
else
{
KickDownDoorAndYell("DIE FREEMAN!");
}
if (EnemyDead())
{
DoHappyDance();
}
--
Jeffrey "botman" Broome
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders