Author Topic: Body Parts  (Read 676 times)

Is it possible to check body parts on the default blocklander? For example, if the blocklander is hit in the arm it will do less damage the in the foot. Basically, can specific parts be counted and if there are, what are they?

An interesting way to detect body part collision was made using paint projectiles.  Check in mods with headshot detection.

An interesting way to detect body part collision was made using paint projectiles.  Check in mods with headshot detection.
What would be an example?

Couldn't it detect which node it hits?

What would be an example?
The SG550 uses that method

Couldn't it detect which node it hits?
uh.. no

Bump, I tried it out, but it doesnt kill on headshot.

Bump, I tried it out, but it doesnt kill on headshot.
What exactly did you try out?

Code: [Select]
package Headshot
{
 function ProjectileData::damage(%this, %obj, %col, %fade, %pos, %normal){
  %this2=%this;
  if(%col.getClassName()$="Player"){
   if(getword(%pos,2)>getword(%col.getWorldBoxCenter(),2)-3.3){
    %name = %this.GetName();
    if(%name$="deagleProjectile"){
     %this2=deagleheadshotprojectile;

    // %obj.emote(AlarmProjectile);
    // %obj.client.play2d(headshotSound);
    }
   }
  }
   return Parent::damage(%this2, %obj, %col, %fade, %pos, %normal);
 }
};
ActivatePackage(Headshot);
straight from stratofortress' deagle code

Code: [Select]
package Headshot
{
 function ProjectileData::damage(%this, %obj, %col, %fade, %pos, %normal){
  %this2=%this;
  if(%col.getClassName()$="Player"){
   if(getword(%pos,2)>getword(%col.getWorldBoxCenter(),2)-3.3){
    %name = %this.GetName();
    if(%name$="deagleProjectile"){
     %this2=deagleheadshotprojectile;

    // %obj.emote(AlarmProjectile);
    // %obj.client.play2d(headshotSound);
    }
   }
  }
   return Parent::damage(%this2, %obj, %col, %fade, %pos, %normal);
 }
};
ActivatePackage(Headshot);
straight from stratofortress' deagle code

This is the glitchy and inconsistent version (no support for crouching/sitting/other player sizes/buggy in the first place).  I will see what I can do to find the actual function one that involves paint projectiles

Edit: I couldnt find an example of a mod that utilized the paint projectile method, but I did find this in the TF2 weapon set that would improve the estimation of where the head is.

Code: [Select]
%colscale = getWord(%col.getScale(),2);
      if(getword(%pos, 2) > getword(%col.getWorldBoxCenter(), 2) - 3.3*%colscale)
« Last Edit: September 20, 2011, 12:01:39 AM by Nexus »

What exactly did you try out?
Your SG code.
big snip
I will try this when I wake up in the morning.

Your SG code.
What exactly did you do with it? You can't just copy and paste the package

I will try this when I wake up in the morning.
Like was said, that code is inconsistent and does not account for player scale, nonstandard datablocks, or crouching.