Author Topic: Quick question about damageDistribution  (Read 665 times)

MightyMonte88

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Quick question about damageDistribution
« on: January 15, 2021, 12:40:33 pm »
Hey AI, i was wondering what would happen if the sum of damageDistribution ended up being a value greater than 1...

example
 

            damageDistribution.Set(DamageType.Kinetic, 0.7);
            damageDistribution.Set(DamageType.Impact,  0.3);
            damageDistribution.Set(DamageType.Heat, 0.2);
            damageDistribution.Set(DamageType.Explosion, 0.3);

I've added a heavy ammunition type 30mm SAPHEI rounds, and i can easily adjust the distribution values to equal 1, but i'm just wondering what happens when like above, the sum totals to 1.5......

ai_enabled

  • AtomicTorch Founder
  • Hero Member
  • *****
  • Posts: 1962
    • View Profile
Re: Quick question about damageDistribution
« Reply #1 on: January 15, 2021, 02:12:53 pm »
Hello!
You can try it easily!
There is a check. An exception "Sum of all damage proportions must be exactly 1." would be thrown during the script initialization
Source code line: https://github.com/AtomicTorchStudio/CryoFall/blob/2be0222a8fbcb89fc80adaa7f98bb3cf65dacdda/Core.cpk/Scripts/Systems/Weapons/Data/WeaponFinalCache.cs#L87

Regards!