Starwaster / DeadlyReentry

Heat and force damage for KSP
Other
31 stars 19 forks source link

PF Cost #24

Closed NathanKell closed 9 years ago

NathanKell commented 9 years ago

You can't add a resource to a part without also increasing the part's cost by (resource maxAmount * resource unitCost). Because KSP takes cost as the wet cost of the part, and then subtracts when any resource is < maxAmount.

Starwaster commented 9 years ago

I made the necessary changes but regarding your explanation: It might have been the intent that cost = wet cost but that's not what happens. The assigned part cost is actually being nullified entirely if the resource cost isn't added in.

Look at the DRE 3.75m shield: Cost = 200 but in the VAB its cost is 900 (its resource cost) and if you use the tweak slider to remove the resource its cost drops to 0. Editing the file to set resource amount to 0 results in -900 cost and tweaking the resource to full amount results in cost = 0.

In neither case though does its wet cost = the assigned part cost

NathanKell commented 9 years ago

This is because of some sort of failsafe added in 1.0 (maybe 1.03?) where if the sum of all resource costs is less than the part cost, the part cost is set to the sum of all resource costs (so part cost will not go negative). This failsafe, for whatever reason, does not apply to the Proc Fairings. Try adding only a hundred ablator to the 3.75 shield, and see how the wet cost stays at 200.