Jump to content

[1.12.x] SimpleFuelSwitch v1.4.2: Toggle tanks' fuel type in the editor. Simple and lightweight.


Snark

Recommended Posts

  • 4 months later...

Like I guess... if I change the texture of a drill then I would change the part ModuleHarvester of the drill so that it would mine a different resource.

Kinda asked as b9 is going to do something similar I think and kerbalism will require it... 

Peace.

Link to comment
Share on other sites

10 hours ago, theJesuit said:

Like I guess... if I change the texture of a drill then I would change the part ModuleHarvester of the drill so that it would mine a different resource.

Ah, okay.  Well, if what you're interested in is the ability to make resource harvesters switchable, then my guess is that it probably wouldn't be too hard for someone to write a mod that would do that... but if so, it would have basically nothing in common with SimpleFuelSwitch other than the word "switch".  ;)  Resource containers and resource harvesters are handled by different chunks of code and don't really have much in common other than that they both happen to work with resources.

So, not something I'd be likely to add to SimpleFuelSwitch-- if I ever needed something like that, I'd probably sooner make a new mod than try to shoehorn it in here.  But since I don't generally go in for multi-resource-switching scenarios in my own gameplay, that's not something that's likely to come up for me, so I'll pass that torch on to whomever's interested in taking it up.

Link to comment
Share on other sites

2 hours ago, Snark said:

Ah, okay.  Well, if what you're interested in is the ability to make resource harvesters switchable, then my guess is that it probably wouldn't be too hard for someone to write a mod that would do that... but if so, it would have basically nothing in common with SimpleFuelSwitch other than the word "switch".  ;)  Resource containers and resource harvesters are handled by different chunks of code and don't really have much in common other than that they both happen to work with resources.

If he's looking for that - MKS has that functionality.  (In with everything else.)

Link to comment
Share on other sites

  • 1 month later...

Thanks, guys.  I've been laggardly about marking all my mods as "works in 1.9.x" because I was right in the middle of a Kopernicus play-through in 1.8.1 when 1.9 hit, so I haven't actually played 1.9.x yet and therefore haven't had the chance to verify that the mods are working.  (I'm pretty confident that they all will work, because they're fairly simple and 1.9 didn't change much of KSP's internals... but  as a matter of due diligence, I don't wanna go and mark that they do work until it's actually been confirmed, by me or someone else.)

I've now marked this one as 1.9-compatible, thanks! :)

Link to comment
Share on other sites

  • 3 months later...
On 1/10/2019 at 5:42 AM, Snark said:

Instead of showing the "wet" mass, it shows the "dry" mass. (Not by design... I just couldn't figure out how to make it not do this.)

It only calculates root RESOURCE{}
Better tamper with it and dont create new RESOURCE{} in subnodes

P.S. and i agree about people need some simple FS, not so bloated like IFS

Edited by angelix
Link to comment
Share on other sites

  • 5 months later...
43 minutes ago, Csuwy said:

Hi

I like the mod, but why did you deleted the other parts? They have different textures so there are less textures than you can use. Anyway how can i re-enable those parts? Apart from this i truly love this mod. :D

Which parts?  This mod only changes stock parts doesn't it?

Link to comment
Share on other sites

7 hours ago, theJesuit said:

Which parts?  This mod only changes stock parts doesn't it?

Yes, it only changes stock parts. There is this line in the Other part changes part of the mod description: "A few fuel tanks have been removed, now that this mod has made them redundant." Now the differences are: the textures are different, and maybe the dry mass but I'm not sure in that.

Parts that have been deleted: Mk1 Liquid Fuel Fuselage, and all the Rocket fuel fuselages from the MK2 and MK3 part families.

Link to comment
Share on other sites

28 minutes ago, Csuwy said:

Yes, it only changes stock parts. There is this line in the Other part changes part of the mod description: "A few fuel tanks have been removed, now that this mod has made them redundant." Now the differences are: the textures are different, and maybe the dry mass but I'm not sure in that.

Parts that have been deleted: Mk1 Liquid Fuel Fuselage, and all the Rocket fuel fuselages from the MK2 and MK3 part families.

Oh I see.   That makes sense then.  Or not as you suggest.

Peace.

Link to comment
Share on other sites

 

14 hours ago, Csuwy said:

Hi

Hello, and welcome to the forums!  :)

14 hours ago, Csuwy said:

I like the mod, but why did you deleted the other parts?

Because they're redundant, if this mod is installed.  I dislike clutter, so fewer parts = better.  As I mentioned in the OP,

On 1/9/2019 at 10:42 PM, Snark said:

A few fuel tanks have been removed, now that this mod has made them redundant.

Rationale:  With this mod, pretty much every stock LFO tank can now be LF if you want, and vice versa.  This means that there are some stock KSP tanks that are now completely superfluous-- i.e. there are a few cases where there are two stock tanks that are completely identical except for having one be LFO and the other be LF. With this mod in place, there's no longer any point to having such duplicates, so in the interest of removing part-tab clutter, these redundant parts have been removed.

 

14 hours ago, Csuwy said:

They have different textures so there are less textures than you can use.

Again... see the OP;)   I made a specific point of preserving the textures; here's how you can still get them:

On 1/9/2019 at 10:42 PM, Snark said:

For the "removed" Mk2 and Mk3 parts, their textures have been made available on the remaining parts as variants.

 

 

14 hours ago, Csuwy said:

Anyway how can i re-enable those parts?

IKR?  If only someone could have foreseen that someone such as yourself might want the parts back.  If only someone could have taken the trouble to answer exactly this question in (wait for it...)  ...the OP. ;)

On 1/9/2019 at 10:42 PM, Snark said:

(If you don't like that, you can just delete the Hide_redundant_parts.cfg file to restore them.)

Anyway, yeah:  most of the textures are still available as variants, or you can just undo the whole "remove redundant parts" thing by deleting that one file as I mention.  So hopefully you should be good to go?

  

14 hours ago, Csuwy said:

Apart from this i truly love this mod. :D

Thank you!  I'm glad you've enjoyed it.  :)

Link to comment
Share on other sites

2 hours ago, Snark said:

Again... see the OP;)   I made a specific point of preserving the textures; here's how you can still get them:

 

2 hours ago, Snark said:

IKR?  If only someone could have foreseen that someone such as yourself might want the parts back.  If only someone could have taken the trouble to answer exactly this question in (wait for it...)  ...the OP.

My greatest apology it turned out i did not read the OP as carefully as i should have. :blush:

Link to comment
Share on other sites

25 minutes ago, Csuwy said:

My greatest apology it turned out i did not read the OP as carefully as i should have. :blush:

No worries... anyone can miss a spot.

Since I've literally made the exact same mistake myself (missing a relevant bit from someone's OP) within the last couple of days, I'm hardly in any position to cast stones...

Anyway, glad you've got what you need. :)

Link to comment
Share on other sites

Just so everyone is happy...

I'm not sure that Simpelx Reources still supports this fully if i accidently didn't update to take account of changes I'll do so later. 

I'm also going to add further support for Kerbalism Simplex as well.  Kerbalism has its own configure option for resource switching tanks but this provides the more stockish support if B9 isnt installed.  This update will happen around Christmas/weekend.

Peace.

Link to comment
Share on other sites

  • 2 months later...

Hi there

I’m pretty new at this so sorry if it’s a daft question

i am using a mod called cryogenic engines and I want to edit the cfgs of the fuel tanks so they can contain LFO instead of the resources that they hold (LqdHydrogen)

I have read the tutorial on how to edit the cfgs but since this is my first try doing this I don’t really understand how to do it still..

is there a tutorial with pictures or something to make it easier for a noob like me?
thanks :)

Link to comment
Share on other sites

On 2/23/2021 at 2:35 PM, MatkesHulk said:

Hi there

I’m pretty new at this so sorry if it’s a daft question

Nope, it's totally a great question-- this sort of situation is exactly what this mod is designed for.  :)

On 2/23/2021 at 2:35 PM, MatkesHulk said:

i am using a mod called cryogenic engines and I want to edit the cfgs of the fuel tanks so they can contain LFO instead of the resources that they hold (LqdHydrogen)

Sure!  Sounds good.  Just to make sure I'm correctly understanding what you're trying to do, which one of the following two statements applies here?

  1. "I want to make it so that I can choose either LqdHydrogen or LFO, when I'm building in the VAB."
  2. "I don't need the ability to switch, I just want to make them all be LFO instead of LiquidHydrogen."

I think that what you're asking is #1, in which case you've come to the right place and this mod can help you with that.  :)   Just wanted to verify that it's not #2, because if it were, you don't actually need this mod for that and could do it just with ModuleManager. 

On 2/23/2021 at 2:35 PM, MatkesHulk said:

I have read the tutorial on how to edit the cfgs but since this is my first try doing this I don’t really understand how to do it still..

Yah, it's understandable that it can all be kinda opaque, particularly if you're not already familiar with ModuleManager syntax.  Additional discussion in spoiler, for the curious.

Spoiler

There's another mod, called ModuleManager, that enables other mods (like mine) to dynamically patch the config of other parts to change their behavior.  (SimpleFuelSwitch includes ModuleManager when you install it.)

ModuleManager has its own syntax, which is very powerful, but can be confusing if you're not used to it because it has some complex features in it.  Basically, it's its own "programming language".

So the question "how do I do this" depends a lot on how familiar you are with ModuleManager syntax.  If you're an old hand at ModuleManager, then coming up with config for SimpleFuelSwitch to do what you're looking to do is pretty "easy".  On the other hand, if you're not familiar with ModuleManager, then actually most of the difficulty for you will be in the ModuleManager syntax itself, not my mod.  ;)

So if you're new to ModuleManager, it's not your fault that this is confusing-- it just means that there's this "programming language" you're unfamiliar with, and my documentation assumes that the reader's familiar with it.

 

On 2/23/2021 at 2:35 PM, MatkesHulk said:

is there a tutorial with pictures or something to make it easier for a noob like me?

No, not really-- all I've got is what I've documented in the OP here, plus some explanatory comments embedded in the config files that come with SimpleFuelSwitch.

However, if you could give me a link to the mod you're working with-- so that I could have a peek at the config files for their LqdHydrogen fuel tanks-- then I expect I could give you some suggestions (and sample config) to get you going.  Could you point me in the right direction?

(There's also a lot of documentation out there on ModuleManager syntax and how it works, which you might find interesting... but I'm assuming that what you're really trying to do here is "just make these darn fuel tanks work" rather than "learn a whole programming language from scratch.")  ;)

Link to comment
Share on other sites

  • 3 months later...
2 hours ago, theJesuit said:

Thats actually a really good point!

I change the file 'Add_LF_to_LFO_tanks.cfg' to "fix" this issue:

// For all parts that have LFO on them, add the option to switch to LF-only.
@PART[*]:HAS[@RESOURCE[LiquidFuel],@RESOURCE[Oxidizer],!MODULE[ModuleEngines],!MODULE[ModuleEnginesFX],!MODULE[ModuleSimpleFuelSwitch]]:FOR[SimpleFuelSwitch]
{
	MODULE
	{
		name = ModuleSimpleFuelSwitch
	}

	MODULE
	{
		name = ModuleSwitchableResources
		resourcesId = liquid_fuel_oxidizer
		displayName = #SimpleFuelSwitch_LiquidFuelAndOxidizer
		selectorFieldName = #SimpleFuelSwitch_fuelTypeLabel
		isDefault = true
		RESOURCE
		{
			name = LiquidFuel
			amount = #$/RESOURCE[LiquidFuel]/amount$
			maxAmount = #$/RESOURCE[LiquidFuel]/maxAmount$
		}
		RESOURCE
		{
			name = Oxidizer
			amount = #$/RESOURCE[Oxidizer]/amount$
			maxAmount = #$/RESOURCE[Oxidizer]/maxAmount$
		}
	}

	MODULE
	{
		name = ModuleSwitchableResources
		resourcesId = liquid_fuel_only
		displayName = #SimpleFuelSwitch_LiquidFuel
		selectorFieldName = #SimpleFuelSwitch_fuelTypeLabel
		RESOURCE
		{
			name = LiquidFuel
			amount = #$/RESOURCE[LiquidFuel]/amount$
			@amount += #$/RESOURCE[Oxidizer]/amount$
			maxAmount = #$/RESOURCE[LiquidFuel]/maxAmount$
			@maxAmount += #$/RESOURCE[Oxidizer]/maxAmount$
		}
	}

	-RESOURCE[LiquidFuel] {}
	-RESOURCE[Oxidizer] {}
}

 

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