Jump to content

[1.8.1 - 1.12.5] Interstellar Fuel Switch (IFS) 3.29.5


FreeThinker

Recommended Posts

You have to figure out which mod uses a Modulle Manager config which overrides your fuel tanks. IFS is merely tool to create switchable tanks. I'm not responsible how modders use IFS to change the contents of fuel tanks. Personally I don't like Module Script that alter the contents of all fuel tanks, but some modder think otherwise.

Link to comment
Share on other sites

While working on a Community Tech Tree comparability script for TAC-LS, I came across an interesting situation that isn't address by either Interstellar Fuel Switch or Firespitter. I was originally going to place all of the life support parts into suitability node except for the waste containers, which were going to be put in the recycling node to sync it with Universal Storage. However, my declutter script bases everything off the first life support parts that are unlocked, thus allowing the player to switch to the waste container configuration without having to unlock the recycling node. Is it possible to limit certain options to specific tech nodes?

Such as...

MODULE
{
name = InterstellarTextureSwitch2
objectNames = MyContainer
nextButtonText = Next Container
prevButtonText = Previous Container
textureRootFolder = ThunderAerospace/TacLifeSupportContainers/
textureNames = Texture;FoodTexture;WaterTexture;OxygenTexture;WasteTexture
textureDisplayNames = Life Support;Food;Water;Oxygen;Waste
useFuelSwitchModule = true
fuelTankSetups = 0;1;2;3;4
showInfo = false
techRequired = survivability;survivability;survivability;survivability;recycling
}
MODULE
{
name = InterstellarFuelSwitch
resourceNames = Food,Water,Oxygen;Food;Water;Oxygen;Waste,WasteWater,CarbonDioxide
resourceAmounts = 113.2,74.8,11466.9;240;240;53072.3;19.5,180.9,18800.1
initialResourceAmounts = 113.2,74.8,11466.9;240;240;53072.3;0,0,0
tankCost = 27.8;57.4;0.2;3;0
displayCurrentTankCost = true
hasGUI = false
showInfo = true
techRequired = survivability;survivability;survivability;survivability;recycling
}

...or something similar

I can see this being useful for configuring tanks for fuels that aren't available early at the begining of the tech tree, but are unlocked later.

Yes, This is a planned feature. I need it as well for KSPI-E. Now that I know other want it as will I make it more urgent

Link to comment
Share on other sites

Hmm well if anyone knows how to help me please do as while i can do it i make lots of mistakes. I have absolutely no clue what I need to change to fix my issue. I never had this issue before and now its just making it nearly impossible for me to make a heavy SSTO of a design I like. I have both the latest firespitter dll as is used by OPT and this mod.

Edit I tried making a new config file and removing this mod for a bit. Did nothing other then show me the issue. This mod is overwriting the firespitter fuel switcher. Now anyone know how to fix this?

Edited by reaperrising
Link to comment
Share on other sites

Hi.

I'm interested in making a configurable engine. I understand that I'd need to use InterstellarMeshSwitch and InterstelarTextureSwitch?

I kinda know how to make models using the 0.23 Part Tools in Blender. Is there something I have to do differently in Blender before I start exploring the .cfg file side of things?

Link to comment
Share on other sites

I have an idea after mucking a bit with mm.cfg's, looking at the FS and IFS codes for OPT and CryoEngines, respectively (I was modding OPT's fuelled wings to allow LF/OX as well). This may be hard/impossible with the way KSP is, but maybe this could be feasible in 1.1 with the supposed UI changes. After looking at the IFS cfg Nertea did for his CryoFuels and seeing those in effect in-game, I'm a fan of IFS.

Anyway, here's the thought:

Would it be possible to has a part config that simply lets you define max amount in a tank (probably based on the standard LF/OX numbers; it's a point I get to later on), the number of fuel types in the tank, and let you (dynamically) assign the ratio of fuel mix in-game? The actual max amount would be a tweakable in-game so you can set a lower max (like current in-game).

As an example:

I want to built a spaceplane. I need both LF and OX, but a bit more LF than the stock ratio (9 LF:11 OX) to feed the jets I'll use for initial ascent. This means I need at least 2 tanks: 1 standard LF/OX and another LF-only. Now say I only need this to hit LKO (maybe it's just a Space Station Shuttle), so it doesn't need much fuel overall. For argument's sake, say I make this really compact and light and use just the small MK2 tanks: 180/220 LF/OX + 400 LF. I'm now carrying too much LF and not enough OX (maybe...) But this is the bear minimum I can try (well, stock anyway. How realistic this is, someone can try I guess). I can lower the LF in the LF-only tank, but I still can't change the OX amount with this set up.

With the idea I'm thinking of, instead of getting fixed amounts of each fuel per tank, you could set the ratios instead and have the plug-in crunch the numbers for you. So instead of 2 tanks, I use just a single large MK2 tank, which holds 800 units total. You can set a default ratio in the module definition(s), but it's tweakable in-game. In this case, it would default to a 2-fuel tank with a 9:11 ratio, LF:OX. In-game, I could tweak the max total fuel to less that full (like we can now). For the fuels themselves, I tweak the ratios. So instead of 9:11, maybe I set it to like 3:2, resulting in 480:320 LF/OX mix. Now I have a better spaceplane fuel amounts. (A single fuel-type tank would be made by setting one of the ratio numbers to zero). Another tweakable would be what fuels types (and how many: LF/OX/MP tank for example) are allowed in the tank (probably handled like how IFS/FS currently switch fuels). This allows fully adjustable multi-fuel tanks. Modifiers to part stats (cost, mass) would be handled like they are now. (Maybe can scale costs/mass based on ratio as well? Different fuels require differently handling/storage requirements. That would affect costs/mass based on how much you're storing, no?)

HOWEVER! Some fuels (basically anything non-stock) don't share this simple ratio between fuel units. An example would be Nertea's mods: Hydrogen and Argon used FAR bigger numbers and ratios (now that I think about it, I think Xenon is in the same boat there...) For this, you could add a multiplier to fuel amounts in addition to the ratio system. This should solve that issue for those types of fuels. Example: A Hydrogen/OX MK2 large tank would give a 100x multiplier to Hydrogen after doing the ratio calculations for 800 units based on a LF/OX style ratio. Nertea essentially does this for CryoEngines' IFS Fuel mm config.

I do realize this my be needlessly complicated. A know a lot of people that work better with raw numbers. Ratios don't readily click with them. (I've helped as a math tutor.) I imagine there might be similar players in the KSP userbase. Maybe this could an option/tweakable toggle: Use Ratio Mode.

...Well, this seems like a useful idea in my head.

Would IFS be able to implement something like this? If not now, then maybe for consideration after the 1.1 overhaul? Would it even be worth it to implement something like this? (Did any of this even make sense?)

Anyway, just a thought/suggestion. Feel free to shoot it down.

Link to comment
Share on other sites

Hey FreeThinker, I think I've found a bug -- it looks like something in KSP is adding the original mass to the mass that IFS calculates. Easy way to check: install IFS on a stock game, put a stack gas tank in the editor, empty the contents (monoprop and argon), and observe that the Engineer's Report reads 0.5 tons more than the dry mass reported in the right-click menu. The seems to get even more confused as I add parts with alt-left-click.

This may be a stock bug with the editor, since Kerbal Engineer and the Tracking Station report the correct mass, but the wrong mass is also shown in the list of ships that pops up when I click on the launchpad at KSC, and I suspect that in a career save, this may have ramifications for allowing or preventing me from launching a vessel with fuel-switching parts.

Link to comment
Share on other sites

Hello FreeThinker, I have an issue but think it is not with your mod. I have your mod installed, but the stock tanks do not allow fuel switching. From previous posts this could be a bad actor that is preventing the stock tanks from being modded.

I have looked in the MM config cache and looked at the stock tanks and it is indeed true your line of code is missing. But MRS tanks can be swapped. So I was wondering if you would happen to know who is being naughty?

Right now I have these installed:
Chatterer
Community Resource Pack
Contracts Window
DMagic
KAS
KIS
MechJeb2
Modular Rocket System
Near Future Construction, Electrical, Props, Propulsion, Solar
Hex Truss
Stage Recovery
Station Parts Expansion
Alt Resource Panel
Tweak Scale
Umbra Space mods (Karbonite, OKS/MKS, LS, Karb+. Sounding Rockets)<Highly doubt RD would mess with your mod>
Universal Storage

Any help would be appreciated, thanks. Note list is not exhaustive, dependencies are not listed like Firespitter and the such.

EDIT: This is supposed to work with stock right...I did not miss something because I have pulled out all the mods but MM and this and I still can not swap stock. Even wiped the MM files and nada...hurm.

Edited by SyberSmoke
Link to comment
Share on other sites

AFAIK, unless you create a custom cfg yourself, the IFS module isn't applied to stock tanks. There is nothing in the download that applies itself to anything, it's just the plugin that allows you to. MRS tanks can be swapped probably because they have a special config that allows switching if IFS is installed. No-one's being naughty, you just haven't told anyone what to do :)

Link to comment
Share on other sites

AFAIK, unless you create a custom cfg yourself, the IFS module isn't applied to stock tanks. There is nothing in the download that applies itself to anything, it's just the plugin that allows you to. MRS tanks can be swapped probably because they have a special config that allows switching if IFS is installed. No-one's being naughty, you just haven't told anyone what to do :)

I see...hurm...well...a custom cfg...you say. Well that explains that...sadly I have the skills of a newborn when it comes to any type of scripting stuff so I will use something else I guess.

Link to comment
Share on other sites

sadly I have the skills of a newborn when it comes to any type of scripting stuff so I will use something else I guess.

This will allow you to change any fuel tank into one containing either LF, O, or LFO:

// Adds InterstellarFuelSwitch to stock tanks
// 5.5*total LFO

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



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

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

%tempVar = 0
%dryCost = 0

@dryCost = #$cost$

%LFCost = 0
%OXCost = 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$


@tempVar = 0
MODULE {
name = InterstellarFuelSwitch

resourceNames = LiquidFuel,Oxidizer;LiquidFuel;Oxidizer

resourceAmounts = #$../LF$,$../OX$;$../totalCap$;$../totalCap$

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

hasGUI = true
showInfo = true

availableInFlight = false
availableInEditor = true

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

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

}

Link to comment
Share on other sites

Hey FreeThinker, I think I've found a bug -- it looks like something in KSP is adding the original mass to the mass that IFS calculates. Easy way to check: install IFS on a stock game, put a stack gas tank in the editor, empty the contents (monoprop and argon), and observe that the Engineer's Report reads 0.5 tons more than the dry mass reported in the right-click menu. The seems to get even more confused as I add parts with alt-left-click.

This may be a stock bug with the editor, since Kerbal Engineer and the Tracking Station report the correct mass, but the wrong mass is also shown in the list of ships that pops up when I click on the launchpad at KSC, and I suspect that in a career save, this may have ramifications for allowing or preventing me from launching a vessel with fuel-switching parts.

Seem to me Engineer's Report is bugged. There seems to be an update issue where Engineer report is not properly updated.
Link to comment
Share on other sites

Dear FreeThinker,

Your inbox is full. ;)

I'd like to include this with my one of my Mods to make use of the mesh switching module. As I understand it I should just include the folder itself, after obtaining permission, anything else I'd need to do?

Link to comment
Share on other sites

No need to get permission, the license allows you to use it any you want, it is just helpfull for me to maintain compatibility with exsiting mods and warn the mod developors of anything that might break due to changes. It's more of a precautionary measure.

Edited by FreeThinker
Link to comment
Share on other sites

Bug:

I'm using Color Coded Canisters and FuelTanks+ but I think this may be your issue. The "locked" status doesn't seem to be remembered on your tank setups. So I lock the LFO on a tank and Save and Reload the craft and it is unlocked.

Link to comment
Share on other sites

Yes there is. There are 2 variables which control scaling: massExponent and volumeExponent. By default they scale with exponent 3 (volume), you can override these vales either tank drymass with massExponent and/or tank wetmass with volumeExponent.

Link to comment
Share on other sites

locked? I was not aware there is any locked function in IFS. Perhpas you ment something different or another mod is at work here

No, that's the problem. The fuel locking is in stock, but with IFS installed, it's status does not persist. I'll do some more testing and see if I can't confirm it is IFS. It could be the way CCC is configuring it. It's hard for me to tell.

EDIT:

Definitely somehow related to IFS. Here is what it looks like without IFS. If I save the craft and re-load it later, this tank stays locked (that tank is meant to be a refill tank for the lander so I want it not used, using IFS it is supposed to be the only one there with Oxidizer because it is a NERV stage).

zIlnRvP.png

However, if I install IFS again, saving and loading the craft results in the tanks being unlocked. Again, I don't know enough about your mod to know that it isn't CCC mis-configuring it somehow, if you think that is it I can take it over to his thread. No matter what I do as long as IFS is installed, the tanks will be unlocked every time I reload the craft.

NZc2yL5.png
Edited by Alshain
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...