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

Ghoul-bb

  • Nameless
  • *
  • Posts: 24
  • Karma: 0
How to modify weapon fire range?
« on: Nov 01, 2018; 02:07 PM »
I'm going to make some changes to weapons,  such as:

- increase fire distance
- increase radius damage for weapons with radius damage attack (grenade launchers, etc.)
- improve accuracy for some weapons
- reduce power drain for weapons with "laser beam"attack

But i don't know how to start, what do i need to modify.

Kikina the templar

  • Named
  • **
  • Posts: 274
  • Karma: 7
Re: How to modify weapon fire range?
« Reply #1 on: Nov 01, 2018; 11:22 PM »
fire distance - not set on weapons, but on weapons missiles, table "missiles", parameter "rangeBase"

weapon accurancy - table "items", parameter "firingErrorIncrease", "firingErrorDecrease", "firingErrorMax"

weapon radius - table "items", parameter "props1", its not only number, but formula (field_fire(100, 100, 50, 80); )

beam weapons energy cost - table "items", parameter "props3" (in most cases), its again formula (SetStat669('energy_max', 400);
SetStat669('energy_decrease_source', 45);
SetStat669('energy_increase_source', 275); )

Morphy

  • Named
  • **
  • Posts: 209
  • Karma: 3
Re: How to modify weapon fire range?
« Reply #2 on: Nov 01, 2018; 11:22 PM »
I'm going to make some changes to weapons,  such as:

- increase fire distance
- increase radius damage for weapons with radius damage attack (grenade launchers, etc.)
- improve accuracy for some weapons
- reduce power drain for weapons with "laser beam"attack

But i don't know how to start, what do i need to modify.

I don't want to crap on your idea.... but i think you'll be disappointed.

With the mods in you can have reasonably high fire rate sniper riffles with longer range.

Most weapons are either close, 2m, middle, up to about 25m, and long, up to about 40m (+the snipers).

These ranges match the game nicely - too far would mean you'll kill everything long before it's even seen you let alone become a threat to you = less fun in the game.

However - I would like to see a few swords with longer reach, 3m instead of the 2m; become like a Claymore, for e.g.

As for the rest - if you add the points to them you will have grenades with massive blast radius... and the "fire from above" attacks end up with some 25 sq metre blast radius = kills shit everywhere!!

I think you'll find that you've made the early stages too easy and the later stages pointless (in terms of character progression).

Reduced power drain for the laser weapons - yeah, i can see the use for that, those bugger drain pretty fast and become "wrist tappers".

Malachor

  • Developer
  • Great Eye / First
  • ****
  • Posts: 2034
  • Karma: 25
Re: How to modify weapon fire range?
« Reply #3 on: Nov 02, 2018; 12:51 AM »
weapon radius - table "items", parameter "props1", its not only number, but formula (field_fire(100, 100, 50, 80); )
To add on from this: field_fire(minDam, maxDam, radius, duration).
 minDam/maxDam is a percentage of the base damage, some weapons can do more than one type, like rad_fire(50, 50, 60) and field_fire(50, 50, 80, 40), or dmg_fire(33, 33) and dmg_toxic(67, 67), so they add up to 100.
radius is divided by 10, so the example 50, means a radius of 5 metres.
duration is in ticks, and there are 20 ticks per second, so 80 means it persists for 4 seconds.

Ghoul-bb

  • Nameless
  • *
  • Posts: 24
  • Karma: 0
Re: How to modify weapon fire range?
« Reply #4 on: Nov 02, 2018; 10:11 PM »
Thanks, guys, it should work!

In my opinion, explosives hawe too small damage radius, so they are useless wery often. I'll fix it . The same with the fire range. I'm not going to make 1 kilometter fire distance... for the first time i'm going to make double range for the firearms, so, i think, this should be enough. Anyway, without good accuracy you can not fire too far, so the player should  stat points to improve  it.

Same with laser weapons - fast power drain makes them less effective, than, for example, rifles (when you shoot from rifles, there is no damage decrease, they became less accurate only )

Ghoul-bb

  • Nameless
  • *
  • Posts: 24
  • Karma: 0
Re: How to modify weapon fire range?
« Reply #5 on: Nov 05, 2018; 08:05 PM »
fire distance - not set on weapons, but on weapons missiles, table "missiles", parameter "rangeBase"


I got a bug in game, while firing the weapon: projectiles does not go straight, they are flying in random directions, after I changed the fire distance. (I increased it in two times)  What's wrong?

Kikina the templar

  • Named
  • **
  • Posts: 274
  • Karma: 7
Re: How to modify weapon fire range?
« Reply #6 on: Nov 05, 2018; 08:47 PM »
I have encountered similar effects while modding game.  :D
Missiles data are set for cooperaton with graphics effects, sometimes is necessary compare several other parameters.
I never really cared much about it.
Also, the speed of missiles is important, at some speeds some weapon models do not work at all.

Ghoul-bb

  • Nameless
  • *
  • Posts: 24
  • Karma: 0
Re: How to modify weapon fire range?
« Reply #7 on: Nov 06, 2018; 08:18 PM »
So, ho to act in this case?
BTW,
 

weapon accurancy - table "items", parameter "firingErrorIncrease", "firingErrorDecrease", "firingErrorMax"

also works strange: I changed these parammeters for XM314 Falcon (pistol) (reduced from 300 to 150) but in game nothing changed: the pistol fires very inacurate.

And, of course, a few words about damage: where are they located? minBaseDmg is 24, maxBaseDmg is 45, but in game this pistol's damage differs:   physical damage (direct):4-7

Kikina the templar

  • Named
  • **
  • Posts: 274
  • Karma: 7
Re: How to modify weapon fire range?
« Reply #8 on: Nov 06, 2018; 11:10 PM »
Now you will understand that modding of this game is real hell  :D
Try read old modding threads on this forum, there is a lot of information of the changes in weapons scheme.
Unfortunately, i can not help you with weapon distances, for new revival weapons i everytime used missiles that have been pre-set in the program.
Weapon acurancy should be reflected on the cursor that showing weapon while firing - "firingErrorMax" is maximum where the cursor can expand, "firingErrorIncrease" is speed of expanding, "firingErrorDecrease" is speed of restoring this cursor to normal state. Program should be firing missiles only inside this cursor.
Base damage of weapons is in table "items", parameters "minBaseDmg" and "maxBaseDmg". Damage multiplier is set with parameter "dmgIncrement". Accurate transfer "number here" to "number on weapon in game" is not known to me, i always worked with approximate numbers.
« Last Edit: Nov 06, 2018; 11:12 PM by Kikina the templar »

Malachor

  • Developer
  • Great Eye / First
  • ****
  • Posts: 2034
  • Karma: 25
Re: How to modify weapon fire range?
« Reply #9 on: Nov 07, 2018; 10:10 PM »
To add onto Kikina's comments.
The Players table also has firing error max, increase and decrease.
And the item_levels table has baseDamageMultiplyer

Ghoul-bb

  • Nameless
  • *
  • Posts: 24
  • Karma: 0
Re: How to modify weapon fire range?
« Reply #10 on: Nov 07, 2018; 11:15 PM »
Ok, here is my progress in exploration of weapon stuff:

DONE:


1. I found a way how to modify weapon's damage. To do this, we need "props1" column. For example, it has dmg_phys(100,100); We can modify it, like dmg_phys(200,200); In this way the  weapon will do 200% damage in game. Also it is possible to add an extra dmg types here, like fire, toxic, etc.. And, of course, splash damage rad_phys(100,100,30); So, the gun will do radius damage within 3 metters.

2. criticalPct & criticalMult ajusted for all weapons. criticalPct is more common for sniper weapons, rare for rapid fire firearms. (in vanilla for most weapons there was ZERO chance for a critical hit. WTF? )
 If I'n not mistaking, critical hits work in this way:
For example, critical chance is 5%, and criticalMult should be how many percent from the base damage will be added to the final damage in case of critical. Right?
So, if current weapon does 10 units of damage, has 5 criticalPct and criticalMult 50, it means, that only five bullets from 100 fired rounds will do 50% extra damage (10 + 10*0.5 = 15), right?

3. Power drain is decreased for laser weapons, also increased energy capacity for them.

TODO:

1. Weapon's range. As I told before, messing with parameter "rangeBase" in missiles table resulted in an error, so i have another idea, what to do. There are different augments, like fuel, battery, relic, ammo, which gives something extra to the weapon parammeters. And we just need to increase weapon's fire range with these augmentations. But usually they provide something like +3% ~ +7%, and it is not serious. We need to change these numbers to 80%-100%, but how? Where these characteristics are located?

2. Fire rate for weapons. How to change it?
Actually it is not very important, but interesting for me.
« Last Edit: Nov 08, 2018; 10:48 AM by Ghoul-bb »

Ghoul-bb

  • Nameless
  • *
  • Posts: 24
  • Karma: 0
Re: How to modify weapon fire range?
« Reply #11 on: Nov 08, 2018; 12:47 PM »
I found a way how to extend little bit fire distance.
Everything necessary is located in "affixes" table.
But there is a limit for the weapon fire range, and it depends of the weapon class. as far, as I now, (i did some tests) for pistols max range is 28 metters, for assault rifles - 39 metters, for sniper weapons - 63 metters.
So, If we put 200% range boost mod into the weapon (for example, with base range of 25m) we will receive only 39m effective range for this weapon (not 75 m)!!!
So, there should be something, what limits this range!!!!

Morphy

  • Named
  • **
  • Posts: 209
  • Karma: 3
Re: How to modify weapon fire range?
« Reply #12 on: Nov 08, 2018; 08:57 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!

Malachor

  • Developer
  • Great Eye / First
  • ****
  • Posts: 2034
  • Karma: 25
Re: How to modify weapon fire range?
« Reply #13 on: Nov 09, 2018; 12:27 AM »
There is something that limits the range: rangeMax column in the Missiles table.
And rate of fire is in Items table, column cdTicks. The ingame value is calculated by 153600 divided by cdTicks = rate of fire

Ghoul-bb

  • Nameless
  • *
  • Posts: 24
  • Karma: 0
Re: How to modify weapon fire range?
« Reply #14 on: Nov 09, 2018; 04:58 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