Hit boxes?
by Josh Albrecht · in Torque Game Engine · 08/23/2001 (12:57 pm) · 8 replies
Are there any? It wouldnt seem so, seeing as how different death animations can be played from the
playDeathAnimation(%targetObject, %damLoc, %damageType);
function, and it tries to see where the player was hit, and play the appropriate death animation. And all of the animations are there. But I only get the same one no matter where I fire. So whats the story?
playDeathAnimation(%targetObject, %damLoc, %damageType);
function, and it tries to see where the player was hit, and play the appropriate death animation. And all of the animations are there. But I only get the same one no matter where I fire. So whats the story?
#2
So for hitboxes, I think somehow limbs might be rather difficult to determine unles syou start doing some fancy math.
08/23/2001 (3:44 pm)
I think that there are no hitboxes (ala HalfLife for collisions, playerdamage etc.) I think it takes everything within the bounds and somehow in the script the player model is divided up mathimatically (in player.cs if I recall). Ex. Top 10% of the model is the head, next 30% is the horso, next 20% is the stomach etc etc etc.So for hitboxes, I think somehow limbs might be rather difficult to determine unles syou start doing some fancy math.
#3
I still have a question about how to print variables to the console. How do you do it?
08/23/2001 (4:03 pm)
Dam, I think you are right. But, they do have the quadrant stuff, which I think they are using to check for side hits (arms). I think I heard (somewhere) that that was how they did it.I still have a question about how to print variables to the console. How do you do it?
#4
The problem would be that the damage being applied (If using the LOS weapon fire code) isn't being applied through an actual collision, so the variables are empty.
08/23/2001 (4:39 pm)
You're doing it correctly.The problem would be that the damage being applied (If using the LOS weapon fire code) isn't being applied through an actual collision, so the variables are empty.
#5
Is the code for an "actual" collision still there? Or was that removed along with the projectile stuff? That would be very annoying.
08/23/2001 (5:00 pm)
Ahhh.... thanks! I will look through it and see what I need to do to make an actual collision. I THOUGHT I was doing it right..... :)Is the code for an "actual" collision still there? Or was that removed along with the projectile stuff? That would be very annoying.
#6
08/23/2001 (8:04 pm)
How would one go about adding hitboxes? I cant even think of where to start...
#7
Basically, you could special case collision detection with players and projectiles. When you detect that a collision should happen between those two, you woudl want to either test the collision against a buch of shapes that are your hitboxes, or try to do polygon accurate collision with the player model and deduce where the player was hit based on textures of the polygon or some such method.
I haven't looked at all at the collision code, so I can't really say what the best way to go about doing it is though.
Josh
08/24/2001 (6:38 am)
To make hit boxes, I would add some code to the collision detection code.Basically, you could special case collision detection with players and projectiles. When you detect that a collision should happen between those two, you woudl want to either test the collision against a buch of shapes that are your hitboxes, or try to do polygon accurate collision with the player model and deduce where the player was hit based on textures of the polygon or some such method.
I haven't looked at all at the collision code, so I can't really say what the best way to go about doing it is though.
Josh
#8
HL did it with a seperate file to read in teh coordinates for the box (or dimensions, I forgot).
I just need to know how one would go about getting boxes around the limbs and making the game recognize that they are there.
08/24/2001 (7:38 am)
I can do the collision math, but not figure out how to put boxes around the bones. Should my modeler do it on the model? Would this cause them to take up extra processing power because the game wants to "draw" them?HL did it with a seperate file to read in teh coordinates for the box (or dimensions, I forgot).
I just need to know how one would go about getting boxes around the limbs and making the game recognize that they are there.
Torque Owner Josh Albrecht
{
%vertPos = firstWord(%damageLocation);
%quadrant = getWord(%damageLocation, 1);
echo("Damage Location: ");
echo(%damageLocation);
echo("Vertical Position: ");
echo(%vertPos);
echo("Quadrant: ");
echo(%quadrant);
echo("Type: ");
echo(%type);
THe code that follows compares strings with most of the variables that I am trying to echo (print to the console). What is the proper format for echoing these stupid things? NOthing other that a blank space appears in my console.... :(