Click here to Skip to main content
16,013,918 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi im stuck on some udk scripting every time i add one to my level it crashes when i run it the two files im using are .uc one for the bot and one for the controller they are > all im trying to do is create an enemy that moves toward the player(also i have commented two line out which have /* either end )

class Boxbot extends UTPawn
placeable;
 
function AddDefaultInventory()
{
InvManager.CreateInventory(class'AwsomeGame.AwsomeWeapon_RocketLauncher');
 
}
 
event PostBeginPlay()
{
super.PostBeginPlay();
AddDefaultInventory();
 
DefaultProperties
{
Begin Object Name=CollisionCylinder
CollisionHeight=+44.000000
End Object
 
Begin Object Name=WPawnSkeletalMeshComponent
AnimTreeTemplate=AnimTree'CH_AnimHuman_Tree.AT_CH_Human'
SkeletalMesh=SkeletalMesh'CH_IronGuard_Male.Mesh.SK_CH_IronGuard_MaleA'
AnimSets(0)=AnimSet'CH_AnimHuman.Anims.K_AnimHuman_BaseMale'
PhysicsAsset=PhysicsAsset'CH_AnimCorrupt.Mesh.SK_CH_Corrupt_Male_Physics'
End Object
/* 
Mesh=WPawnSkeletalMesh
 
Components.Add(WPawnSkeletalMesh) */
ControllerClass=class'AwsomeGame.boxAIController'
/* InventoryManagerClass=class'InventoryManager' */
 
bJumpCapable=false
bCanJump=false
 
GroundSpeed=200.0
}


and the other class is

class boxAIController extends AIController;

var Actor Target;

event Possess(Pawn inPawn, bool bVehicleTransition)
{
super.Possess(inPawn, bVehicleTransition);
Pawn.SetMovementPhysics();
}


auto state Follow
{
Begin:
Target = GetALocalPlayerController().Pawn;
//Target is an Actor variable defined in my custom AI Controller.
//Of course, you would normally verify that the Pawn is not None before proceeding.

MoveToward(Target, Target, 128);

goto 'Begin';
}

DefaultProperties
{
}
Posted
Comments
[no name] 26-Mar-13 20:41pm    
You are way more likely to get an answer to this if you asked in a forum where more people that know about Unreal scripting hang out. I am not sure that too many people here do this kind of thing. http://udn.epicgames.com/Three/UDKCommunityLinks.html

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900