class FPActor extends KFPawnFootAdjuster;
var int BodyLoc, CrouchLoc;
var Controller PawnController;
simulated function InitAdjuster(string BodySkin, string FaceSkin)
{
if( AdjustingPawn.Controller == none)
return;
LinkMesh(AdjustingPawn.Mesh);
Skins[0] = Material(DynamicLoadObject(BodySkin, class'Material', true));
Skins[1] = Material(DynamicLoadObject(FaceSkin, class'Material', true));
PawnController = AdjustingPawn.Controller;
AdjustingPawn.SetBoneScale(1, 0.001, 'CHR_LArmUpper');
AdjustingPawn.SetBoneScale(2, 0.001, 'CHR_RArmUpper');
AdjustingPawn.SetBoneScale(4, 0.001, 'CHR_Head');
}
simulated function AdjustBones(bool bSetBoneSize)
{
if( !bSetBoneSize )
{
bHidden = false;
AdjustingPawn.SetBoneScale(1, 0.001, 'CHR_LArmUpper');
AdjustingPawn.SetBoneScale(2, 0.001, 'CHR_RArmUpper');
AdjustingPawn.SetBoneScale(4, 0.001, 'CHR_Head');
}
else
{
bHidden = true;
AdjustingPawn.SetBoneScale(1, 1.0, 'CHR_LArmUpper');
AdjustingPawn.SetBoneScale(2, 1.0, 'CHR_RArmUpper');
AdjustingPawn.SetBoneScale(4, 1.0, 'CHR_Head');
}
}
simulated function Tick(float DeltaTime)
{
local Vector PawnRotation,DrawOffset;
local bool BoneReset,bBehindViewToggled,bGottenAdjuster;
local FMXHumanPawn FHumanPawn;
Super.Tick(DeltaTime);
if(PawnController == none)
return;
FHumanPawn = FMXHumanPawn(AdjustingPawn);
PawnRotation = vector(AdjustingPawn.Rotation);
PawnRotation.Z = 0.00;
DrawOffset.Z += AdjustingPawn.EyeHeight-47;
if( AdjustingPawn != none )
{
if( PlayerController(PawnController).bDuck == 1 )
{
PawnRotation = float(CrouchLoc) * Normal(PawnRotation);
SetLocation(AdjustingPawn.Location + PawnRotation + vect(1.35,0,29.5));
}
if( PlayerController(PawnController).bDuck == 0 )
{
PawnRotation = float(BodyLoc) * Normal(PawnRotation);
SetLocation(AdjustingPawn.Location + PawnRotation + vect(0.41,0,6.5));
}
SetRotation(AdjustingPawn.Rotation);
}
if(PawnController != none && !PlayerController(PawnController).bBehindView)
AdjustingPawn.SetTwistLook(FHumanPawn.PawnTwist, 0);
if(!PlayerController(PawnController).bBehindView && bBehindViewToggled)
{
bBehindViewToggled = false;
AdjustBones(false);
bHidden = false;
}
else if(PlayerController(PawnController).bBehindView && !bBehindViewToggled)
{
bBehindViewToggled = true;
AdjustBones(true);
bHidden = true;
}
if( (PawnController.IsInState('PlayerFlying') || PawnController.Pawn.Physics == PHYS_Swimming) && !BoneReset )
{
BoneReset = true;
AdjustBones(true);
bHidden = true;
}
else if( (PawnController.IsInState('PlayerWalking') || PawnController.Pawn.Physics == PHYS_Walking) && !bBehindViewToggled )
{
BoneReset = false;
AdjustBones(false);
bHidden = false;
}
}
Auto state Setup
{
Begin:
AdjustingPawn.bHasFootAdjust = True;
Stop;
}
defaultproperties
{
BodyLoc=-21
CrouchLoc=-23
bHidden=False
bOnlyOwnerSee=True
bOnlyRelevantToOwner=True
bAnimByOwner=True
bClientAnim=True
RemoteRole=ROLE_SimulatedProxy
}