How?
Code: Select all
function eAttitude AttitudeToCreature(Pawn Other)
{
return ATTITUDE_Hate;
}
Code: Select all
function eAttitude AttitudeToCreature(Pawn Other)
{
return ATTITUDE_Hate;
}
ALL stock ScriptedPawns from all 436 versions are the same as described X times in forum - IGNORING Bots.
Code: Select all
// REVIEW ASAP, CHANGES IN V469
function bool SetEnemy( Pawn NewEnemy )
{
local bool result;
local eAttitude newAttitude, oldAttitude;
local bool noOldEnemy;
local float newStrength;
if ( (NewEnemy == Self) || (NewEnemy == None) || (NewEnemy.Health <= 0) || Level.bStartup )
return false;
if ( !bCanWalk && !bCanFly && !NewEnemy.FootRegion.Zone.bWaterZone )
return false;
if ( (NewEnemy.PlayerReplicationInfo == None) && (ScriptedPawn(NewEnemy) == None) )
return false;
if ( NewEnemy.PlayerReplicationInfo != None && NewEnemy.PlayerReplicationInfo.bIsSpectator )
return false;
...
...
Code: Select all
class SeeThem expands Keypoint;
var Pawn P;
event PostBeginPlay()
{
InitialState = 'CheckingThem';
}
function CheckSee(Pawn P)
{
local Pawn Pw, AnEnemy;
local vector EyeSpot;
local float Zh;
local int bestDist, Dist;
local bool bSeenCloser;
if ( P.bDeleteMe || P == None )
{
log ("Exec Drop :: CheckSee :: P :: Invalid !",name);
return;
}
EyeSpot = P.Location;
EyeSpot.Z += P.CollisionHeight * 0.6;
bestDist = P.SightRadius;
foreach AllActors(class'Pawn', Pw)
{
if ( Pw == P )
continue;
else
{
if ( Pw.PlayerReplicationInfo != None && Pw.PlayerReplicationInfo.Team == 0 && !Pw.bHidden )
{
if ( FastTrace (EyeSpot,Pw.Location) )
{
Dist = VSize(EyeSpot - Pw.Location);
if ( Dist < bestDist )
{
bestDist = Dist;
bSeenCloser = True;
AnEnemy = Pw;
}
}
}
}
}
if (bSeenCloser)
{
// P.SeePlayer(AnEnemy);
// if ( Tentacle(P) != None )
// log( P.Name@"has seen"@AnEnemy.GetHumanName()$".",name );
P.Enemy = AnEnemy;
P.Target = AnEnemy;
P.LastSeenPos = AnEnemy.Location;
if ( ScriptedPawn(P).bHasRangedAttack)
P.GoToState('RangedAttack');
else
P.GotoState('Attacking');
}
}
function SetupPositions()
{
local ScriptedPawn S;
foreach AllActors(class'ScriptedPawn',S)
S.SetLocation(S.Location);
}
state CheckingThem
{
Begin:
Sleep(2.2);
SetupPositions(); //Reinforcing after PreBeginPlay collision deal.
ALoop:
if ( Level != None )
{
P = Level.PawnList;
if ( Level.Game != None )
if ( Level.Game.bGameEnded )
GoTo('End');
}
while ( P != None )
{
if ( ScriptedPawn(P) != None && ( P.Enemy == None || !P.LineOfSightTo(P.Enemy) ) && P.Health > 1 && !P.bHidden )
{
if ( P.SightRadius < 10000 )
P.SightRadius = 10000;
CheckSee(P);
}
Sleep(0.003);
if ( P == None || P.bDeleteMe ) // Check if P is not gone during sleep above
break;
else
P = P.NextPawn;
}
FinishLoop:
Sleep(0.1);
GoTo ('ALoop');
End:
P = None;
Stop;
}
Then we need an attacking cow.sektor2111 wrote: ↑Mon Jul 24, 2023 2:33 pmALL stock ScriptedPawns from all 436 versions are the same as described X times in forum - IGNORING Bots.