allista

[1.4.5] Configurable Containers

Recommended Posts

Has anyone else had an issue running this with Procedural Parts where fuel tanks switched to Monopropellant get the liquid fuel/oxidiser added back to the container on vessel launch? I think it might be an issue with the PP default tank switcher either not being disabled or not interacting with Configurable Containers correctly (it works fine if you change the tanks using the CC menu rather than the Procedural Parts tweakable).

Running a heavily modded install and not yet had a chance to test on a cleaner install, so it could be some other conflict at work.

  • Like 1

Share this post


Link to post
Share on other sites

Configurable Containers v2.4.0.6 for KSP 1.3 (2017.06.05)

ChangeLog:

Spoiler
  • Compatible with KSP-1.3
  • Fixed Metal tank type as pointed out by TheKurgan.
  • Removed Plutonium-238 as it is internal resource for USI

 

 

Edited by allista
  • Like 3

Share this post


Link to post
Share on other sites
16 minutes ago, allista said:

Configurable Containers v2.4.0.6 for KSP 1.3 (2017.06.05)

ChangeLog:

  Reveal hidden contents
  Hide contents
  • Compatible with KSP-1.3
  • Fixed Metal tank type as pointed out by TheKurgan.
  • Removed Plutonium-238 as it is internal resource for USI

 

 

Thanks @allista you are pretty fast! One of musthaves ready to go!

Urses

Share this post


Link to post
Share on other sites

Thanks a lot! I've been looking forward to the 1.3 compatible version of this mod!!

Edited by KingeOrge

Share this post


Link to post
Share on other sites

@allistaI'm in the process of making a B9 compatibility patch if you're interested. The mass patch variable doesn't seem to be working with the procedural wings though.

  • Like 1

Share this post


Link to post
Share on other sites
5 hours ago, ShadyAct said:

@allistaI'm in the process of making a B9 compatibility patch if you're interested. The mass patch variable doesn't seem to be working with the procedural wings though.

Yes, very interested! :)

Though it may take more than a patch to make it work; I'll also look into it.

Share this post


Link to post
Share on other sites
On 6/8/2017 at 3:50 AM, ShadyAct said:

@allistaI'm in the process of making a B9 compatibility patch if you're interested. The mass patch variable doesn't seem to be working with the procedural wings though.

Any progress with those patches? I've forked B9 PW and added the code to support CC; now I need a patch for the wings to test it before making a pull request.

Share this post


Link to post
Share on other sites
On 5/15/2017 at 4:30 PM, Bit Fiddler said:

ok, I know this will be considered a cheat by many, but I have found too many tanks I would like to use that just do not support the tank manager.   so I have made this patch to try to fix this problem.  will this patch indeed just convert all of the more limited "Tank Switcher" modules to the more advanced "Tank Manager" modules and leave their volume the same? 

EDIT: just realized I pasted the patch from my brainstorm document not the final patch file in my game directory.  I have changed the patch listed above to the version I have in my game directory.  but the question still stands...  is this going to cause any problems?  or is it simply switching the tank manager to the more advanced version, and everything should continue to work fine?

@allista  Also can you look at supporting B9 procedural wings?

I thought many times that my initial choice of giving some tanks the TankManager while others just a SwitchableTank based on part's volume is wrong, because there are stock LFO tanks that are rather small, but have to have TankManager to accommodate multiple resources. Until now, though, I was helpless to change that because of the inability of CC to adapt to resources of already launched parts (which causes bugs with other fuel switchers installed alongside CC). But now I'm finally addressing this bug.

So the question stands: should I convert all parts with SwitchableTank (except for wings and high-pressure gas ones) to use TankManager instead?

@Bit Fiddler, answering your questions:

1) you also need to add the TANK node with the Volume=100 and TankType, CurrentResource, InitialAmount copied from the SwitchableTank module.

2) i'm working on that with @ShadyAct, but for it to work the maintainer of B9-PW should accept my changes to B9 code.

Share this post


Link to post
Share on other sites
7 hours ago, allista said:

Any progress with those patches? I've forked B9 PW and added the code to support CC; now I need a patch for the wings to test it before making a pull request.

Yes, do you think that cargo bays should have a small amount of fuel? Also I think that mono-propellant containers in cockpits could be changed to a simple gas container with a mono-propellant default.

Edited by ShadyAct
  • Like 1

Share this post


Link to post
Share on other sites
7 minutes ago, ShadyAct said:

Yes, do you think that cargo bays should have a small amount of fuel? Also I think that mono-propellant containers in cockpits could be changed to a simple gas container with a mono-propellant default.

Oh my! I've never realized you do the patch for the WHOLE B9 :cool:

My own patch policy is simple: only add tanks where resources are defined by original mod.

Also, in CC gas containers are of type Gases, while MP is LiquidChemical (which may be wrong, but that's the way it already is). And I also do not touch stock cockpits in my patches: they're left with the monopropellent as is.

Meanwhile, I'm currently testing the changes I made to B9-PW with a simple patch I added for the wingA (which is the only wing capable of storing resources). So far looks good! :D

A question, though: for stock wings I use simple tanks (no tank type change, only liquid chemicals are allowed); so, naturally, with B9 I want to use the same. The logic is simple: wing should be light and should only carry fuel for the plane. But maybe it's too restrictive? What d'you think? And @Bit Fiddler? For example, we can limit the tank types a wing can use, instead of forbidding type change completely.

*Note: the simple tank configuration actually reduces functionality compared to the B9-PW builtin fuel configurator, which allows for LFO tank inside a wing. Honestly, I dare not imagine a wing with liquid oxygen and hydrazine divided by a thin wall... :0.0:

Share this post


Link to post
Share on other sites
3 minutes ago, allista said:

Oh my! I've never realized you do the patch for the WHOLE B9 :cool:

My own patch policy is simple: only add tanks where resources are defined by original mod.

Also, in CC gas containers are of type Gases, while MP is LiquidChemical (which may be wrong, but that's the way it already is). And I also do not touch stock cockpits in my patches: they're left with the monopropellent as is.

Meanwhile, I'm currently testing the changes I made to B9-PW with a simple patch I added for the wingA (which is the only wing capable of storing resources). So far looks good! :D

A question, though: for stock wings I use simple tanks (no tank type change, only liquid chemicals are allowed); so, naturally, with B9 I want to use the same. The logic is simple: wing should be light and should only carry fuel for the plane. But maybe it's too restrictive? What d'you think? And @Bit Fiddler? For example, we can limit the tank types a wing can use, instead of forbidding type change completely.

I think that's good for preserving the experience that the creator of the mod intended. A lot of non-fuel tank parts hold fuel in B9 though. For the last part, maybe you could forbid things like radioactive materials in wings? That wouldn't be very kerbal though :/

  • Like 1

Share this post


Link to post
Share on other sites
8 minutes ago, ShadyAct said:

I think that's good for preserving the experience that the creator of the mod intended. A lot of non-fuel tank parts hold fuel in B9 though. For the last part, maybe you could forbid things like radioactive materials in wings? That wouldn't be very kerbal though :/

I say, if it has resources, it can have CC tank instead, whatever it is. :cool:

And yes, we can certainly do it, using ExcludeTankTypes/IncludeTankTypes options.

And I do like the "kerbal way" argument! :D

Share this post


Link to post
Share on other sites
20 minutes ago, allista said:

Honestly, I dare not imagine a wing with liquid oxygen and hydrazine divided by a thin wall... :0.0:

You could think of it as RP-1 and liquid oxygen if it puts you at ease xp

  • Like 1

Share this post


Link to post
Share on other sites

So, PR to B9-PW repo is ready, as well as my patch for the wings:

https://github.com/Crzyrndm/B9-PWings-Fork/pull/24

BTW, @ShadyAct, you do realize that my patches for various mods are generated automatically by a python script (which you can obtain in CC repo)? This saves me a LOT of trouble with part volume calculations and such. Feel free to use it as, at least, a starting point.

Edited by allista
  • Like 1

Share this post


Link to post
Share on other sites

i personally never put anything in my wings other than LF, OX, MP.  but that is just me.  I have never found any reason yet to want any other resource in the wings.  the patch I made to add CC to all the various wings I use however has no limit on it.  it just assigns the tank manager and a volume.  it is just that I personally never put anything else in it.

  • Like 1

Share this post


Link to post
Share on other sites

I guess I should also add that I have put CC in "wings" that are not necessarily defined as "wings".  I put the tank manager in things referred to as strakes, fins, or stabilizers sometimes as I use these as "wings" on smaller aircraft.

Edited by Bit Fiddler

Share this post


Link to post
Share on other sites

@ShadyAct, I'm going to make a release tonight. Should I wait for your patch, or will it be going to some later release?

Share this post


Link to post
Share on other sites
1 hour ago, allista said:

@ShadyAct, I'm going to make a release tonight. Should I wait for your patch, or will it be going to some later release?

Later.

  • Like 1

Share this post


Link to post
Share on other sites

oh you may be interested in a MM patch I have been fiddling with for a while now...  still not finished but maybe you can use what is here to make a finished product.

//replace Fuel switchers from: Fire Spitter, InterstellarFS, B9, modular fuel tanks, etc with Configurable Containers

@PART[*]:HAS[@MODULE[FSfuelSwitch],@MODULE[InterstellarFuelSwitch],@MODULE[ModuleFuelTanks],@MODULE[ModuleB9PartSwitch]]:Final
{
	//this is how Fire spitter and Interstellar look
	//MODULE
	//{
		//volumeMultiplier:NEEDS[InterstellarFuelSwitch] = 1
		//resourceNames = LiquidFuel,Oxidizer;LiquidFuel;Oxidizer;MonoPropellant
		//resourceAmounts = X,Y;X;X;X
	//}
	
	%MODULE[ModuleTankManager]
    {
		%name = ModuleTankManager
		%Volume:HAS[@MODULE[ModuleFuelTanks]] = #$../MODULE[ModuleFuelTanks]/Volume$
		
		//is this only foir fuel or does this do more and we need a way to filter this?
		%Volume:HAS[@MODULE[ModuleB9PartSwitch]] = #$../MODULE[ModuleB9PartSwitch]/baseVolume$
		
//		%Volume:HAS[@MODULE[InterstellarFuelSwitch]] = 
//		%Volume:HAS[@MODULE[FSfuelSwitch]] = 
		%DoCostPatch = True
		%DoMassPatch = True
	}
	
//	!MODULE[FSfuelSwitch]{}
//	!MODULE[InterstellarFuelSwitch]{}
	!MODULE[ModuleFuelTanks]{}
	!MODULE[ModuleB9PartSwitch]{}
}

 

 

  • Like 1

Share this post


Link to post
Share on other sites
11 minutes ago, Bit Fiddler said:

oh you may be interested in a MM patch I have been fiddling with for a while now...  still not finished but maybe you can use what is here to make a finished product.


//replace Fuel switchers from: Fire Spitter, InterstellarFS, B9, modular fuel tanks, etc with Configurable Containers

@PART[*]:HAS[@MODULE[FSfuelSwitch],@MODULE[InterstellarFuelSwitch],@MODULE[ModuleFuelTanks],@MODULE[ModuleB9PartSwitch]]:Final
{
	//this is how Fire spitter and Interstellar look
	//MODULE
	//{
		//volumeMultiplier:NEEDS[InterstellarFuelSwitch] = 1
		//resourceNames = LiquidFuel,Oxidizer;LiquidFuel;Oxidizer;MonoPropellant
		//resourceAmounts = X,Y;X;X;X
	//}
	
	%MODULE[ModuleTankManager]
    {
		%name = ModuleTankManager
		%Volume:HAS[@MODULE[ModuleFuelTanks]] = #$../MODULE[ModuleFuelTanks]/Volume$
		
		//is this only foir fuel or does this do more and we need a way to filter this?
		%Volume:HAS[@MODULE[ModuleB9PartSwitch]] = #$../MODULE[ModuleB9PartSwitch]/baseVolume$
		
//		%Volume:HAS[@MODULE[InterstellarFuelSwitch]] = 
//		%Volume:HAS[@MODULE[FSfuelSwitch]] = 
		%DoCostPatch = True
		%DoMassPatch = True
	}
	
//	!MODULE[FSfuelSwitch]{}
//	!MODULE[InterstellarFuelSwitch]{}
	!MODULE[ModuleFuelTanks]{}
	!MODULE[ModuleB9PartSwitch]{}
}

 

Cool! :cool:

But I can't include a patch that affects/disables other mods into official distribution. Only as an option to download from the OP.

Share this post


Link to post
Share on other sites

my big hang up at this time is how to get MM to calculate volume for Firespitter/interstellar with that configuration.  I do not know MM well enough to know how to get it to parse those lines of text and come up with a tank volume.

also I assume the B9 part switch does more than fuel.  I have not looked into this yet, but I am sure some sort of filter would need to be put in to catch only the fuel switcher modules and ignore some mesh switching modules. 

this does however run at FINAL so it will catch any modifications or tanks added by other mods and not just the original mods themselves.  it worked pretty well when I first started it but then I upgraded to 1.3 and have not been able to really work on it as the mods are not all ready for 1.3 so I can't get them all installed to test it anymore.

 

and yes I suppose you do not want to disable the other mods as a default config.  you would always need to let the user decide how to handle that.  but this along with the other MM patches I have mentioned will catch most if not all the tanks in the game and convert them to CC.  I always just use tank manager not tank switcher as one build I may use a tank for an entirely different purpose as the last one.  I pick tanks based on aesthetics not the original mod makers configuration.  I use parts from many part mods  that look good to me and make them behave as I want, not necessarily as the mod maker made them.  I know the purist think this is cheating, but when my rockets explode in huge fiery Kerbal konflagrations I do not even notice because "I am to busy looking good!"

Share this post


Link to post
Share on other sites
2 hours ago, Bit Fiddler said:

1. my big hang up at this time is how to get MM to calculate volume for Firespitter/interstellar with that configuration.  I do not know MM well enough to know how to get it to parse those lines of text and come up with a tank volume.

2. also I assume the B9 part switch does more than fuel.  I have not looked into this yet, but I am sure some sort of filter would need to be put in to catch only the fuel switcher modules and ignore some mesh switching modules. 

3. this does however run at FINAL so it will catch any modifications or tanks added by other mods and not just the original mods themselves.  it worked pretty well when I first started it but then I upgraded to 1.3 and have not been able to really work on it as the mods are not all ready for 1.3 so I can't get them all installed to test it anymore.

4. and yes I suppose you do not want to disable the other mods as a default config.  you would always need to let the user decide how to handle that.  but this along with the other MM patches I have mentioned will catch most if not all the tanks in the game and convert them to CC.  I always just use tank manager not tank switcher as one build I may use a tank for an entirely different purpose as the last one.  I pick tanks based on aesthetics not the original mod makers configuration.  I use parts from many part mods  that look good to me and make them behave as I want, not necessarily as the mod maker made them.  I know the purist think this is cheating, but when my rockets explode in huge fiery Kerbal konflagrations I do not even notice because "I am to busy looking good!"

1. I'm almost sure MM is not that powerful. Parsing an arbitrary string into a set of meaningful numbers is not a trivial matter even for a full-fledged programming language, let alone a home-brewed patching framework like MM (which is still super-cool-and-absolutely-required for us modders! :cool:).

2. True. And it may also be impossible for MM in general case.

3. Many mods, and many fuel/texture/mesh switchers in particular, run in FINAL. Beware the unpredictable ordering.

4.1 A set of MM patches like that could be easily made into a separate package and distributed as an option. There are many pure-MM-patch mods that do something like that.

4.2 In the next release (that's coming, fingers crossed, today) I also convert everything (except gas tanks) to use TankManager; and only wings have received restrictions on tank types they can use.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now