aliens

Author Topic: Power bonus in Ufopedia.  (Read 1215 times)

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
Power bonus in Ufopedia.
« on: September 11, 2024, 01:13:15 am »
From what sorcery ufopedia takes decision to show or not show a string "power bonus: xxx" in the lowest part of a gun description? I have plenty of guns with "damageBonus" and part of them shows that, and part - not.
Here is an example. Both guns have "damageBonus"

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9078
    • View Profile
Re: Power bonus in Ufopedia.
« Reply #1 on: September 11, 2024, 10:08:30 am »
in which mod can I see these weapons?

(if not published yet, then paste their full ruleset pls, including ammo)

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
Re: Power bonus in Ufopedia.
« Reply #2 on: September 11, 2024, 02:14:41 pm »
Here it is:
Spoiler:
  - type: STR_LASER_RIFLE_MOON
    categories: [STR_HUMAN_EQUIPMENT, STR_LASER_WEAPONS, STR_RIFLES]
    size: 0.2
    costBuy: 25
    transferTime: 170
    costSell: 2
    weight: 8
    bigSprite: 214
    floorSprite: 201
    handSprite: 756
    bulletSprite: 15
    fireSound: 11
    powerRangeThreshold: 15
    powerRangeReduction: 2
    ammo:
      0:
        compatibleAmmo: [ STR_LASER_CELL ]
        tuLoad: 10
        tuUnload: 2
    confAimed:
      shots: 1
      spendPerShot: 4
      name: STR_AIMED_SHOT
      ammoSlot: 0
      arcing: false
    confSnap:
      shots: 1
      spendPerShot: 4
      name: STR_SNAP_SHOT
      ammoSlot: 0
      arcing: false
    damageBonus:
      flatHundred: 0.1
    accuracyAuto: 46
    accuracySnap: 65
    accuracyAimed: 100
    tuSnap: 30
    tuAimed: 50
    battleType: 1
    twoHanded: true
    invWidth: 1
    invHeight: 3
    armor: 50
    listOrder: 1050
    tags:
      TAG_RESPRITE: 1
     
  - type: STR_LASER_RIFLE
    categories: [STR_HUMAN_EQUIPMENT, STR_LASER_WEAPONS, STR_RIFLES]
    size: 0.2
    costBuy: 25
    requiresBuy:
      - STR_MARS_LASER_WEAPONS_BLUEPRINTS
    transferTime: 170
    costSell: 20
    weight: 8
    bigSprite: 202
    floorSprite: 201
    handSprite: 708
    bulletSprite: 6
    fireSound: 11
    ammo:
      0:
        compatibleAmmo: [ STR_LASER_CELL ]
        tuLoad: 10
        tuUnload: 2
    confAimed:
      shots: 1
      spendPerShot: 4
      name: STR_AIMED_SHOT
      ammoSlot: 0
      arcing: false
    confSnap:
      shots: 1
      spendPerShot: 4
      name: STR_SNAP_SHOT
      ammoSlot: 0
      arcing: false
    confAuto:
      shots: 3
      spendPerShot: 4
      name: STR_AUTO_SHOT
      ammoSlot: 0
      arcing: false
    damageBonus:
      flatHundred: 0.15
    accuracyAuto: 46
    accuracySnap: 65
    accuracyAimed: 100
    tuSnap: 25
    tuAuto: 34
    tuAimed: 50
    battleType: 1
    twoHanded: true
    invWidth: 1
    invHeight: 3
    armor: 50
    listOrder: 1100
    tags:
      TAG_RESPRITE: 1

  - type: STR_LASER_CELL
    categories: [STR_HUMAN_EQUIPMENT, STR_LASER_WEAPONS, STR_AMMUNITION]
    size: 0.1
    costBuy: 5
    transferTime: 170
    costSell: 2
    weight: 1
    bigSprite: 210
    floorSprite: 206
    handSprite: 740
    hitSound: 19
    hitAnimation: 56
    damageType: 4
    power: 30
    clipSize: 100
    battleType: 2
    armor: 24
    supportedInventorySections: [STR_BACK_PACK,STR_LEFT_LEG,STR_RIGHT_LEG,STR_LEFT_SHOULDER,STR_RIGHT_SHOULDER,STR_LEFT_HAND,STR_RIGHT_HAND,STR_BELT]
    listOrder: 1400
    tags:
      ITEM_AMMO_RECOLOR: 13

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9078
    • View Profile
Re: Power bonus in Ufopedia.
« Reply #3 on: September 11, 2024, 11:13:12 pm »
I assume you have Laser Rifle item defined twice in the ruleset (once the ruleset you sent me and once copypasted from vanilla ruleset).
Depending on file order and "rng", the game loads the vanilla ruleset second and overwrites your definition, making the Laser Rifle ammoless (as in vanilla).
This then displays the power bonus 15 defined on the weapon.

The STR_LASER_RIFLE_MOON is only defined once and is not ammoless.
The power bonus is displayed from the compatible ammo STR_LASER_CELL... and is correctly empty.
The power bonus from the weapon is ignored, because it's irrelevant (damage comes from ammo, not from weapon).

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
Re: Power bonus in Ufopedia.
« Reply #4 on: September 12, 2024, 02:03:39 pm »
I think you are right... but in-game str_laser_rifle uses ammo. Can you explain please, how to rearrange "file order and rng"?

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9078
    • View Profile
Re: Power bonus in Ufopedia.
« Reply #5 on: September 12, 2024, 02:51:32 pm »
I think you are right... but in-game str_laser_rifle uses ammo.

If it uses ammo then it's a different issue.
But I don't think it does.

Can you explain please, how to rearrange "file order and rng"?

Basically just don't have two definitions of the same item in the same mod (in different files).
We cannot guarantee which (file) is loaded first and which second.


Still, it was only my assumption.
I'll be able to confirm 100% and recommend a fix only if you send me the whole mod.

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
Re: Power bonus in Ufopedia.
« Reply #6 on: September 12, 2024, 11:16:05 pm »
Ah, now  i understand. And no. Ruleset contains only one "str_laser_rifle", so overwrite is not an issue.
And yes, if i add " - delete: STR_LASER_RIFLE" in the items.rul, then power bonus from its page vanishes. But still, i'm curious why is it so.

I'll be able to confirm 100% and recommend a fix only if you send me the whole mod.
I'm not ready. :) Maybe we will return to this question later.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9078
    • View Profile
Re: Power bonus in Ufopedia.
« Reply #7 on: September 12, 2024, 11:40:44 pm »
And yes, if i add " - delete: STR_LASER_RIFLE" in the items.rul, then power bonus from its page vanishes. But still, i'm curious why is it so.

Hmm, interesting, I'll try that, maybe also with a proper submod something gets broken/ignored.

Anyway, I think your question is answered... the power bonus was taken from the weapon (15) in one screenshot and from the ammo (empty) in the second screenshot.