/**
* YRPawn
*
* Creation date: 29/09/2013 21:01
* Copyright 2013, Connor
*/
class YRPawn extends Pawn;
//Scale of the Pawn
//var(Pawn) const float PScale;
//Dynamic light enviornment component to help speed up lighting calc for the pawn
var(Pawn) const DynamicLightEnvironmentComponent LightEnvironment;
//How fast a pawn turns
var(Pawn) const float TurnRate;
//Int which stores the desired yaw of the pawn for turning//constructor and stuff
var int DesiredYaw;
//Int which stores the current yaw of the pawn
var int CurrentYaw;
//Socket to use for atttaching weapons
var(Pawn) const Name WeaponSocketName;
simulated event PostBeginPlay()
{
super.PostBeginPlay();
//Set the desired and current yaw to the same as what the pawn spawned in
DesiredYaw = Rotation.Yaw;
CurrentYaw = Rotation.Yaw;
`Log("pawn pawn pawnd");
}
/**
* Called when the actor has finished initializing a skeletal mesh component's anim tree. This is usually a good
* place to start grabbing anim nodes or skeletal controllers
*
* @param SkelComp Skeletal mesh component that has had its anim tree initialized.
* @network Server and client
*/
//
//Below we will be lerping the yaw of the pawn
simulated function FaceRotation(Rotator NewRotation, float DeltaTime)
{
local Rotator FacingRotation;
// set the desired yaw
if (NewRotation.Yaw != 0)
{
//DesiredYaw = NewRotaion.Yaw;
}
// if the current yaw doesn't match the yaw that we are moving twards then start turning
if (CurrentYaw != DesiredYaw)
{
CurrentYaw = Lerp(CurrentYaw, DesiredYaw, TurnRate * DeltaTime);
}
//Update the facing rotation
FacingRotation.Pitch = 0;
FacingRotation.Yaw = CurrentYaw;
FacingRotation.Roll = 0;
SetRotation(FacingRotation);
}
defaultproperties
{
//Remove the sprite component because evidently we don't need it... i'llf igur eout why later
Components.Remove(Sprite)
// create a light environment for the pawn
Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment
bSynthesizeSHLight=true
bIsCharacterLightEnvironment=true
bUseBooleanEnvironmentShadowing=false
End Object
Components.Add(MyLightEnvironment)
LightEnvironment=MyLightEnvironment
// Create a skeletal mesh component for the pawn so that we can SEE HIM
/*Begin Object Class=SkeletalMeshComponent Name=MySkeletalMeshComponent
bOwnerNoSee=false
bCacheAnimSequenceNodes=false
AlwaysLoadOnClient=true
AlwaysLoadOnServer=true
CastShadow=true//noir
BlockRigidBody=true//physics?
bUpdateSkelWhenNotRendered=false
bIgnoreControllersWhenNotRendered=true
bUpdateKinematicBonesFromAnimation=true
bCastDynamicShadow=true //so stylish ... actually we may want to turn this off
//RBChannel=RBCC_Untiteled3//notsure what this is tbh
RBCollideWithChannels=(Untitled3=true)
LightEnvironment=MyLightEnvironment
bOverrideAttachmentOwnerVisibility=true
bAcceptsDynamicDecals=false//maybe if we make some?
bHasPhysicsAssetInstance=true//actually we may not need this .. buti'll keep it for now
TickGroup=TG_PreAsyncWork
MinDistFactorForKinematicUpdate=0.2f//don't know..
bChartDistanceFactor=true
RBDominanceGroup=20
Scale=1.0f
bAllowAmbientOcclusion=false // shit hurts
bUseOnePassLightingOnTranslucency=true
bPerBoneMotionBlur=false// set to true in ref-code but that looks undesireable to me
EndObject
Mesh=MySkeletalMeshComponent
Components.Add(MySkeletalMeshComponent)*/
Begin Object Class=SkeletalMeshComponent Name=MySkeletalMeshComponent
//MySkeletalMeshComponent=SkeletalMesh'CH_LIAM_Cathode.Mesh.SK_CH_LIAM_Cathode'
bOwnerNoSee=false
bCacheAnimSequenceNodes=false
AlwaysLoadOnClient=true
AlwaysLoadOnServer=true
CastShadow=true
BlockRigidBody=true
bUpdateSkelWhenNotRendered=false
bIgnoreControllersWhenNotRendered=true
bUpdateKinematicBonesFromAnimation=true
bCastDynamicShadow=true
RBChannel=RBCC_Untitled3
RBCollideWithChannels=(Untitled3=true)
LightEnvironment=MyLightEnvironment
bOverrideAttachmentOwnerVisibility=true
bAcceptsDynamicDecals=false
bHasPhysicsAssetInstance=true
TickGroup=TG_PreAsyncWork
MinDistFactorForKinematicUpdate=0.2f
bChartDistanceFactor=true
RBDominanceGroup=20
Scale=1.f
bAllowAmbientOcclusion=false
bUseOnePassLightingOnTranslucency=true
bPerBoneMotionBlur=true
bEnableSoftBodySimulation=True
bSoftBodyAwakeOnStartup=True
End Object
Mesh=MySkeletalMeshComponent
Components.Add(MySkeletalMeshComponent)
Physics=PHYS_Falling
WalkingPhysics=PHYS_Walking
//this is where we will ad bCanPickupInventory=true if we use that for certain things later
}