Author Topic: How to modify weapon fire range?  (Read 909 times)

Ghoul-bb

  • Nameless
  • *
  • Posts: 24
  • Karma: 0
Re: How to modify weapon fire range?
« Reply #15 on: Nov 09, 2018; 05:03 PM »
Quick suggestion - can you look at existing weapons and see the changes made to make them more accurate or high fire rates?

E.g: My char has a sniper rifle (yes, sniper) that fires 1200 rounds per minute (from a sniper?).

My suggestion is to find a high fire rate weapon then compare that to a lower fire rate one and check the values/positions that change - just like we used to do in the "old days" of hacking games and save files, ha!

I hope, I found an accuracy for projectiles: Missiles table, horizontalAccuracy, verticalAccuracy.
But I can only guess, which weapon this projectile belongs to. So, I need time to check this theory.

Kikina the templar

  • Named
  • **
  • Posts: 274
  • Karma: 7
Re: How to modify weapon fire range?
« Reply #16 on: Nov 09, 2018; 11:53 PM »
How find which weapon belongs to which missile ?

- In table "items" look at parameter "startingskills" - for example item 442 "Crusher Cannon" have here number 639
- Look to table "skills". In line 639 is skill named "Crusher Cannon". Look at parameter "events". Here you find "weapon/CrusherCannon"
- now you must uncooking game data and in data/skills/weapon you must find file with name "crushercannon.xml"
- open this file and in script search for line "<pEvents>Fire Missile</pEvents>". Somewhere under this line you find definition "<tAttachmentDef.pszAttached>Crusher Cannon</tAttachmentDef.pszAttached>" this is name of missile
- now go to table "missiles" and find here name "Crusher Cannon", is in line number 25

(Btw, this is a practical demonstration of how you should never have to working with data in your game...)

Ghoul-bb

  • Nameless
  • *
  • Posts: 24
  • Karma: 0
Re: How to modify weapon fire range?
« Reply #17 on: Nov 12, 2018; 12:01 AM »
One problem, with weapon's accuracy, is totally solved. All we need, is located in missiles table.
There are four columns, responsible for missile's accuracy.
They are: horizontalAccuracy, verticleAccuracy. As closer to zero numbers in these columns, as accurate the weapon is.
But... there are two more columns: walkSpeed and walkMax. Modifying these parammeters, I found, that as faster the projectile is, as it is more accurate.
So, there are two ways to change an accuracy for the weapon!

Example: horizontalAccuracy = 0.5 verticleAccuracy = 0.5 walkSpeed = 25 walkMax = 30
if we change only : horizontalAccuracy = 0.25 verticleAccuracy = 0.25 , we will receive two times more accurate weapon.
And, if we change only walkSpeed = 50 walkMax = 60, we also receive the same result, but with two times more faster projectiles.
Of course, it's possible to change all four parameters. We will receive 4 times more accurate weapon with two times faster projectiles.

So, the last problem, which is not solved yet is with extended weapon's range....

Malachor

  • Developer
  • Great Eye / First
  • ****
  • Posts: 2034
  • Karma: 25
Re: How to modify weapon fire range?
« Reply #18 on: Nov 14, 2018; 10:00 PM »
There is something that limits the range: rangeMax column in the Missiles table.
Sure, they are present, but all these limits are similar for all projectiles: rangeMin is 30, RangeMax is 160
Perhaps they are percentages. sniper rifles have a range of 40, if it is multiplied by 1.6, it becomes 64, assault rifles have a range of 25, multiply that by 1.6 it becomes 40. That's very close to the values you saw.

Ghoul-bb

  • Nameless
  • *
  • Posts: 24
  • Karma: 0
Re: How to modify weapon fire range?
« Reply #19 on: Nov 16, 2018; 11:22 PM »
Thanks for advise, I should check this!

btw, do you know, where are located properties for an explosive objects, like gas tanks, oil barrels? (I need their damage and radius)
« Last Edit: Nov 16, 2018; 11:54 PM by Ghoul-bb »

Malachor

  • Developer
  • Great Eye / First
  • ****
  • Posts: 2034
  • Karma: 25
Re: How to modify weapon fire range?
« Reply #20 on: Nov 17, 2018; 12:45 AM »
I couldn't find their damage radius after a quick look, but their damage is in monsters: minBaseDmg/maxBaseDmg, no props though. and check their skills, though nothing jumped out at me in there, but again it was just a quick look.

Ghoul-bb

  • Nameless
  • *
  • Posts: 24
  • Karma: 0
Re: How to modify weapon fire range?
« Reply #21 on: Nov 17, 2018; 04:52 PM »
Who could think, that an explosive objects are located in monsters?!  :o

I found that they have skill number 781 "Crate do damage", after I  opened "skills" table, and added fire damage + field fire damage to statsSkillEventServer column. Now an explosive objects make a huge field of fire after explosion.  So, I'm actually could not do a bigger damage radius for them, but did a fire field. It's pretty cool  ;) ;)

Ghoul-bb

  • Nameless
  • *
  • Posts: 24
  • Karma: 0
Re: How to modify weapon fire range?
« Reply #22 on: Nov 18, 2018; 12:09 AM »
There is something that limits the range: rangeMax column in the Missiles table.
Sure, they are present, but all these limits are similar for all projectiles: rangeMin is 30, RangeMax is 160
Perhaps they are percentages. sniper rifles have a range of 40, if it is multiplied by 1.6, it becomes 64, assault rifles have a range of 25, multiply that by 1.6 it becomes 40. That's very close to the values you saw.

You are a genius! This is exactly what I need!!! I increased rangeMax numbers in 3 times, and now it's possible both to extend rangeBase and (or) in game install an augmentation to the weapon, which increases it's range (more than it was before) And no bugs with different flying directions of projectiles!! But... only one thing makes me unhappy: the game does not draw monsters further than fifty-sixty meters ( the maximum visibility in the game settings is on) When I'm aiming at the monsters, located far away, I can see only an icon of the monster, it's health and distance to it, but I can't see the model...

Ghoul-bb

  • Nameless
  • *
  • Posts: 24
  • Karma: 0
Re: How to modify weapon fire range?
« Reply #23 on: Nov 19, 2018; 12:02 AM »
One more question about damage augmentations for weapons.
There are some damage boost options, located in "affixes" table.
DamageAugmentation with properties like SetStat673('damage_percent', 'all', rand(@game4, 12, 20));
works perfect, and, being installed, it increases weapon damage. Here is all right.
But, there are also some damage boosts, to increase special damage type, like DamageBoostPhysicalWeapon, DamageBoostFireWeapon, and so on. (SetStat673('damage_percent', 'physical', rand(@game4, 20, 36)); )

And all these boosts work in a strange way or do not work at all. I mean, when being installed into weapon, it does nothing: neither damage increasing, nor adding new damage type. Is it a bug or something I don't know?

Malachor

  • Developer
  • Great Eye / First
  • ****
  • Posts: 2034
  • Karma: 25
Re: How to modify weapon fire range?
« Reply #24 on: Nov 19, 2018; 01:01 AM »
Damage augmentation adds damage to a weapon.
Damage boost adds damage to a weapon if it already does that damage type. Check the cond column.

Ghoul-bb

  • Nameless
  • *
  • Posts: 24
  • Karma: 0
Re: How to modify weapon fire range?
« Reply #25 on: Nov 19, 2018; 01:33 AM »
Damage boost adds damage to a weapon if it already does that damage type. Check the cond column.

I see in the code, that it SHOULD add damage to the weapon, but it does not (after applying damage boost, nothing happens with weapon's damage)
For example, the weapon has electrical damage of 20, I add a device  that adds 50%  electrical damage, but the base damage does not increase!

« Last Edit: Nov 19, 2018; 01:59 AM by Ghoul-bb »

Malachor

  • Developer
  • Great Eye / First
  • ****
  • Posts: 2034
  • Karma: 25
Re: How to modify weapon fire range?
« Reply #26 on: Nov 20, 2018; 01:06 AM »
Have you tested it against some zombies, or something?
I haven't done much with affixes, so I haven't noticed if this is normal behaviour for an affix on a mod. Maybe it's only affixes directly applied to a weapon that changes the base damage display.

Ghoul-bb

  • Nameless
  • *
  • Posts: 24
  • Karma: 0
Re: How to modify weapon fire range?
« Reply #27 on: Nov 24, 2018; 03:02 PM »
Have you tested it against some zombies, or something?
I haven't done much with affixes, so I haven't noticed if this is normal behaviour for an affix on a mod. Maybe it's only affixes directly applied to a weapon that changes the base damage display.
No, I did not. For zombies, beasts and others there are another augmentations.
Anyway, I fixed this problem, just added dmg type increase %, so now it works properly.