-
Notifications
You must be signed in to change notification settings - Fork 39
Add config tool for resources #122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
StonesmileGit
wants to merge
6
commits into
master
Choose a base branch
from
ConfigTool
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
24342be
Initial config tool skeleton
StonesmileGit 7a5a428
Forgot MM @
StonesmileGit a23f8c1
Add config tool scrubber tanks
StonesmileGit d2f9f32
Handle gasses and rename a bunch of stuff
StonesmileGit 634fb45
Approximate LiOH and KO2 rates
StonesmileGit 98410c6
Use final
StonesmileGit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 {} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.