Does the 1.5 build support hit detection, as in detecting what part of the player's body was hit(head, arm, torso, etc.), or am I going to have to wait for T3D to do my Gabby Giffords shooter? I read something about this in an old player.cs but am not sure if it's been implemented yet.
Remarkably poor tastes aside, I'm actually not sure about that.
That's part of the idea, but I'd also like to show how much damage 33 9mm shots could do if that law isn't changed. This wouldn't be possible without semi-accurate hit-detection. Think of it like JFK reloaded, but with more modern events. Speaking of which, being able to trace the shots as they go through people and bounce off scenery and display the forensic results would be sweet too, but I'll settle for a body count and a warning.

Even if I scrap this idea altogether, other deathmatch-style projects would Benefit greatly from hit-detection. I did rudimentary head and groin shot detection in TBM by tracing the height of the projectile relative to the player's location(which is always the base of the feet), but that was dependent on the freakish proportions of the lego minifigure. A human-proportioned player using this system would detect shots that should have whizzed passed the target's head as headshots, and any headshots on people who are wounded on the ground as body shots, grossly detracting from the realism of the project.
I haven't found anything that would support the idea that this feature is by default part of TGE. Did some searching around on GG today, but no dice.
so this isn't used for anything then?


Code:
   // Damage location details
   boxNormalHeadPercentage       = 0.83;
   boxNormalTorsoPercentage      = 0.49;
   boxHeadLeftPercentage         = 0;
   boxHeadRightPercentage        = 1;
   boxHeadBackPercentage         = 0;
   boxHeadFrontPercentage        = 1;
DShiznit wrote:
so this isn't used for anything then?


Code:
   // Damage location details
   boxNormalHeadPercentage       = 0.83;
   boxNormalTorsoPercentage      = 0.49;
   boxHeadLeftPercentage         = 0;
   boxHeadRightPercentage        = 1;
   boxHeadBackPercentage         = 0;
   boxHeadFrontPercentage        = 1;


Code:
function ProjectileData::onCollision(%this, %obj, %col, %fade, %pos, %normal)
{
         if ( %col.getClassName() $= "Player" )
         {
            %dmglocation = firstWord( %col.getDamageLocation( %pos ) );
            if ( %dmglocation $= "head" )
            {
               %headshot = true;
            }
         }
         %col.damage( %obj, %pos, ( %headshot == true ? %this.directDamage * 1.5 : %this.directDamage ), "Projectile" );
}
How does it get the damage location then? Does it use different collision meshes in the model?
DShiznit wrote:
How does it get the damage location then? Does it use different collision meshes in the model?


Those percentages you posted are the positions if memory serves me right, if true you'll have to tweak em a bit to match the legodude since it's not as big as kork.
Good find!
Jimmg wrote:
DShiznit wrote:
How does it get the damage location then? Does it use different collision meshes in the model?


Those percentages you posted are the positions if memory serves me right, if true you'll have to tweak em a bit to match the legodude since it's not as big as kork.


I'm not even using the lego dude, but thanks for the info. Perhaps I'll take a look at the demo code, as I think it has working headshot detection...
Jimmg wrote:
DShiznit wrote:
How does it get the damage location then? Does it use different collision meshes in the model?


Those percentages you posted are the positions if memory serves me right, if true you'll have to tweak em a bit to match the legodude since it's not as big as kork.
Good find indeed. On a slightly-related note, I always enjoy how the GG documentation is "hidden", but can be easily viewed with the user-agent of a Google spider. Smile
KermMartian wrote:
On a slightly-related note, I always enjoy how the GG documentation is "hidden", but can be easily viewed with the user-agent of a Google spider. Smile
What
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement