Player Standing Back up after Death Animation
by Chris Byars · in Torque Game Engine · 07/30/2005 (2:45 pm) · 7 replies
Hrm.. what would cause the player to stand back up after playing its death animation?
This indeed is a script issue.. suicided with a clean TGE, as well as the stock Orc model. Think the problem's in player.cs but don't know what it is. Heh.
This quicktime video (url removed) can give a visual on what's happening when I suicide. I stand up, while still dead. o_O
This indeed is a script issue.. suicided with a clean TGE, as well as the stock Orc model. Think the problem's in player.cs but don't know what it is. Heh.
This quicktime video (url removed) can give a visual on what's happening when I suicide. I stand up, while still dead. o_O
#2
Suicide or death by player, it's the same story.
I've checked the animations, and have determined it to be a script problem, but for where that problem lies, I do not know, but that it most likely lies in fps/server/scripts/player.cs. If I turn on trace() I get this in the console if I die/suicide, repeating forever:
Maybe that's a hint it's in the armor::onDamage() function. In that case, here is mine:
07/30/2005 (3:53 pm)
Thanks :)Suicide or death by player, it's the same story.
I've checked the animations, and have determined it to be a script problem, but for where that problem lies, I do not know, but that it most likely lies in fps/server/scripts/player.cs. If I turn on trace() I get this in the console if I die/suicide, repeating forever:
Entering armor::onDamage(238, 2915, -0.080000) Leaving armor::onDamage() - return 2915
Maybe that's a hint it's in the armor::onDamage() function. In that case, here is mine:
function Armor::onDamage(%this, %obj, %delta)
{
// This method is invoked by the ShapeBase code whenever the
// object's damage level changes.
if (%delta > 0 && %obj.getState() !$= "Dead") {
// Increment the flash based on the amount.
%flash = %obj.getDamageFlash() + ((%delta / %this.maxDamage) * 2);
if (%flash > 0.75)
%flash = 0.75;
%obj.setDamageFlash(%flash);
// If the pain is excessive, let's hear about it.
if (%delta > 10)
%obj.playPain();
}
}
#3
B--
07/30/2005 (4:00 pm)
@Chris: Have you considered using Torsion or TorqueDev to debug the script with Tom Spilmans enhanced debugger patch?B--
#4
07/30/2005 (4:02 pm)
Well, that OnDamage function looks perfect. Have you changed anything inside the player.cs file that could of somehow caused this?
#5
Aha.. I set a repairrate on the health of the player... so after he dies.. his health regenerates still, so he gets back up. That would explain why the dead body is standing and is solid, and if I hit him I hear the "pain" sound.
function Armor::onAdd(%this,%obj)
Sure enough, if I set that to zero, the player remains on the ground and dead.
Edit for the third time:
I have fixed it, made the RepairRate 0 for the dead player. :)
07/30/2005 (4:34 pm)
I used to have the ragdoll pack, removed it, though. Modified the player datablock and the .cs file loaded at the top to reflect the soldier pack..Aha.. I set a repairrate on the health of the player... so after he dies.. his health regenerates still, so he gets back up. That would explain why the dead body is standing and is solid, and if I hit him I hear the "pain" sound.
function Armor::onAdd(%this,%obj)
%obj.setRepairRate(0.08);
Sure enough, if I set that to zero, the player remains on the ground and dead.
Edit for the third time:
I have fixed it, made the RepairRate 0 for the dead player. :)
#6
07/30/2005 (5:12 pm)
Cool, glad you got it to work :)
#7
I had the same problem, not just limited to animations. My player and My AIguard had some troubles to respawn and death, so I found the solution in the way damage was applyed, because I was using applydamage directly instead of armor::damage in the AIplayer attack code.
Using then armor::damage allowed the player to log the damage events and the method setcontrolobject used in the player-death code.
So I think your problem could be the same of mine, the way damage is applyed, or even just setcontrolobject isn't called for any strange reason.
Bye, Thc.
08/01/2005 (5:54 am)
Even if I'm late, have you checked if setcontrolobject was used to ignore the player's input after the death animation?I had the same problem, not just limited to animations. My player and My AIguard had some troubles to respawn and death, so I found the solution in the way damage was applyed, because I was using applydamage directly instead of armor::damage in the AIplayer attack code.
Using then armor::damage allowed the player to log the damage events and the method setcontrolobject used in the player-death code.
So I think your problem could be the same of mine, the way damage is applyed, or even just setcontrolobject isn't called for any strange reason.
Bye, Thc.
Torque Owner Matthew Livingstone
As for the suicude thing, when I first got my TGE, something was called with the suicide that caused it to hang, so I just commented it out. You might want to check the suicide function, and see if it calls anything other than the damage. I'll go take a look in the player file and see if I can spot anything.
Well, have you checked the animation, to make sure that the last keyframe isn't set to the player standing up?
*EDIT* Well the good news is you made me fix my suicide problem. While doing so I looked for anyhitng that would cause your problem, and I can't find anything. So I'm still thinking it's an animation problem.