Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: ProjectileWeaponSpecAPI functions don't work with ensureClonedSpec  (Read 197 times)

float

  • Captain
  • ****
  • Posts: 269
    • View Profile

e.g. projectileWeaponSpec.setChargeTime(3f) inside WeaponEffectPluginWithInit.init, expected behavior would be to change the charge time of the weapon to 3 seconds, but nothing happens.
Or projectileWeaponSpec.setEnergyPerShot(1000f) inside WeaponEffectPluginWithInit.init, expected behavior would be to change the base flux per shot to 1000, but this doesn't happen. Interestingly though, weapon.getFluxCostToFire does correctly get modified.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24125
    • View Profile
Re: ProjectileWeaponSpecAPI functions don't work with ensureClonedSpec
« Reply #1 on: May 13, 2023, 03:29:47 PM »

All of these happen "too late" to make a difference; when the weapon is created it copies some values from the spec rather than always referring to the spec for them.
Logged