Code: Select all
class MyCow expands Cow;
state Grazing
{
function bool TestDirection(vector dir, out vector pick, bool bAlongWall)
{
local vector HitLocation, HitNormal;
local float minDist, Dist;
local actor HitActor;
dir.Z = 0;
dir = Normal(dir);
minDist = FMin(180.0, 6*CollisionRadius);
pick = Location + dir * (minDist + FRand() * 900);
HitActor = Trace(HitLocation, HitNormal, pick, Location, false);
if (HitActor == None) {
HitLocation = pick;
HitNormal.Z = 1;
}
Dist = VSize(HitLocation - Location);
if ( (Dist < minDist) && (HitNormal.Z < 0.7) )
{
if ( !bAlongWall )
return false;
pick = HitLocation - dir + (HitNormal Cross vect(0,0,1)) * 5 * CollisionRadius;
HitActor = Trace(HitLocation, HitNormal, pick , Location, false);
if (HitActor != None)
return false;
}
else
pick = HitLocation - 4 * CollisionRadius * dir;
return true;
}
}
btw had some fun adding some animals from Medors site
the elephant suddenly killed the dogs ( which seem to be a doing a bit weird cycling through animatons it seems)
anyone knows more regular animals? i like to add them
.
.