Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: script
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 26-Mar-13 15:34pm
Comments
ThePhantomUpvoter at 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)

  Print Answers RSS
0 Mathew Soji 334
1 Maciej Los 295
2 BillWoodruff 290
3 Afzaal Ahmad Zeeshan 257
4 DamithSL 225
0 OriginalGriff 6,369
1 Sergey Alexandrovich Kryukov 5,973
2 DamithSL 5,183
3 Manas Bhardwaj 4,673
4 Maciej Los 4,045


Advertise | Privacy | Mobile
Web03 | 2.8.1411019.1 | Last Updated 26 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100