ey up
Heres another simple(ish) AI for you to play with.
its for a helicopter game ive started making, so its meant for a flying enemy, but it should work with any pawn.
it tries to go behind the player pawn while shooting at it, if the player gets too close.
im going a different route with my ai as it gets more complex, using states (thanks everyone on that thread)
so instead of letting this one dissapear into my hard drive i thaught id give it away.
replace 'PlPawn' with whatever class your player pawn is using.
ere
have fun 
edit:
other stuff below
Heres another simple(ish) AI for you to play with.
its for a helicopter game ive started making, so its meant for a flying enemy, but it should work with any pawn.
it tries to go behind the player pawn while shooting at it, if the player gets too close.
im going a different route with my ai as it gets more complex, using states (thanks everyone on that thread)
so instead of letting this one dissapear into my hard drive i thaught id give it away.
replace 'PlPawn' with whatever class your player pawn is using.
ere
Code:
class AIHeli1 extends GameAIController; var vector MyTarget; simulated event PostBeginPlay() { super.PostBeginPlay(); SetTimer(0.5, true, 'BrainTimer'); } function BrainTimer() { local PlPawn P; //your player pawn class local float Distance; local vector X,Y,Z; local Actor HitActor; local vector HitLoc, HitNormal; foreach WorldInfo.AllPawns(class'PlPawn', P) { if (P != None) //if theres a player pawn { //get the distance Distance = VSize2D(Pawn.Location - P.Location); //if its close if (Distance <= 2000) { if (CanSee(P)) { //look at it and shoot it Pawn.SetDesiredRotation(Rotator(Normal(P.Location))); Pawn.StartFire(0); } else { Pawn.StopFire(0); } // P.GetAxes(Rotation, X, Y, Z); //go behind the player MyTarget = P.Location - 500 * X; //trace to see if theres an obstruction HitActor = Trace(HitLoc, HitNormal, MyTarget, Pawn.Location); if (HitActor != None) // if we will hit something { if (PlPawn(HitActor) != None) //if its plpawn we hit (your player pawn) { GoToState('GetIt'); } else //something else we hit { Return; } } else //nothing in the way { GoToState('GetIt'); } } else //stay where you are { Pawn.StopFire(0); MyTarget = Pawn.Location; MyTarget.Z = Pawn.Location.Z; GoToState('GetIt'); } } } } state GetIt { Begin: MoveTo(MyTarget); } defaultproperties { }

edit:
other stuff below
Comment