Jump to content

Modify Firearm Damage?


thaaissa

Recommended Posts

Hey there,

I am currently stuck on a problem that I can't seem to solve. When I edit the inventory_gen.src file to edit the actual weapon damage, it's simply not there and DamageSize doesn't seem to do anything at all.

 

My question is: How can I modify the damage value of as an example "German 9mm Pistol" so whenever I shoot a zombie anywhere, it kills him instantly?

 

Regards,

Noeizy

Link to comment
Share on other sites

Hi. On firearms there are several attributes that can vary based on how far away the enemy is when the 'bullet' impacts them.
These attributes are:
- Damage
- Force

So instead of a 'Damage' or 'Force' attribute like on melee weapons, you need to look for the 'FirePointDamage' and 'FirePointForce' attributes in the firearm's code block.

Continuing with the "German 9mm Pistol" (Firearm_PistolAGen) as an example:
Lines 27748-27759 are these attribute for that firearm:

FirePointRange(0,400.0 *0.01);
FirePointDamage(0,159.0);
FirePointForce(0,25.0);

FirePointRange(1,700.0 *0.01);
FirePointDamage(1,159.0);
FirePointForce(1,25.0);

FirePointRange(2,2500.0 *0.01);
FirePointDamage(2,79.5);
FirePointForce(2,12.5);

FirePointRange(3,10000.0 *0.01);
FirePointDamage(3,39.75);
FirePointForce(3,6.25);


The falloff is controlled by there being different ranges configured and the different damage and force to inflict when it hits an enemy at that range.

This weapon has four ranges configured:
set 0 - (0,
set 1 - (1,
set 2 - (2,
set 3 - (3,

The range is in units, where melee swing range is about 1.5 or so usually. I say units but a unit seems close to about a meter (3.3ft), so can probably just think of them as meters.
Set 0 is range 4.0 (close) (the 400*0.01=4.0, so you could erase that equation completely and just put 4.0)
Set 1 is range 7.0 (not too close)
Set 2 is range 25.0 (much farther away)
Set 3 is range 100.0 (extremely far away)


Each set then has the force and the damage attributes for the bullet to have if it hits an enemy in that range.
FirePointDamage(0,159.0

FirePointDamage(1,159.0

FirePointDamage(2,79.5

FirePointDamage(3,39.75

 

FirePointForce(0,25.0

FirePointForce(1,25.0

FirePointForce(2,12.5

FirePointForce(3,6.25

 


So when the fired bullet hits an enemy, based on the range it is from you when it hits determines how much damage and force the shot does:
From 0-4 range it will use set 0's attributes of 159 damage and 25 force
From 4-7 range it will use set 1's attributes of 159 damage and 25 force
From 7-25 range it will use set 2's attributes of 79.5 damage and 12.5 force
From 25-100 range it will use set 3's attributes of 39.75 damage and 6.25 force

You can just change the 'FirePointDamage' attributes to being very high if you want it to instantly kill with one shot:
FirePointDamage(0,10000.0);

The weapon could be configured with just set 0 if you want with sets 1-3 deleted, then change the range and damage value for set 0 to be very high. This would remove the falloff aspect entirely so bullets will always inflict set 0's high damage up to the distance you specify.

Edited by StinVec
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...