Author Topic: Adding Collision to a corpse  (Read 1325 times)

I need the $DamageType::Gun part after someone dies. Is there a way of retrieving this?
How can I add collision to a corpse when it spawns?
« Last Edit: November 08, 2012, 06:32:31 PM by Alphadin »

You can do something like this:
Code: [Select]
package damageType
{
function Armor::damage(%this, %obj, %sourceObject, %position, %damage, %damageType)
{
parent::damage(%this, %obj, %sourceObject, %position, %damage, %damageType);
if(%obj.getDamageLevel() >= 100)
{
%damageName = $DamageType_Array[%damageType];
// whatever you wanna do
}
}
};
activatePackage(damageType);
« Last Edit: November 06, 2012, 02:31:05 AM by Trinick »

If I remember correctly, $DamageType_Array[ $DamageType::Gun ] should yield "Gun".

Oh, yeah, he's right. I didn't see the bolded part of your post so I thought you just wanted the value of it. Updated my code.

If I remember correctly, $DamageType_Array[ $DamageType::Gun ] should yield "Gun".
This is exactly what I needed.


Well, the simple answer is you can't. I'm sure theres some way to do it, but Torque by default removes collision on dead players. You'd have to keep them alive but play the death animation and make them spy themselves and have the text come up etc etc.

Well, the simple answer is you can't. I'm sure theres some way to do it, but Torque by default removes collision on dead players. You'd have to keep them alive but play the death animation and make them spy themselves and have the text come up etc etc.
I noticed that Armor::onDisabled is runned whenever you die. I'm thinking this is what disables collisions, as player armor contains the player animation, collision, and model. I've been toying with it to no avast, trying to disable it.

Well, the simple answer is you can't. I'm sure theres some way to do it, but Torque by default removes collision on dead players. You'd have to keep them alive but play the death animation and make them spy themselves and have the text come up etc etc.
Could always create an invisible static shape were the body is.

Could always create an invisible static shape were the body is.
What if they were hit with a rocket? They'd fly off, so you'd need a tick to keep it attatched to the player.

what about a bot spawned which the player mounts to on death, and then if the rocket hits the corpse would fly too?

I'd like to know a little more about what you're intending to use corpse collision for. There might be an easier way

I'd like to know a little more about what you're intending to use corpse collision for. There might be an easier way
Activating the corpse and reading values it has, and moving the corpse

electrk seemed to think i'd be helpful here so hereigo
Have you tried replacing the corpse with a bot identical to the corpse and giving it the death1 animation?

Yes I have, however I didn't want to code loading the player appearance. Then again I can pull a brackets and just make it all red haha.
I know why he thought you would be useful here.