PDA

View Full Version : When Pawn Dies



Icaroto
03-26-2012, 10:54 PM
I know that a lot of people posted that here, but I just don't figured out the problem here yet...

So, I have a UDN Pawn extends from UTPawn....
I Created a Death Animation....

How to use this animation for ALL the Death Kinds of my game?

I tried to find in UTPawn.uc how its works, but no success...

I just wanna put my Death Animation for any kind of Player Death in my game...

Can someone help? Script? Kismet? Anything?

Thanks ^^

paco
03-26-2012, 11:50 PM
I did that by putting the following in my Pawn class (extends UTPawn):


simulated function PlayDying(class<DamageType> DamageType, vector HitLoc)
{
SetCollisionType(COLLIDE_NoCollision);
FullBodyAnimSlot.SetActorAnimEndNotification(true) ;
FullBodyAnimSlot.PlayCustomAnim('Death_Stinger', 1.0, 0.05, -1.0, false, false);
LifeSpan=1.0;
}

Icaroto
03-27-2012, 07:13 AM
Thanks man! With that udk didn't crash!

But the camera (my game is 2.5D) change for the fisrt view, I suppose that is set on UTPawn too, right? Can someone say which part I most replace in my char file to fix a side camera ?

Icaroto
03-27-2012, 06:45 PM
Can someone help?

The code helps my UDK to not close, but now always happen this:

When HP reach 0 my Pawn come to T-Pose the Mover Attached to him just stay in the local, a Gun (from the UDK robot) fall and then the udk play a death animation in First Person (The one that the camera go down looking to one side to another).

My DeathAnim is in PHYS_RigidBody > DeathAnimSlot > DeathI

MyCustomPawn (UDNPawn)


class UDNPawn extends UTPawn DependsOn(SeqVar_IdlePose);

var float CamOffsetDistance; //Position on Y-axis to lock camera to
var float NextBlendTime;
var AnimNodeSlot DeathAnimSlot;
//override to make player mesh visible by default
simulated event BecomeViewTarget( PlayerController PC )
{
local UTPlayerController UTPC;

Super.BecomeViewTarget(PC);

if (LocalPlayer(PC.Player) != None)
{
UTPC = UTPlayerController(PC);
if (UTPC != None)
{
//set player controller to behind view and make mesh visible
UTPC.SetBehindView(true);
SetMeshVisibility(UTPC.bBehindView);
UTPC.bNoCrosshair = true;
}
}
}

simulated function bool CalcCamera( float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV )
{
out_CamLoc = Location;
out_CamLoc.Y = 1100;
out_CamLoc.Z = 380;

//out_CamLoc.x = 100;
out_CamRot.Pitch = 0;
out_CamRot.Yaw = 49084;
out_CamRot.Roll = 0;
JumpZ = 500;
return true;


}

simulated singular event Rotator GetBaseAimRotation()
{
local rotator POVRot;

POVRot = Rotation;
if( (Rotation.Yaw % 65535 > 16384 && Rotation.Yaw % 65535 < 49560) ||
(Rotation.Yaw % 65535 < -16384 && Rotation.Yaw % 65535 > -49560) )
{
POVRot.Yaw = 32768;
}
else
{
POVRot.Yaw = 0;
}

if( POVRot.Pitch == 0 )
{
POVRot.Pitch = RemoteViewPitch << 8;
}

return POVRot;
}

// The array of items that we will refer as the inventory //
function ChangeIdlePose(SeqAct_ChangeIdlePose MyAction)
{
Idles = MyAction.PoseID;
}


simulated function PlayDying(class<DamageType> DamageType, vector HitLoc)
{
SetCollisionType(COLLIDE_NoCollision);
DeathAnimSlot.SetActorAnimEndNotification(true);
DeathAnimSlot.PlayCustomAnim('DeathI', 1.0, 0.05, -1.0, false, false);
LifeSpan=1.0;
}


defaultproperties
{
CamOffsetDistance=30.0
MaxFootstepDistSq=5000000.0
}

Icaroto
03-27-2012, 10:43 PM
LOL

I think I wrote so wrong that no one understand the problem, sorry...

So here we go again:

- My game is 2,5D
- My custom char extends from UTPawn
- I want him to have just one type of Death ANimation
- Using the code that paco sends, udk stops crash... but now he play some 1st Person Animation from the UDK Robot... not MY animation...

So I want to know if I have to do something else to this works.


:D