Jump to content

KSP Interstellar Mod: ISRU


MrHSX

Recommended Posts

I was trying to recreate Scott Manley's ISRU probe in his popular series Interstellar Quest, and ran into a difficulty

 

Kerbal Space Program - Interstellar Quest 37 - Mining Ice

 

 

Apparently Interstellar now converts Water to  LqdHydrogen + LqdOxygen . Is there a way to have it produce LiquidFuel+Oxidizer instead?

I looked into the Parts folder inside Warp Plugin, and couldn't find any obvious config file that I could edit to have Water Electrolysis produce LiquidFuel+Oxidizer

 

Thanks in advance!

 

PS: I'm a total n00b when it comes to modding so please excuse my naïveté 

Link to comment
Share on other sites

Try looking in the cfg file for the ISRU part. There should be a Module in there that handles Water. You should be able to change LqdHydrogen + LqdOxygen to what you need. I don't know the exact cfg module though.

Link to comment
Share on other sites

I looked into that and found the ISRU.cfg at  \Kerbal Space Program\GameData\WarpPlugin\Parts\Utility\ISRU 
It contained these modules that defined some of the processes, but the file doesn't contain stuff like the Haber process or Water Electrolysis that appears in the 'Refinery Window' in the game.
I did try to add another module defining a Water processor, but it didn't work
 

 

	MODULE
	{
		name = ModuleResourceConverter
		ConverterName = Borate Processor
		StartActionName = Start Borate Processing
		StopActionName = Stop Borate Processing
		AutoShutdown = true
		TemperatureModifier
		{
			key = 0 100000
			key = 750 50000
			key = 1000 10000
			key = 1250 500	
			key = 2000 50	
			key = 4000 0
		}				
		GeneratesHeat = true
		DefaultShutoffTemp = .8
		ThermalEfficiency 
		{
			key = 0 0 0 0
			key = 500 0.1 0 0
			key = 1000 1.0 0 0
			key = 1250 0.1 0 0
			key = 3000 0 0 0 
		}

		UseSpecialistBonus = true
		SpecialistEfficiencyFactor = 0.2
		SpecialistBonusBase = 0.05
		Specialty = Engineer
		EfficiencyBonus = 1

		INPUT_RESOURCE
		{
			ResourceName = Borate 
			Ratio = 2.5
		}
		INPUT_RESOURCE
		{
			ResourceName = ElectricCharge
			Ratio = 18
		}
		OUTPUT_RESOURCE
		{
			ResourceName = Boron
			Ratio = 0.15
			DumpExcess = False
		}
		OUTPUT_RESOURCE
		{
			ResourceName = LqdOxygen
			Ratio = 0.75
			DumpExcess = True
		}
	}

 

I look at the source for Interstellar on the GitHub page and found a file named FNRefinery.cs which contains the processor function that I'm looking for... (Line 280)

else if (active_mode == 3) { // Water Electrolysis
                    double density_h = PartResourceLibrary.Instance.GetDefinition(InterstellarResourcesConfiguration.Instance.Hydrogen).density;
                    double density_o = PartResourceLibrary.Instance.GetDefinition(InterstellarResourcesConfiguration.Instance.Oxygen).density;
                    double density_h2o = PartResourceLibrary.Instance.GetDefinition(InterstellarResourcesConfiguration.Instance.Water).density;
                    double electrical_power_provided = consumeFNResource((GameConstants.baseELCPowerConsumption) * TimeWarp.fixedDeltaTime, FNResourceManager.FNRESOURCE_MEGAJOULES);
                    electrical_power_ratio = (float)(electrical_power_provided / TimeWarp.fixedDeltaTime / GameConstants.baseELCPowerConsumption);
                    electrolysis_rate_d = electrical_power_provided / GameConstants.electrolysisEnergyPerTon / TimeWarp.fixedDeltaTime;
                    double water_consumption_rate = part.RequestResource(InterstellarResourcesConfiguration.Instance.Water, electrolysis_rate_d * TimeWarp.fixedDeltaTime / density_h2o) / TimeWarp.fixedDeltaTime * density_h2o;
                    double hydrogen_rate = water_consumption_rate / (1 + GameConstants.electrolysisMassRatio);
                    double oxygen_rate = hydrogen_rate * GameConstants.electrolysisMassRatio;
                    electrolysis_rate_d = part.RequestResource(InterstellarResourcesConfiguration.Instance.Hydrogen, -hydrogen_rate * TimeWarp.fixedDeltaTime / density_h);
                    electrolysis_rate_d += part.RequestResource(InterstellarResourcesConfiguration.Instance.Oxygen, -oxygen_rate * TimeWarp.fixedDeltaTime / density_o);
                    electrolysis_rate_d = electrolysis_rate_d / TimeWarp.fixedDeltaTime * density_h;

 

So could you direct me how to change this file and then implement the change in the game install, cause I can't find anything resembling the above file (FNRefinery.cs) in the game folder

Link to comment
Share on other sites

On 1-11-2017 at 7:01 PM, MrHSX said:

Apparently Interstellar now converts Water to  LqdHydrogen + LqdOxygen . Is there a way to have it produce LiquidFuel+Oxidizer instead?

I looked into the Parts folder inside Warp Plugin, and couldn't find any obvious config file that I could edit to have Water Electrolysis produce LiquidFuel+Oxidizer

1

Have you tried changing the resources in WarpPluginSettings.cfg? If you change "HydrogenResourceName = Hydrogen" into "HydrogenResourceName = LiquidFuel" and "OxygenResourceName = Oxygen"into "OxygenResourceName = Oxidizer"  it should work

Edited by FreeThinker
Link to comment
Share on other sites

On 08/11/2017 at 8:09 PM, FreeThinker said:

Have you tried changing the resources in WarpPluginSettings.cfg? If you change "HydrogenResourceName = Hydrogen" into "HydrogenResourceName = LiquidFuel" and "OxygenResourceName = Oxygen"into "OxygenResourceName = Oxidizer"  it should work

Ah, that worked beautifully!
Many thanks!

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...