AtomicTorch Studio Forums

CryoFall => Modding info => Topic started by: MightyMonte88 on January 15, 2021, 12:40:33 pm

Title: Quick question about damageDistribution
Post by: MightyMonte88 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......
Title: Re: Quick question about damageDistribution
Post by: ai_enabled 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!