See here, the zombies are touching their balls!!
I have tried and tried to fix it, but with no avail. I do not know if it's a modeling issue or a programming issue. Below is my pawn and controller class
Pawn:
Code:class ZM_ZombieNerdPawn extends UTPawn Placeable; var Pawn P; // variable to hold the pawn we bump into var() int DamageAmount; //how much brain to munch simulated function PostBeginPlay() { super.PostBeginPlay(); CreateInventory(class'ZMWeap_ZombieGun',false); //wake the physics up SetPhysics(PHYS_Falling); } /*simulated event Bump( Actor Other, PrimitiveComponent OtherComp, Vector HitNormal ) { `Log("Bump"); Super.Bump( Other, OtherComp, HitNormal ); if ( (Other == None) || Other.bStatic) return; P = Pawn(Other); //the pawn we might have bumped into if ( P != None) //if we hit a pawn { if (ZM_ZombieNerdPawn(Other) != None) //we hit another zombie { Return; //dont do owt } else { Super.StartFire(0); } } } */ defaultproperties { Begin Object Name=WPawnSkeletalMeshComponent AnimTreeTemplate=AnimTree'CH_AnimHuman_Tree.AT_CH_Human' SkeletalMesh=SkeletalMesh'zombieEscape.zombie' AnimSets(0)=AnimSet'CH_AnimHuman.Anims.K_AnimHuman_BaseMale' PhysicsAsset=PhysicsAsset'CH_AnimCorrupt.Mesh.SK_CH_Corrupt_Male_Physics' End Object RagdollLifespan=5000.0 //how long the dead body will hang around for AirSpeed=300 GroundSpeed=400 ControllerClass=class'ZM_TestZombieNerdBot' bDontPossess=false SightRadius = 18000.0; HearingThreshold=20000; DamageAmount=100; }
Controller:
Code:class ZM_TestZombieNerdBot extends GameAIController; var Pawn thePlayer; //variable to hold the target pawn http://forums.epicgames.com/showthread.php?t=755213 var Vector ShambleTarget; var Vector HuntTarget; simulated event PostBeginPlay() { super.PostBeginPlay(); } auto state Looking { Begin: if (thePlayer != None) // If we seen a player { hunt(); }else{ shamble(); } } state gotoLocShamble { Begin: //DebugPrint("Going to move to random position"); MoveTo(ShambleTarget); SetTimer(RandRange(1.0,10.0), TRUE, 'checkWhereToGo'); } state gotoLocHunt { Begin: //DebugPrint("Move to player"); MoveTo(HuntTarget); GoToState('Looking'); } event SeePlayer(Pawn SeenPlayer) //bot sees player { thePlayer = SeenPlayer; //make the pawn the target //DebugPrint("I see you"); hunt(); } simulated event checkWhereToGo() { goToState('Looking'); } function shamble() { local int OffsetX; local int OffsetY; thePlayer=None; Pawn.GroundSpeed = 50; //DebugPrint("Shambling Around"); OffsetX = 250*(1-Rand(3)); OffsetY = 250*(1-Rand(3)); ShambleTarget.X = Pawn.Location.X + OffsetX; ShambleTarget.Y = Pawn.Location.Y + OffsetY; ShambleTarget.Z = Pawn.Location.Z; GoToState('gotoLocShamble'); } function hunt() { ClearTimer(); Pawn.GroundSpeed = 150; HuntTarget = thePlayer.Location; if((vsize(Pawn.Location - HuntTarget))< 75) { DebugPrint("FIRING!!!!!!"); pawn.botfire(true); } else { pawn.StopFiring(); } thePlayer=None; GoToState('gotoLocHunt'); } simulated private function DebugPrint(string sMessage) { GetALocalPlayerController().ClientMessage(sMessage); } defaultproperties { }




Reply With Quote


Bookmarks