TGEA Built in Hitbox system? and fps
by Luke Smith · in Torque Game Engine · 05/21/2007 (2:36 am) · 1 replies
In the demo for tgea i found this in the player.cs script file;
// Damage location details
boxNormalHeadPercentage = 0.83;
boxNormalTorsoPercentage = 0.49;
boxHeadLeftPercentage = 0;
boxHeadRightPercentage = 1;
boxHeadBackPercentage = 0;
boxHeadFrontPercentage = 1;
This implies that TSE already has a hitbox system integrated. Does anybody know anything about this and how would you set it up? Does it explain all this in the documentation or is it stuff that you will have to wait before it is explained.
Also in FPS.cs I found the line;
commandToClient(%this, 'SetGameGUI',"FpsGUI");
This seems to imply to me that there is a whole system integrated for single player fps games that is seperate to the original multiplayer type. Any info on this? Prehaps they are planning on releasing new starter packs for tgea?
// Damage location details
boxNormalHeadPercentage = 0.83;
boxNormalTorsoPercentage = 0.49;
boxHeadLeftPercentage = 0;
boxHeadRightPercentage = 1;
boxHeadBackPercentage = 0;
boxHeadFrontPercentage = 1;
This implies that TSE already has a hitbox system integrated. Does anybody know anything about this and how would you set it up? Does it explain all this in the documentation or is it stuff that you will have to wait before it is explained.
Also in FPS.cs I found the line;
commandToClient(%this, 'SetGameGUI',"FpsGUI");
This seems to imply to me that there is a whole system integrated for single player fps games that is seperate to the original multiplayer type. Any info on this? Prehaps they are planning on releasing new starter packs for tgea?
Torque Owner Tim Heldna
I've used it before in TGE and can tell you it doesn't work very well. Basically, it works of percentages. E.g. it determines a head shot by checking if the top area of the bounding box was hit.
There's not too much you have to do to hook it up, you'll figure it out soon enough. Take a look at game.cs and player.cs - specifically the methods for "GameConnection::onDeath" and "Armor::damage". By default this system isn't hooked up, you will need to add some lines of code to pass the damage location on to the appropriate functions.
Once you have that information it's up to you what you do with it.
For example you could script in a simple damage modifer for your weapon's projectile:
%modifier = 1; // Calculate damage amount applied to players // based on hit location (head, torso, legs) if(%col.getclassName() $= "Player" || %col.getclassName() $= "AIPlayer") { %damLoc = firstWord(%col.getDamageLocation(%pos)); if(%damLoc $= "head") %modifier = %this.HeadMultiplier; else %modifier = 1; }What you have to understand about Torque is that it's derived from the engine that powered the Tribes series of games. As such, a lot of residual Tribes code is in the engine that doesn't work very well, or sometimes not at all. My actual point is that these types of features are technically not part of the SDK nor supported by Garage Games.