Author Topic: Headshot = Instakill  (Read 1173 times)

I need help with my code for the gore mod i'm working on lately.

I want to make headshots instakill for both player/bot.

Here is the pastebin code: http://pastebin.com/jX14myxq

What do you need help with? Is it working?

What do you need help with? Is it working?
I need somebody to edit this code at the end,so headshot will do instakill.
The code is perfectly working and everything.

This is more of a request though. This board is meant for guidance on how to code something, not to ask something to be coded.

This is more of a request though. This board is meant for guidance on how to code something, not to ask something to be coded.
Thanks i guess,it would help if somebody would code this btw.

At the risk of raising a precedent, I'll look into it once I get home.

You have ProjectileData::damage which basically makes any object with the class ProjectileDamage run headshots. Change it to [Whateverthenameofyourgunis]ProjectileData::damage.

Also

//%damLoc = %col.getDamageLocation(%pos);
                %fvec = %col.getForwardVector();
                %vec1 = -getWord(%fvec,1) SPC getWord(%fvec,0) SPC 0;        
                %vec2 = vectorNormalize(%obj.initialVelocity);
              
                %damloc = (vectorDot(%vec1,%vec2) > 0);

                    if(%this.DirectDamageType)
                         %damageType = %this.DirectDamageType;

                %projscale = getWord(%obj.getScale(), 2);
                %directDamage = 15;
                %damage = %directDamage;
              
               %scale = getWord(%col.getScale(),2);
                if(getword(%pos, 2) > getword(%col.getWorldBoxCenter(), 2) - 3.3*%scale)
                {
                        %hidestr = "headskin";
                        for(%i=0;$hat[%i] !$= "";%i++) %hidestr = %hidestr SPC $hat[%i];
                        for(%i=0;$accent[%i] !$= "";%i++) %hidestr = %hidestr SPC $accent[%i];
                       %directdamage = %directdamage * 1000;
                }
                else if(getword(%pos, 2) > getword(%col.getWorldBoxCenter(), 2) - 4.5*%scale)
                {
                        //Torso shot
                        if(%damLoc == 0)
                        {
                                %hidestr = "lhand lhook larm larmslim";
                        }
                        else
                        {
                                %hidestr = "rhand rhook rarm rarmslim";
                        }
                }
                else

You have ProjectileData::damage which basically makes any object with the class ProjectileDamage run headshots.
This is a server sided mod that is supposed to work for every gun.
If thats not possible because the code isn't allowing certain stuff.
Then sure i can add these on guns.


                %directDamage = 15;
                %damage = %directDamage;


why

You can spawn a paint projectile where the bullet collides and check to see what node it hits via that.