Data Realms Fan Forums
http://45.55.195.193/

Deadbolt Headhunter - more damage on headshots (SOLVED)
http://45.55.195.193/viewtopic.php?f=73&t=46135
Page 1 of 1

Author:  Hoovytaurus [ Fri Jan 20, 2017 3:06 pm ]
Post subject:  Deadbolt Headhunter - more damage on headshots (SOLVED)

Deadbolt has a weapon that does more damage on headshots.

Could this be replicated in CC? I'm thinking a bullet that detects if it's about to go into a head and spawn a lot more of itself so it does more damage. First off - would that work, realistically, and second off, how do I do it? I know the spawning bullets bit, but I have no idea how rays work, or at least very very little idea.

Hell, if someone could take five minutes (or more) to just fully explain rays to me that'd be awesome, since they're one thing I haven't gotten into at all. 4zk save the day?

Also: is there a way to make a weapon play a special sound everytime its drawn? Is that done just by using the when-created function?

Found out the first thing! Thanks 4zK!

Author:  Pantera1993 [ Fri Jan 20, 2017 6:49 pm ]
Post subject:  Re: Deadbolt Headhunter - more damage on headshots

I know there's a damage multiplier that you can change in lua but I'm not exactly sure how you would use it to do what you want.

Here's the code from the gibdeathonly global script.

Code:
         if IsAHuman(actor) then
            actor.DamageMultiplier = 0
            
            local human = ToAHuman(actor)
            if human then
               if human.Head then
                  human.Head.DamageMultiplier = 0
               end
               if human.FGArm then
                  human.FGArm.DamageMultiplier = 0
               end
               if human.BGArm then
                  human.BGArm.DamageMultiplier = 0
               end
               if human.FGLeg then
                  human.FGLeg.DamageMultiplier = 0
               end
               if human.BGLeg then
                  human.BGLeg.DamageMultiplier = 0
               end
            end
         end

Author:  Hoovytaurus [ Fri Jan 20, 2017 7:48 pm ]
Post subject:  Re: Deadbolt Headhunter - more damage on headshots

Pantera1993 wrote:
I know there's a damage multiplier that you can change in lua but I'm not exactly sure how you would use it to do what you want.

Here's the code from the gibdeathonly global script.

Code:
         if IsAHuman(actor) then
            actor.DamageMultiplier = 0
            
            local human = ToAHuman(actor)
            if human then
               if human.Head then
                  human.Head.DamageMultiplier = 0
               end
               if human.FGArm then
                  human.FGArm.DamageMultiplier = 0
               end
               if human.BGArm then
                  human.BGArm.DamageMultiplier = 0
               end
               if human.FGLeg then
                  human.FGLeg.DamageMultiplier = 0
               end
               if human.BGLeg then
                  human.BGLeg.DamageMultiplier = 0
               end
            end
         end


That seems to be useful only to use after I've already detected an actor, which is still my main problem. Spawning more bullets just before impact will work fine for me, I just need to know how to tell CC what "just before impact" is.

Author:  Visage [ Sun Jan 22, 2017 11:59 am ]
Post subject:  Re: Deadbolt Headhunter - more damage on headshots (SOLVED)

You should check out the lua for the Ronin RPG-7. It explodes when close to enemies/terrain, and it's pretty easy to cut terrain out of that calculation.

That code will give you the actor, but I'm not sure how hard it would be to find out if you're heading towards a head or not.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/