Author Topic: [DONE][Suggestion] Underwater throwing range factor  (Read 2921 times)

Offline Varana

  • Captain
  • ***
  • Posts: 50
    • View Profile
[DONE][Suggestion] Underwater throwing range factor
« on: May 31, 2020, 02:11:39 am »
I would like to have a simple range multiplier for under water missions. Something like

Code: [Select]
  waterThrowRangeFactor: 1.0
  waterShootRangeFactor: 1.0

in global vars.rul or overridden in items.rul.

So if I think throwing of things should normally go half the way, I would set waterThrowRangeFactor: 0.5 in my vars.
And if I think these special grenades should fly only 40% of air range in water I would set for that weapon in items waterThrowRangeFactor: 0.4

And shooting range factor only reducing the max range values of the weapon (maxRange, autoRange, snapRange, aimRange).

Ok, waterShootRangeFactor is not really necessary, I guess I could limit weapons to land only or water only, applying different ranges.
But I would not like to give water grenades the triple weight in inventories only to make them fly less far.


That request is so simple and the problem so old, that I wonder if there is a solution already? But I can not find it, not in ruleset reference and not here in the forum.
« Last Edit: October 08, 2020, 08:13:16 pm by Meridian »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11408
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: water throwing range factor
« Reply #1 on: May 31, 2020, 01:17:03 pm »
there's no easy way to solve this, I suppose the cleanest way would be some itemTransformation which would change your STR_HIGH_EXPLOSIVE into STR_HIGH_EXPLOSIVE_UNDERWATER (with same graphics, name string etc. but different stats) and then back to STR_HIGH_EXPLOSIVE on mission end.

No idea how doable it would be.

Offline Varana

  • Captain
  • ***
  • Posts: 50
    • View Profile
itemTransformation
« Reply #2 on: May 31, 2020, 05:17:00 pm »
I tried that hidden feature "itemTransformation" and "itemTransformations" in "enviroEffects" (thought it would be similar to armorTransformations), but it did not work that way.  :'(
Where can I read something about "itemTransformation"? It would solve the shoot range problem for guns, if it works similar to armorTransformations.

It would not solve the problem of throwing grenades (and other things), because I do not want to make everything heavier under water.
So unhardcoding the throwing range calculation formula a bit would be nice.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11408
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: water throwing range factor
« Reply #3 on: May 31, 2020, 07:08:37 pm »
As far as I know, there is no itemTransformation at all. That's why I said "would be".

If I'm wrong, please let me know.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8597
    • View Profile
Re: [DONE][Suggestion] Underwater throwing range factor
« Reply #4 on: October 08, 2020, 08:20:00 pm »
I would like to have a simple range multiplier for under water missions.

Done. Syntax:

Code: [Select]
constants:
  extendedUnderwaterThrowFactor: 60   # means 60% of the throw range on land

If you need a finer control per item, there are two additional attributes on item level:

Code: [Select]
items:
  - type: STR_MAGNA_BLAST_GRENADE
    throwRange: 20                  # maximum range on land limited to 20 tiles (or less if you're weak)
    underwaterThrowRange: 12        # maximum range underwater limited to 12 tiles (or less if you're weak)

For items using item-level limits, the global factor is ignored.

Offline Varana

  • Captain
  • ***
  • Posts: 50
    • View Profile
Re: [DONE][Suggestion] Underwater throwing range factor
« Reply #5 on: October 08, 2020, 11:01:32 pm »
 8) thanx  :)