Jump to content

Interstellar Fuel Switch for all tanks


Recommended Posts

Hi!

How do I create a module manager patch that both lets all fuel tanks switch between all resources, and add a resource to all fuel tanks?

I've made this unsuccessful attempt, based on the IFS Integration mod:

//Stock FuelSwitch (runs if IFS but no metastock resource support is present)
@PART[*]:HAS[#resource[LiquidFuel]]]:NEEDS[InterstellarFuelSwitch]
{
	%MODULE[ModuleCrossFeed]
    { 
    }
	%percentage = 0
	%percentsquared = 0
	@percentage = #$/RESOURCE[LiquidFuel]/maxAmount$
	@percentage /= 26880
	
	@percentage != 0.3333333
	
	@percentsquared = #$/percentage$
	@percentsquared != 2
		
	%LF = #$/RESOURCE[LiquidFuel]/maxAmount$	
	%Oxi = #$/RESOURCE[LiquidFuel]/maxAmount$
	
	@LF *= .45
	@Oxi *= .55
	
    MODULE
    {
		name = InterstellarFuelSwitch
		resourceGui = LFO;LiquidFuel;Oxidizer;LqdHydrogen;Structural
		resourceNames = LiquidFuel,Oxidizer;LiquidFuel;Oxidizer;LqdHydrogen;Structural
		resourceAmounts = #$/../LF$,$/../Oxi$;$/../RESOURCE[LiquidFuel]/maxAmount$;$/../RESOURCE[LiquidFuel]/maxAmount$;$/../RESOURCE[LiquidFuel]/maxAmount$;0
		%tankMass =  0;0;0;0;0;0


		%basePartMass = #$../mass$
		volumeMultiplier = 1.0
		massMultiplier = 1
		displayCurrentTankCost = false
		hasGUI = true
		availableInFlight = true
		availableInEditor = true
		showInfo = true
	}
}

 

Link to comment
Share on other sites

31 minutes ago, Nansuchao said:

Look at the ABZB MK2- Interstellar Integration, it does what you're looking for.

That was the 'IFS integration mod' I was referencing. In my game, the 'stock resources' .cfg file only affected tanks while held liquid fuel only (like the small MK-0 fuel tank), giving them the full range of resource options. Regular fuel tanks did not have switching capability.

I then tried modifying the file, but I was unsuccessful in getting the desired effects. 

Link to comment
Share on other sites

Notice, I'm currently working on a new version of IFS that will allow tech based modular resource switch, which means a resource will only become available in the VAB after specific tech is  researched. This allow you to prevent exotic high tech resources like Xenon and Hydrogen and Rocket parts  only after you researched the tech which first unlocks contains for this resource.

Edited by FreeThinker
Link to comment
Share on other sites

1 minute ago, FreeThinker said:

Notice, I'm currently working on a new version of IFS that  will all tech based modular resource switch, which means a resource will only become available in the VAB after specific tech are resource. This allow you to prevent exotic high tech resources like Xenon and Hydrogen and Rocket parts  only after you researched the tech which first unlocks contains for this resource.

Is there anything that can be written using MM in the mean time?

I tried this:

//Stock FuelSwitch (runs if IFS but no metastock resource support is present)
@PART[*]:HAS[#category[FuelTank]]
{
    MODULE
    {
		name = InterstellarFuelSwitch
		resourceGui = LFO;LiquidFuel;Oxidizer;LqdHydrogen;Structural
		resourceNames = LiquidFuel,Oxidizer;LiquidFuel;Oxidizer;LqdHydrogen;Structural
		resourceAmounts = #$/../LF$,$/../Oxi$;$/../RESOURCE[LiquidFuel]/maxAmount$;$/../RESOURCE[LiquidFuel]/maxAmount$;$/../RESOURCE[LiquidFuel]/maxAmount$*10;0
		%tankMass =  0;0;0;0;0;0


		%basePartMass = #$../mass$
		volumeMultiplier = 1.0
		massMultiplier = 1
		displayCurrentTankCost = false
		hasGUI = true
		availableInFlight = true
		availableInEditor = true
		showInfo = true
	}
}

to no avail.

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