Jump to content

Stock Fuel Switch


Porkjet

Recommended Posts

Adds a tweakable to all fuel tanks that lets you switch between LiquidFuel or Oxidizer

0H9QDd5.gif

[Download link to defunct hosting site removed by moderator]

It works by applying the Firespitter FSfuelSwitch module via ModuleManager to all stock tanks. This is a non-destructive method of modifying stock configs that is completely revertible by simply uninstalling the files provided by this mod.

Config code is written by veryinky, Badsector and Nertea.

This package redistributes the following mods and plugins, their license information can be found in the provided links:

ModuleManager - made by Sarbian & Ialdabaoth - http://forum.kerbalspaceprogram.com/threads/55219-Module-Manager-1-5-6-%28Jan-6%29

Firespitter by Snjo - http://forum.kerbalspaceprogram.com/threads/24551-Firespitter-propeller-plane-and-helicopter-parts-v7-1-%28May-5th%29-for-KSP-1-0

Edited by Snark
Download link to defunct hosting site removed by moderator
Link to comment
Share on other sites

Okay, now you're killin me man. Was on my way to get Atomic Age, partly just for this.

EDIT: FIIIIRRRRSSSSTTTTT!!!!!!!!!!!!!!!!!!

It's like Oprah up in this joint these days...YOU get a fuel switcher, YOU get a fuel switcher, YOU get a fuel switcher!

Thanks for the work Porkjet :)

(EDIT) One quick note, I see this is the original Atomic Age cfg file, after looking into fuel switchers for a while, it's the general consensus that LF and OX are both the same density, so...if you have the jumbo64 tank that holds 6400 units total of LF/OX, if you remove the OX, then you will have 6400 units of LF, and vice-versa. I had been assuming that you just double the original amount like your cfg file does, but it appears this is not the case.

Check out the discussion on page 4 of The Cryogenic Engines Thread

Edited by Eleven
Link to comment
Share on other sites

Wil this apply to all mod tanks as well or rather, how do I have it apply to all mod tanks as well?

After briefly digging through the mm patch, he's not blanket applying this to any tank containing both LF and Ox, just the stock tanks. Being fair, thats probably smart because, for example, some Near Future Spacecraft fuel tanks have LF, Ox, and MP in them & applying this to them would strip the monoprop, which I very much depend on at times.

Link to comment
Share on other sites

Being fair, thats probably smart because, for example, some Near Future Spacecraft fuel tanks have LF, Ox, and MP in them & applying this to them would strip the monoprop, which I very much depend on at times.

You can target the MM patch to ignore the tanks with monoprop easily enough. Thats how Nertea's Cryo Engine & Interstellar Fuel Switch patch works.

@Porkjet : You may want to put an advisory in your post that this will not play well with Nertea's Cryo Engine Pack. It also applies a global patch to all tanks that contain an LFO mix, though dynamically instead of by part so it catches mod parts, but you both are targetting the same conditions. So whichever one gets applied first causes the other to be ignored.

Link to comment
Share on other sites

(EDIT) One quick note, I see this is the original Atomic Age cfg file, after looking into fuel switchers for a while, it's the general consensus that LF and OX are both the same density, so...if you have the jumbo64 tank that holds 6400 units total of LF/OX, if you remove the OX, then you will have 6400 units of LF, and vice-versa. I had been assuming that you just double the original amount like your cfg file does, but it appears this is not the case.

Check out the discussion on page 4 of The Cryogenic Engines Thread

not sure what you mean, It's the 0.9/1.1 LFO mixture used by stock engines.

You say that the download contains Module Manager, but it is not there.. Slight oversight?

Yes, oversight, thx for the reminder I'll add it now

Link to comment
Share on other sites

Nertea has made a very elegant config for his cryo engines that tweaks all the tanks with LF/OX in them to have LF/OX, LF, OX, and LqdHydrogen/OX, LqdHydrogen:


@PART
[*]:HAS[@RESOURCE[LiquidFuel],@RESOURCE[Oxidizer],!MODULE[InterstellarFuelSwitch]] {



%LF = #$RESOURCE[LiquidFuel]/maxAmount$
%OX = #$RESOURCE[Oxidizer]/maxAmount$

%totalCap = #$RESOURCE[LiquidFuel]/maxAmount$
@totalCap += #$RESOURCE[Oxidizer]/maxAmount$

%onlyLH2 = #$totalCap$
@onlyLH2 *= 5.5
%mixLH2 = #$onlyLH2$
@mixLH2 /= 1.1
%mixOX = #$onlyLH2$
@mixOX -= #$mixLH2$


%tempVar = 0
%dryCost = 0

@dryCost = #$cost$

%LFCost = 0
%OXCost = 0
%LH2Cost = 0
%mixLH2Cost = 0
%mixLFCost = 0

// compute cost of stock tank fuel
@tempVar = #$RESOURCE[LiquidFuel]/maxAmount$
@tempVar *= 0.8
@mixLFCost += #$tempVar$

@tempVar = #$RESOURCE[Oxidizer]/maxAmount$
@tempVar *= 0.18
@mixLFCost += #$tempVar$

@dryCost -= #$mixLFCost$
@cost -= #$mixLFCost$

// Cost LF only
@tempVar = #$totalCap$
@tempVar *= 0.8
@LFCost += #$tempVar$

// Cost OX only
@tempVar = #$totalCap$
@tempVar *= 0.18
@OXCost += #$tempVar$

// Cost LH2 only
@tempVar = #$onlyLH2$
@tempVar *= 0.03675
@LH2Cost += #$tempVar$

// Cost mix
@tempVar = #$mixLH2$
@tempVar *= 0.03675
@mixLH2Cost += #$tempVar$

@tempVar = #$mixOX$
@tempVar *= 0.18
@mixLH2Cost += #$tempVar$


@tempVar = 0
MODULE {
name = InterstellarFuelSwitch


resourceNames = LiquidFuel,Oxidizer;LqdHydrogen,Oxidizer;LiquidFuel;Oxidizer;LqdHydrogen


resourceAmounts = #$../LF$,$../OX$;$../mixLH2$,$../mixOX$;$../totalCap$;$../totalCap$;$../onlyLH2$


tankCost = #$../mixLFCost$;$../mixLH2Cost$;$../LFCost$;$../OXCost$;$../LH2Cost$
displayCurrentTankCost = true


hasGUI = true
showInfo = true

availableInFlight = false
availableInEditor = true


basePartMass = #$../mass$
tankMass = 0;0;0;0;0
}

!RESOURCE[LiquidFuel] {}
!RESOURCE[Oxidizer] {}

}

It uses InterstellarFuelSwitch, which is an extended version of the FS switch.

Link to comment
Share on other sites

Nertea has made a very elegant config for his cryo engines that tweaks all the tanks with LF/OX in them to have LF/OX, LF, OX, and LqdHydrogen/OX, LqdHydrogen:


@PART
[*]:HAS[@RESOURCE[LiquidFuel],@RESOURCE[Oxidizer],!MODULE[InterstellarFuelSwitch]] {



%LF = #$RESOURCE[LiquidFuel]/maxAmount$
%OX = #$RESOURCE[Oxidizer]/maxAmount$

%totalCap = #$RESOURCE[LiquidFuel]/maxAmount$
@totalCap += #$RESOURCE[Oxidizer]/maxAmount$

%onlyLH2 = #$totalCap$
@onlyLH2 *= 5.5
%mixLH2 = #$onlyLH2$
@mixLH2 /= 1.1
%mixOX = #$onlyLH2$
@mixOX -= #$mixLH2$


%tempVar = 0
%dryCost = 0

@dryCost = #$cost$

%LFCost = 0
%OXCost = 0
%LH2Cost = 0
%mixLH2Cost = 0
%mixLFCost = 0

// compute cost of stock tank fuel
@tempVar = #$RESOURCE[LiquidFuel]/maxAmount$
@tempVar *= 0.8
@mixLFCost += #$tempVar$

@tempVar = #$RESOURCE[Oxidizer]/maxAmount$
@tempVar *= 0.18
@mixLFCost += #$tempVar$

@dryCost -= #$mixLFCost$
@cost -= #$mixLFCost$

// Cost LF only
@tempVar = #$totalCap$
@tempVar *= 0.8
@LFCost += #$tempVar$

// Cost OX only
@tempVar = #$totalCap$
@tempVar *= 0.18
@OXCost += #$tempVar$

// Cost LH2 only
@tempVar = #$onlyLH2$
@tempVar *= 0.03675
@LH2Cost += #$tempVar$

// Cost mix
@tempVar = #$mixLH2$
@tempVar *= 0.03675
@mixLH2Cost += #$tempVar$

@tempVar = #$mixOX$
@tempVar *= 0.18
@mixLH2Cost += #$tempVar$


@tempVar = 0
MODULE {
name = InterstellarFuelSwitch


resourceNames = LiquidFuel,Oxidizer;LqdHydrogen,Oxidizer;LiquidFuel;Oxidizer;LqdHydrogen


resourceAmounts = #$../LF$,$../OX$;$../mixLH2$,$../mixOX$;$../totalCap$;$../totalCap$;$../onlyLH2$


tankCost = #$../mixLFCost$;$../mixLH2Cost$;$../LFCost$;$../OXCost$;$../LH2Cost$
displayCurrentTankCost = true


hasGUI = true
showInfo = true

availableInFlight = false
availableInEditor = true


basePartMass = #$../mass$
tankMass = 0;0;0;0;0
}

!RESOURCE[LiquidFuel] {}
!RESOURCE[Oxidizer] {}

}

It uses InterstellarFuelSwitch, which is an extended version of the FS switch.

wow that lets my approach look like a caveman indeed. Damn Nertea and his science :D

Link to comment
Share on other sites

Which should I be using, this or InterstellarFuelSwitch? Can I use both?

Using both is a bad idea. Whichever patch gets applied first will be the one that shows up (which might leave Nertea's engines without a fuel source). Both patches target the LF & O resources on the ship and then remove them after the patch is applied, so when the next patch runs there is no LF & O Resources for it to find. So it really depends on if you want the LH2 fuel options (and Nertea's engines) or not.

Link to comment
Share on other sites

not sure what you mean, It's the 0.9/1.1 LFO mixture used by stock engines.

Fuel mixture ratio is not the same thing as density. A jumbo tank holds 6400 units of fuel. LF and OX are the same density so....if you take out all the oxidizer, then 6400 units of LF will fit in that tank. The same goes for OX, if you remove all the LF, then 6400 units of OX will fit in the tank...

:)

Link to comment
Share on other sites

Nertea has made a very elegant config for his cryo engines that tweaks all the tanks with LF/OX in them to have LF/OX, LF, OX, and LqdHydrogen/OX, LqdHydrogen:

Finally something like this do the same work with firespitter and FSfuelSwitch for all the LFO tanks


@PART
[*]:HAS[@RESOURCE[LiquidFuel],@RESOURCE[Oxidizer],!MODULE[FSfuelSwitch]] {

%LF = #$RESOURCE[LiquidFuel]/maxAmount$
%OX = #$RESOURCE[Oxidizer]/maxAmount$

%totalCap = #$RESOURCE[LiquidFuel]/maxAmount$
@totalCap += #$RESOURCE[Oxidizer]/maxAmount$

MODULE {
name = FSfuelSwitch
resourceNames = LiquidFuel,Oxidizer;LiquidFuel;Oxidizer
resourceAmounts = #$../LF$,$../OX$;$../totalCap$;$../totalCap$
displayCurrentTankCost = False
hasGUI = true
showInfo = true
availableInFlight = false
availableInEditor = true
basePartMass = #$../mass$
}
!RESOURCE[LiquidFuel] {}
!RESOURCE[Oxidizer] {}
}

Link to comment
Share on other sites

hmm, it is not showing up in the VAB for me?

I put the file called firespitter.dll in the Plugins folder

and the modulemanager2.6.3.dll and FSfuelSwitchPatch.cfg in the GameData folder

Am I doing something wrong?

Link to comment
Share on other sites

Just to let you know, I installed this mod with a career save already in progress and found that, while the mod worked fine, all my existing ships in space had had their stock LF/O tanks magically refilled. (Admittedly, better than having them magically emptied!) Uninstalling did not fix the problem, reverting to a previous save did (fortunately I make hard saves all the time so it looks like I'll only have to repeat one routine SSTO launch). I can't think of a way around this short of manually editing the save file, which unfortunately seems like more trouble than it's worth seeing how many ships I'd have to edit.

Great mod in any case, I will definitely reinstall it next time I start a new save. May actually end up starting a new save partly so I can use this mod, in fact, perfect solution for the LV-N LF tank problem!

Link to comment
Share on other sites

Just to let you know, I installed this mod with a career save already in progress and found that, while the mod worked fine, all my existing ships in space had had their stock LF/O tanks magically refilled. (Admittedly, better than having them magically emptied!) Uninstalling did not fix the problem, reverting to a previous save did (fortunately I make hard saves all the time so it looks like I'll only have to repeat one routine SSTO launch). I can't think of a way around this short of manually editing the save file, which unfortunately seems like more trouble than it's worth seeing how many ships I'd have to edit.

Great mod in any case, I will definitely reinstall it next time I start a new save. May actually end up starting a new save partly so I can use this mod, in fact, perfect solution for the LV-N LF tank problem!

I actually had this problem as well, but I *think* it also happened with a ship I launched after installing the mod. I was fiddling with modulemanager to get this to play nice with GPOSpeedFuelPumps, so may have triggered it that way.

Link to comment
Share on other sites

I actually had this problem as well, but I *think* it also happened with a ship I launched after installing the mod. I was fiddling with modulemanager to get this to play nice with GPOSpeedFuelPumps, so may have triggered it that way.

It's a thing. I've found this out after switching fuel switchers lately looking for one I liked best. The MM patch goes through and does it thing when you start the game, and as a result *every* time you change fuelswitchers, existing tanks get reset. I'm guessing they get switched to whatever parameters are listed first in the switchers cfg file, which most of the time is the default tank setting.

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...