NPC pawn UDK

Make 2 text files:
YourNameNPCController.uc
YourNameNPCPawn.uc 

set the text of YourNameNPCController.uc to 
… … … … … … .

class YourNameNPCController.uc extends UTBot;

var Actor Destination;

protected event ExecuteWhatToDoNext()

{

   //Go to the roaming state

   GotoState(‘Roaming’);

}

state Roaming

{

Begin:

   //If we just began or we have reached the Destination

   //pick a new destination – at random

   if(Destination == none || Pawn.ReachedDestination(Destination))

   {

      Destination = FindRandomDest();

   }

   //Find a path to the destination and move to the next node in the path

   MoveToward(FindPathToward(Destination), FindPathToward(Destination));

   //fire off next decision loop

   LatentWhatToDoNext();

}

defaultproperties

{

}

… … … … … … . 

set the text of YourNameNPCPawn.uc to:

… … … … … … . 

class YourNameNPCPawn extends UTPawn

placeable;

var(NPC) SkeletalMeshComponent NPCMesh;

var(NPC) class<AIController> NPCController;

simulated event PostBeginPlay()

{

   if(NPCController != none)

   {

      //set the existing ControllerClass to our new NPCController class

      ControllerClass = NPCController;

   }

   Super.PostBeginPlay();

}

//override to do nothing

simulated function SetCharacterClassFromInfo(class<UTFamilyInfo> Info)

{

}

defaultproperties 

{

   //Setup default NPC mesh

   Begin Object Class=SkeletalmeshComponent Name=NPCMesh0

      SkeletalMesh=SkeletalMesh’YourSkeletalMesh

      PhysicsAsset=PhysicsAsset’YourPhysicsAsset_Physics’

      AnimSets(0)=AnimSet’YourAnimSet_Anims’

      AnimtreeTemplate=AnimTree’YourAnimTree’{

   End Object

   NPCMesh=NPCMesh0

   Mesh=NPCMesh0

   Components.Add(NPCMesh0)

   //Points to your custom AIController class – as the default value

   NPCController=class’Engine.AIController’

}

… … … … … … .

(nb. not the dotted line!)

then compile.