diff --git a/GameData/KerbalismConfig/ConfigTool.cfg b/GameData/KerbalismConfig/ConfigTool.cfg new file mode 100644 index 00000000..a1733034 --- /dev/null +++ b/GameData/KerbalismConfig/ConfigTool.cfg @@ -0,0 +1,226 @@ +@PART:HAS[@ROKConfigTool]:FINAL +{ + // ############################## + // Resources that are handled + // ############################## + // Food + // Water + // Oxygen + // Waste + // Waste Water + // + // LiOH if wanted + // KO2 if wanted + // CO2 tanks for Vacuum scrubber if wanted + + // ############################## + // Values that can be set: + // ############################## + // Crew = int - Defaults to CrewCapacity, number fo crewmembers + // Days = int - Number of days of supplies + // Scrubber = LiOH, KO2, Vacuum + // OxygenProduction = True - Oxygen provided by LOX to GOX converter or Electrolyzer + // WaterProduction = True - Water provided by Fuel cells or other process + // AppendDescription = True - Adds "Supports X crew for Y days." to description + // ReuseVolume = True - Do not add volume to the MFT + + // Default consumption rates and values + // Rates per kerbal-day + @ROKConfigTool + { + // Default values / Set up variables + &Crew = #$/CrewCapacity$ + &Days = 0 + Volume = 0 + Waste = 0 + // Rates + Food = 5.84928 + Oxygen = 591.84 + Water = 3.87072 + } + + @ROKConfigTool:HAS[#Scrubber[LiOH]] + { + LiOH = 1.027296 + @LiOH *= #$Crew$ + @LiOH *= #$Days$ + @Volume += #$LiOH$ + + LiOHWaste = 1.397088 + @LiOHWaste *= #$Crew$ + @LiOHWaste *= #$Days$ + @Waste += #$LiOHWaste$ + } + + @ROKConfigTool:HAS[#Scrubber[KO2]] + { + KO2 = 1.155168 + @KO2 *= #$Crew$ + @KO2 *= #$Days$ + @Volume += #$KO2$ + + KO2Waste = 1.80225 + @KO2Waste *= #$Crew$ + @KO2Waste *= #$Days$ + @Waste += #$KO2Waste$ + // More oxygen than consumed is returned, set flag to true + %OxygenProduction = True + } + + @ROKConfigTool:HAS[#Scrubber[Vacuum]] + { + CO2 = 591.84 + @CO2 *= 1 // Store 1 days worth of CO2 + @CO2 *= #$Crew$ + // CO2 is a gas, divide tank volume by 1000 + CO2Volume = #$CO2$ + @CO2Volume /= 1000 + @Volume += #$CO2Volume$ + } + + @ROKConfigTool:HAS[#OxygenProduction[?rue]] + { + // Oxygen production exists, limit storage to 1 day + @Oxygen *= 1 + @Oxygen *= #$Crew$ + } + + @ROKConfigTool:HAS[~OxygenProduction[?rue]] + { + @Oxygen *= #$Crew$ + @Oxygen *= #$Days$ + } + + @ROKConfigTool:HAS[#WaterProduction[?rue]] + { + // Water production exists, limit storage to 1 day + @Water *= 1 + @Water *= #$Crew$ + } + + @ROKConfigTool:HAS[~WaterProduction[?rue]] + { + @Water *= #$Crew$ + @Water *= #$Days$ + } + + @ROKConfigTool + { + @Food *= #$Crew$ + @Food *= #$Days$ + @Volume += #$Food$ + + WasteWater = 3.87072 + @WasteWater *= 1 //Store 1 days worth of waste water + @WasteWater *= #$Crew$ + @Volume += #$WasteWater$ + + // Oxygen is a gas, divide needed tank volume by 1000 + OxygenVolume = #$Oxygen$ + @OxygenVolume /= 1000 + @Volume += #$OxygenVolume$ + + @Volume += #$Water$ + @Volume += #$Waste$ + } +} + +@PART:HAS[@ROKConfigTool:HAS[~Food[0],~ReuseVolume[?rue]]]:FINAL +{ + %MODULE[ModuleFuelTanks] + { + &volume = 0 + @volume += #$/ROKConfigTool/Volume$ + } +} + +@PART:HAS[@ROKConfigTool:HAS[~Food[0]]]:FINAL +{ + @MODULE[ModuleFuelTanks] + { + TANK + { + name = Food + amount = #$/ROKConfigTool/Food$ + maxAmount = #$/ROKConfigTool/Food$ + } + + TANK + { + name = Oxygen + amount = #$/ROKConfigTool/Oxygen$ + maxAmount = #$/ROKConfigTool/Oxygen$ + } + + TANK + { + name = Water + amount = #$/ROKConfigTool/Water$ + maxAmount = #$/ROKConfigTool/Water$ + } + + TANK + { + name = Waste + amount = 0 + maxAmount = #$/ROKConfigTool/Waste$ + } + + TANK + { + name = WasteWater + amount = 0 + maxAmount = #$/ROKConfigTool/WasteWater$ + } + } +} + +@PART:HAS[@ROKConfigTool:HAS[#LiOH]]:FINAL +{ + @MODULE[ModuleFuelTanks] + { + TANK + { + name = LithiumHydroxide + amount = #$/ROKConfigTool/LiOH$ + maxAmount = #$/ROKConfigTool/LiOH$ + } + } +} + +@PART:HAS[@ROKConfigTool:HAS[#KO2]]:FINAL +{ + @MODULE[ModuleFuelTanks] + { + TANK + { + name = PotassiumSuperoxide + amount = #$/ROKConfigTool/KO2$ + maxAmount = #$/ROKConfigTool/KO2$ + } + } +} + +@PART:HAS[@ROKConfigTool:HAS[#CO2]]:FINAL +{ + @MODULE[ModuleFuelTanks] + { + TANK + { + name = CarbonDioxide + amount = 0 + maxAmount = #$/ROKConfigTool/CO2$ + } + } +} + +@PART:HAS[@ROKConfigTool:HAS[#AppendDescription[?rue]]]:FINAL +{ + @description = #$description$ Supports a crew of $/ROKConfigTool/Crew$ for $/ROKConfigTool/Days$ days. +} + +// Cleanup +@PART:HAS[@ROKConfigTool]:FINAL +{ + !ROKConfigTool {} +} \ No newline at end of file