View unanswered posts | View active topics It is currently Tue Mar 19, 2024 7:25 am



Reply to topic  [ 4 posts ] 
 Deadbolt Headhunter - more damage on headshots (SOLVED) 
Author Message

Joined: Mon Dec 21, 2015 9:30 am
Posts: 89
Reply with quote
Post 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!


Last edited by Hoovytaurus on Sat Jan 21, 2017 10:34 am, edited 1 time in total.



Fri Jan 20, 2017 3:06 pm
Profile
User avatar

Joined: Wed Jul 06, 2011 5:11 pm
Posts: 226
Reply with quote
Post 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


Fri Jan 20, 2017 6:49 pm
Profile

Joined: Mon Dec 21, 2015 9:30 am
Posts: 89
Reply with quote
Post 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.


Fri Jan 20, 2017 7:48 pm
Profile

Joined: Fri Jul 06, 2012 7:20 am
Posts: 44
Reply with quote
Post 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.


Sun Jan 22, 2017 11:59 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.074s | 15 Queries | GZIP : Off ]