Author Topic: [Suggestion] Power bonus for gun, not clip.  (Read 1021 times)

Offline Nord

  • Commander
  • *****
  • Posts: 1703
  • The Gate is open.
    • View Profile
[Suggestion] Power bonus for gun, not clip.
« on: July 23, 2024, 06:32:54 pm »
I think that "damageBonus" must work when described in weapon definition. If clip have it too, then gun one must prevale.

In fact, it will be great to have overwriting for "power", so a special weapon using standart ammo can make more (or less) damage.

But "damageBonus" for clip seems unnecessary, while for weapon - logical.
« Last Edit: July 23, 2024, 10:28:13 pm by Nord »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8851
    • View Profile
Re: [Suggestion] Power bonus for gun, not clip.
« Reply #1 on: July 23, 2024, 06:50:22 pm »
Whether it is logical or not is arguable, I don't have any strong preference or opinion.

The fact however is that all such attributes currently work in a way that ammo attribute has a bigger priority than the weapon attribute.
Simply changing this (to work the other way around) would break existing mods.
If there is a different/better solution, I don't know.
« Last Edit: July 23, 2024, 06:52:19 pm by Meridian »

Offline Delian

  • Colonel
  • ****
  • Posts: 357
    • View Profile
Re: [Suggestion] Power bonus for gun, not clip.
« Reply #2 on: July 23, 2024, 07:21:26 pm »
powerBonus is used on crafts. damageBonus is used on items.

In real life, all the power comes from the bullet, because bullet contains the chemicals that produce the power to propel the bullet. The gun doesn't produce any power.

In general, I disagree with this suggestion, because you can already write a yscript that changes damage based on what gun and ammo is used. There's also other possible solutions, for instance, simply have a stronger weapon use stronger ammo. Or don't have the weapon use an ammo item at all, in which case the power will only come from the weapon.

Offline Juku121

  • Commander
  • *****
  • Posts: 1819
  • We're all mad here.
    • View Profile
Re: [Suggestion] Power bonus for gun, not clip.
« Reply #3 on: July 23, 2024, 09:37:55 pm »
In real life, all the power comes from the bullet, because bullet contains the chemicals that produce the power to propel the bullet. The gun doesn't produce any power.
Rifling, and generally long barrels; chamber and bore sizes, etc disagree. While the power is due to the round itself, the weapon can magnify that power, and not trivially. Otherwise, everyone would saw off their rifle barrels and go with less clumsy, more carry-convenient guns.


One solution would be to give weapons an attribute that allows them to modify round power, by either replacing, multiplying or flat addition to the ammo's value. I suppose it's already possible via y-scripts, though?
« Last Edit: July 23, 2024, 09:39:41 pm by Juku121 »

Offline Yankes

  • Commander
  • *****
  • Posts: 3276
    • View Profile
Re: [Suggestion] Power bonus for gun, not clip.
« Reply #4 on: July 23, 2024, 10:17:39 pm »
Rifling, and generally long barrels; chamber and bore sizes, etc disagree. While the power is due to the round itself, the weapon can magnify that power, and not trivially. Otherwise, everyone would saw off their rifle barrels and go with less clumsy, more carry-convenient guns.


One solution would be to give weapons an attribute that allows them to modify round power, by either replacing, multiplying or flat addition to the ammo's value. I suppose it's already possible via y-scripts, though?
Yes you can easy make global script that will multiply bullet power bonus based on "barrel".

If I recall correctly, script hook should be named `damageBonusBonusStats`.

Offline Nord

  • Commander
  • *****
  • Posts: 1703
  • The Gate is open.
    • View Profile
Re: [Suggestion] Power bonus for gun, not clip.
« Reply #5 on: July 23, 2024, 10:25:12 pm »
...
Simply changing this (to work the other way around) would break existing mods.
...
Yes, that's problem. Maybe flag-parameter in "vars" can do? Like "GunOverAmmo: true" will set gun in priority and vice versa.
powerBonus is used on crafts. damageBonus is used on items.
Oh, thanks. It's a typo, of course.

Quote
In general, I disagree with this suggestion, because you can already write a yscript that changes damage based on what gun and ammo is used.
It is possible, but will misguide player, as this changes not show changed damage in Ufopedia (sadly, almost no one really reads texts)
One solution would be to give weapons an attribute that allows them to modify round power, by either replacing, multiplying or flat addition to the ammo's value. I suppose it's already possible via y-scripts, though?
Yes, but "damageBonus" looks just as what you saying. For "power" defining ammo strength, and "Bonus" defining gun special properties, like barrel, etc.
In fact, i always thinked that it is just like so, and only today catched my mod working not as i expect. (right when debugging scripted power bonuses)
...
If I recall correctly, script hook should be named `damageBonusBonusStats`.
But will it show bonus in Ufopedia?
« Last Edit: July 23, 2024, 10:27:28 pm by Nord »

Offline Juku121

  • Commander
  • *****
  • Posts: 1819
  • We're all mad here.
    • View Profile
Re: [Suggestion] Power bonus for gun, not clip.
« Reply #6 on: July 23, 2024, 11:11:02 pm »
But will it show bonus in Ufopedia?
Well, no, but a) perhaps one can also hook up the pedia 'power' stat to y-scripts? And b) you can make a fictional gun with whatever values for pedia display. Decouple it from ammo, too, if you wish. 

Offline Nord

  • Commander
  • *****
  • Posts: 1703
  • The Gate is open.
    • View Profile
Re: [Suggestion] Power bonus for gun, not clip.
« Reply #7 on: July 23, 2024, 11:41:29 pm »
a) doubt.
b) if nothing else, yes.

As an example of what i try to do, i want to make an universal battery for energy weapons, that will provide,  lets say, 33 shots for pistol, 25 for rifle and 20 for cannon, while each of this weapon have different damage.
« Last Edit: July 23, 2024, 11:46:02 pm by Nord »

Offline Nord

  • Commander
  • *****
  • Posts: 1703
  • The Gate is open.
    • View Profile
Re: [Suggestion] Power bonus for gun, not clip.
« Reply #8 on: July 27, 2024, 12:39:38 pm »
Will be great if "powerRangeThreshold" and "powerRangeReduction" will work in same manner too.