Jump to content

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


FreeThinker

Recommended Posts

Just now, Soviet03 said:

Problem solved, I updated my post on Fuel Tanks plus. It was ModuleManager. For some reason I thought the latest version was packaged with either of the 2 mods. My mistake.

Yeah, that's not always the case. Most of us only update the copy with the mod when the mod itself updates, not when MM updates. :)

I'm considering not bundling these anymore at all.

Link to comment
Share on other sites

I'm planning to add the following MM script to IFS

 

@PART[*]:HAS[@RESOURCE[LiquidFuel],@RESOURCE[Oxidizer],!MODULE[InterstellarFuelSwitch],!MODULE[FSfuelSwitch],!MODULE[B9PartSwitch],!MODULE[ModuleEnginesFX],!MODULE[ModuleEngines]]:NEEDS[InterstellarFuelSwitch&!CryoTanks&!ModularFuelTanks&!RealFuels]:FOR[InterstellarFuelSwitch]
{
	%LF = #$RESOURCE[LiquidFuel]/maxAmount$
	%OX = #$RESOURCE[Oxidizer]/maxAmount$

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

	%onlyLH2 = #$totalCap$
	@onlyLH2 *= 5

	%IDEALmixOX = #$onlyLH2$
	@IDEALmixOX /= 3
	%IDEALmixLH2 = #$onlyLH2$
	@IDEALmixLH2 -= #$IDEALmixOX$

	%LANTRmixOX = #$onlyLH2$
	@LANTRmixOX /= 5
	%LANTRmixLH2 = #$onlyLH2$
	@LANTRmixLH2 -= #$LANTRmixOX$
	
	MODULE
	{
		name = InterstellarFuelSwitch
		resourceGui = LiquidFuel+Oxidizer;LiquidFuel;MonoPropellant;XenonGas;IDEAL Hydrolox;LqdHydrogen;LANTR Hydrolox;Stuctural
		resourceNames = LiquidFuel,Oxidizer;LiquidFuel;MonoPropellant;XenonGas;LqdHydrogen,LqdOxygen;LqdHydrogen;LqdHydrogen,LqdOxygen;Stuctural
		resourceAmounts = #$../LF$,$../OX$;$../totalCap$;$../totalCap$;$../totalCap$;$../IDEALmixLH2$,$../IDEALmixOX$;$../onlyLH2$;$../LANTRmixLH2$,$../LANTRmixOX$;
		tankTechReq = start;start;advFuelSystems;ionPropulsion;heavyRocketry;nuclearPropulsion;improvedNuclearPropulsion
		inFlightSwitchingTechReq = specializedFuelStorage
		tankResourceMassDivider = 8;8;6.66666666666;1.272727272727;8;8;8
	}

	!RESOURCE[LiquidFuel] {}
	!RESOURCE[Oxidizer] {}
}
@PART[*]:FINAL
{
	// Remove temporary variables to eliminate log spam
	!LF = 0
	!OX = 0
	!totalCap = 0
	!onlyLH2 = 0
	!IDEALmixOX
	!IDEALmixLH2
	!LANTRmixOX
	!LANTRmixLH2
}

Notice the script contains 2 new fields tankTechReq (which specifies required tech) and tankResourceMassDivider  (which specifies WetMass / DrayMass ratio). They will be added next update

Any suggestions would be welcome

Edited by FreeThinker
Link to comment
Share on other sites

Typo (Structural, I think):

30 minutes ago, FreeThinker said:

resourceGui = LiquidFuel+Oxidizer;LiquidFuel;MonoPropellant;XenonGas;IDEAL Hydrolox;LqdHydrogen;LANTR Hydrolox;Stuctural

And:

30 minutes ago, FreeThinker said:

resourceNames = LiquidFuel,Oxidizer;LiquidFuel;MonoPropellant;XenonGas;LqdHydrogen,LqdOxygen;LqdHydrogen;LqdHydrogen,LqdOxygen;Stuctural

Is it supposed to list LqdHydrogen,LqdOxygen twice? Never mind, I think I understand (IDEAL and LANTR).

 

But then I'm not sure about these, wouldn't they need to have the same nr of parameters (8 selections including structural):

30 minutes ago, FreeThinker said:

tankTechReq = start;start;advFuelSystems;ionPropulsion;heavyRocketry;nuclearPropulsion;improvedNuclearPropulsion

tankResourceMassDivider = 8;8;6.66666666666;1.272727272727;8;8;8

Edited by swjr-swis
ugh forum editor is really stubborn...
Link to comment
Share on other sites

@swjr-swis Although it looks a bit weird, they are synthetically correct as any missing parameter becomes default 0. There is actually a hidden feature involved that ensures that if no mass is specified, it will take the initial mass of the part.

Edited by FreeThinker
Link to comment
Share on other sites

Version 2.0.0 BETA for Kerbal Space Program 1.1.2

Released on 2016-05-06

  • Added new field tankTechReq which specifies required tech
  • Added new field tankResourceMassDivider which specifies WetMass / DryMass ratio
  • Included a Module Manager script which (if installed) adds IFS to all LFO tanks that didn't contain any fuel switch already
  • floating point numbers are represented with 4 digits instead of 6
Edited by FreeThinker
Link to comment
Share on other sites

1 hour ago, FreeThinker said:

Any feedback would be welcome. I'm open to any suggestions

 

I commented on this elsewhere, but I really like what B9 did with the interface, to use the compact "slider" style view for switching. It puts the buttons and name on the same line, along with that visual indication of how far through the list you are. I think this would be a great UI to replicate, if you want.

Link to comment
Share on other sites

48 minutes ago, NecroBones said:

 

I commented on this elsewhere, but I really like what B9 did with the interface, to use the compact "slider" style view for switching. It puts the buttons and name on the same line, along with that visual indication of how far through the list you are. I think this would be a great UI to replicate, if you want.

Alright. something like this?

orzrsXq.jpg

Will upload IFS in a few minutes

Edited by FreeThinker
Link to comment
Share on other sites

@NecroBones

GxBthit.jpg

Alright, I think it this is what you want. I have to agree it look cleaner now

I taken the liberty to use you MM scrip and clean it up for IFS 2.0.1

Spoiler

@PART[TPtankL*|TPtank?mL*|TPdome*|TPcone*|TPtank?m?mA]:HAS[@RESOURCE[LiquidFuel],@RESOURCE[Oxidizer],!MODULE[InterstellarFuelSwitch],!MODULE[FSfuelSwitch],!MODULE[ModuleB9PartSwitch]]:NEEDS[Firespitter|InterstellarFuelSwitch&!B9PartSwitch&!CryoTanks&!ModularFuelTanks&!RealFuels]:FOR[FuelTanksPlus]
{
	%LF = #$RESOURCE[LiquidFuel]/maxAmount$
	%OX = #$RESOURCE[Oxidizer]/maxAmount$

	%LF2 = #$LF$
	@LF2 *= 2
	%OX2 = #$OX$
	@OX2 *= 2
	%Monoprop = #$mass$
	@Monoprop *= 1880

	MODULE
	{
		name:NEEDS[!InterstellarFuelSwitch] = FSfuelSwitch
		name:NEEDS[InterstellarFuelSwitch] = InterstellarFuelSwitch
		tankSwitchNames:NEEDS[InterstellarFuelSwitch] = LF+OX;LiquidFuel;Oxidizer;MonoPropel
		resourceGui:NEEDS[InterstellarFuelSwitch] = LiquidFuel+Oxidizer;LiquidFuel;Oxidizer;MonoPropellant
		resourceNames = LiquidFuel,Oxidizer;LiquidFuel;Oxidizer;MonoPropellant
		resourceAmounts = #$../LF$,$../OX$;$../LF2$;$../OX2$;$../Monoprop$
		basePartMass:NEEDS[!InterstellarFuelSwitch] = #$../mass$
		tankTechReq = start;start;start;advFuelSystems
		tankResourceMassDivider:NEEDS[InterstellarFuelSwitch] = 8;8;8;6.66666666666
	}
	!RESOURCE[LiquidFuel] {}
	!RESOURCE[Oxidizer] {}
}

 

The improved script contains 3 new fields tankSwitchNames , tankTechReq , tankResourceMassDivider.

  • tankSwitchNames specfies the names displayed in the switcher, which has a limited length
  • tankTechReq  which specifies that Monopropellant config is only avialbe when Stock MonoPropellant tanks become available
  • tankResourceMassDivider which specifies the mass Ratio for every tank configuration. Notice I set it at at the same Mass ratio stock MonoPropellant have.
Edited by FreeThinker
Link to comment
Share on other sites

Version 2.0.1 for Kerbal Space Program 1.1.2

Released on 2016-05-07

  • Replaced Resource and Mesh Switch buttons by UIChooseOption , which requires less space and gives some indication how many switch options there are.
  • Added new field tankSwitchNames, which specifies the names displayed in the switcher (notice it length is limited)
  • Included Module Manager
Link to comment
Share on other sites

 

Cool deal. I'm adding in the tech requirements, etc for FTP/CCC.  I can push an update pretty shortly.

I noticed that the texture switching is still using the old buttons, and no longer seems to tie to the fuel config. FTP's radial tanks were using a "fuelTankSetups = 0; 1; 2; 3" line to tie the texture switching to the fuel type, and that seems to have stopped working.

 

Link to comment
Share on other sites

So I had this bug in 1.27, upgrade to 1.30 (which I still have), found out it's apparently still not the most recent version, but I'm going to post it anyway (everytime I come here to post this bug there is a new version out:rolleyes:).

My fueltank with 50 liquidfuel / 61 oxidizer (in my configs) and as set automatically by IFS actually comes out in game as 49.9 LF / 61.1 OX. My guess is that IFS automatically calculated it and then rounded it up to 50/61 for display purposes but spawning the item in game, the rounding no longer applies? I'm sure this makes no sense, so here is a screen shot.

Look at the numbers down the right hand side and the numbers at the top and you'll see the discrepancy. To be sure we're talking about tiny numbers and it really doesn't matter. I just thought I'd mention it, in case it indicates something else is going on.

Cheers.

owDOTDX.png?1

Link to comment
Share on other sites

7 hours ago, NecroBones said:

I noticed that the texture switching is still using the old buttons, and no longer seems to tie to the fuel config. FTP's radial tanks were using a "fuelTankSetups = 0; 1; 2; 3" line to tie the texture switching to the fuel type, and that seems to have stopped working.

Weird, I tested testing with RP-100 Pressure Tank and it still works (when I press the buttons to switch, the resources also switch).

However, when I switch the resources, the texture doesn't switch. Is this what is broken? Do you want them to be index locked (I'm guessing you are), then we can remove the texture GUI entirely and you control everything from one UI switch option. (meaning, the texture partmodule becomes a slave, simply following the fuel switcher)

Either way, I will also replace the buttons by the Switching UI

 

Edited by FreeThinker
Link to comment
Share on other sites

Let me clarify

http://i.imgur.com/y417m0x.jpg

Notice it now has 2 switch UI Switch options that are equivalent. Logically, one of them could be hidden, that way the GUI will become ever clearer.

By the way, those radial tanks got some very OP mass ratios, Twice the normal mass ratio of a regular tank. Really?

Link to comment
Share on other sites

Version 2.0.2 for Kerbal Space Program 1.1.2

Released on 2016-05-07

  • Fixed Tweakscale erros when switching size
  • Replace Button TextureSwitch by UI Switch Option
  • Added field hasSwitchChooseOption (for all part modules) which allows you to hide the UI Switch Option
  • Added field useTextureSwitchModule which allows your TextureSwitch to follow FUelSwitch part module
Link to comment
Share on other sites

 

OK great, I'll try those out. Yeah, the mass ratios may need adjustment on those radial tanks. Originally they were following the mass ratio of the stock radial RCS tanks, which had a different ratio than the stack tanks, but I think KSP 1.1.X addressed that.

Link to comment
Share on other sites

Is there any documentation how the InterstellarTextureSwitch module is supposed to work? I tried to declutter the TAClife support parts but I failed trying to set up the texture switch.

I added the following block to the general life support container

	MODULE
	{
		name = InterstellarTextureSwitch
		textureRootFolder = ThunderAerospace/TacLifeSupportContainers/
		textureNames = Texture;FoodTexture;OxygenTexture;WasteTexture;WaterTesture
		textureDisplayNames = Life Support;Food;Oxygen;Waste;Water
		nextButtonText = Next Color
		prevButtonText = Previous Color
		statusText = Current Color
	}

The buttons appear, but nothing else happens. Removing the root folder part and adding the path directly to the texture names does not work, as well as omitting the path completely. Are pngs even supported?

Link to comment
Share on other sites

@cfdsPerhaps you should take a look at a improved version of Fuel Tank Plus MM script for radial tanks

Spoiler

@PART[TPtankR??]:NEEDS[Firespitter|InterstellarFuelSwitch&!CryoTanks&!ModularFuelTanks&!RealFuels]:AFTER[FuelTanksPlus]
{
	MODULE
	{
		name:NEEDS[!InterstellarFuelSwitch] = FStextureSwitch2
		name:NEEDS[InterstellarFuelSwitch] = InterstellarTextureSwitch2
		textureRootFolder = FuelTanksPlus/Radial/
		textureNames = TPtankR-rimGold-Specular;TPtankR-rimBlack-Specular;TPtankR-rimRed-Specular;TPtankR-rimBlue-Specular
		textureDisplayNames = MonoPropellant;LF+OX;LiquidFuel;Oxidizer
		useFuelSwitchModule = true
		fuelTankSetups = 0; 1; 2; 3
		objectNames = TPtankR-rim
		nextButtonText = Next Variant
		prevButtonText = Previous Variant
		statusText = Current Variant
		hasSwitchChooseOption:NEEDS[InterstellarFuelSwitch] = false
	}
}

@PART[TPtankR01]:NEEDS[Firespitter|InterstellarFuelSwitch&!CryoTanks&!ModularFuelTanks&!RealFuels]:AFTER[FuelTanksPlus]
{
	MODULE
	{
		name:NEEDS[!InterstellarFuelSwitch] = FSfuelSwitch
		name:NEEDS[InterstellarFuelSwitch] = InterstellarFuelSwitch
		tankSwitchNames:NEEDS[InterstellarFuelSwitch] = MonoPropellant;LF+OX;LiquidFuel;Oxidizer
		resourceNames = MonoPropellant;LiquidFuel,Oxidizer;LiquidFuel;Oxidizer
		resourceAmounts = 125;45,55;90;110
		tankMass = 0.125;0.035;0.035;0.035
		basePartMass = 0.0
		displayCurrentTankCost = true
		hasGUI = false
		availableInFlight = false
		availableInEditor = true
		showInfo = false
		useTextureSwitchModule:NEEDS[InterstellarFuelSwitch] = true
	}
}

@PART[TPtankR02]:NEEDS[Firespitter|InterstellarFuelSwitch&!CryoTanks&!ModularFuelTanks&!RealFuels]:AFTER[FuelTanksPlus]
{
	MODULE
	{
		name:NEEDS[!InterstellarFuelSwitch] = FSfuelSwitch
		name:NEEDS[InterstellarFuelSwitch] = InterstellarFuelSwitch
		tankSwitchNames:NEEDS[InterstellarFuelSwitch] = MonoPropellant;LF+OX;LiquidFuel;Oxidizer
		resourceNames = MonoPropellant;LiquidFuel,Oxidizer;LiquidFuel;Oxidizer
		resourceAmounts = 250;90,110;180;220
		tankMass = 0.25;0.0625;0.0625;0.0625
		basePartMass = 0.0
		displayCurrentTankCost = true
		hasGUI = false
		availableInFlight = false
		availableInEditor = true
		showInfo = false
		useTextureSwitchModule:NEEDS[InterstellarFuelSwitch] = true
	}
}

@PART[TPtankR03]:NEEDS[Firespitter|InterstellarFuelSwitch&!CryoTanks&!ModularFuelTanks&!RealFuels]:AFTER[FuelTanksPlus]
{
	MODULE
	{
		name:NEEDS[!InterstellarFuelSwitch] = FSfuelSwitch
		name:NEEDS[InterstellarFuelSwitch] = InterstellarFuelSwitch
		tankSwitchNames:NEEDS[InterstellarFuelSwitch] = MonoPropellant;LF+OX;LiquidFuel;Oxidizer
		resourceNames = MonoPropellant;LiquidFuel,Oxidizer;LiquidFuel;Oxidizer
		resourceAmounts = 600;180,220;360;440
		tankMass = 0.6;0.125;0.125;0.125
		basePartMass = 0.0
		displayCurrentTankCost = true
		hasGUI = false
		availableInFlight = false
		availableInEditor = true
		showInfo = false
		useTextureSwitchModule:NEEDS[InterstellarFuelSwitch] = true
	}
}

 

If you study it, it Should teach you how to use texture switch yourself

Edited by FreeThinker
Link to comment
Share on other sites

Looks like I am missing the "objectNames" entry. I guess that refers to some mesh information that is hidden from prying eyes inside the .mu file?

Edit: Yes, it was "objectNames". Finding the correct mesh name via Kerbal Object Inspector and using it solved the problem.

Edited by cfds
Link to comment
Share on other sites

14 hours ago, cfds said:

Looks like I am missing the "objectNames" entry. I guess that refers to some mesh information that is hidden from prying eyes inside the .mu file?

Edit: Yes, it was "objectNames". Finding the correct mesh name via Kerbal Object Inspector and using it solved the problem.

How did you use Kerbal Object Inspector  in KSP 1.1.2?

Link to comment
Share on other sites

I'm using the tri-tank built by TheMorris. It normally has LF+Ox+Mono in the tanks, but with Interstellar Fuel Switch installed it now only cycles through the default tank states and has no option for the default tri-tank state. Any recommendations for a MM patch or code I can throw in to make this work?

 

Link to comment
Share on other sites

5 hours ago, FreeThinker said:

How did you use Kerbal Object Inspector  in KSP 1.1.2?

I didn't. I put this mod into 1.0.5 and looked up the mesh names there...

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