Jump to content

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


Snark

Recommended Posts

1 minute ago, 4x4cheesecake said:

Oh, that's because the mod works just with stock parts and I'm pretty sure that's intended ;)

Actually the LFO to LF switch works with most all simple mod tanks I have checked, but the LF to LFO switch only works with the named tanks in the cfg.

I'm looking at your cfg now to transplant a piece of it into the original cfg ;)

Link to comment
Share on other sites

So to expand on my earlier bug post, any tank that has the amount less then the max amount causes the hang. Like in the resource config below from Large Boat parts:

RESOURCE
    {
        name = LiquidFuel
        amount = 1000
        maxAmount = 18000
    }

Link to comment
Share on other sites

Goodness.  I step away from the computer for a day or so, and all kinds of discussion busts loose.  :)

12 hours ago, theJesuit said:

People can add their own texture variants and make it a two click process :)

Is kinda what I thought.

That said, it wouldn't be too hard to add a bit of extra code (plus an optional field for the ModuleSwitchableResources config) so that it would be possible to set up a part to tie a fuel option to a variant, so that switching the variant would switch the fuel option, and vice versa.  Would allow people to make mod parts that actually do have different models per resource type, if they're so inclined.

Haven't done it yet because I don't actually have any use case in hand.  But given how simple it would be to add (I think), it wouldn't take a whole lot of arm-twisting to get me to add it sometime.  (Probably.)  ;)  What it would likely take would be for some modder to come to me and say "hey, I'm making these variant fuel tanks and I'd really like to use your mod for resource switching"-- because then there would be a use case.

12 hours ago, theJesuit said:

I might add that to an update to SIMPLEX Resources with the ore tanks.

Nice!  :)

One thing to be aware of:  one bit of customizability that's already in the mod is that the config can specify the "resource selector label".  For the stock LFO / LF fuel tanks, I've set the label to "Fuel Type".  But for example, if you're using it on a part that's supposed to hold, say, different kinds of ore, you could have the config say "Ore Type" (or whatever) instead.

12 hours ago, RealKerbal3x said:

You’re going to fill up my GameData folder!

Dude.  The zip file's under 70K, and most of that is ModuleManager which you likely already have sitting in there anyway.  Just how small is your hard drive?  :sticktongue:

8 hours ago, 4x4cheesecake said:

I just tried it and found a little bug: If you take out some/all the fuel from a tank, keep the engineer report open and then switch the fuel type, it will refill the tank to the max amount of fuel but the engineer report doesn't update the vessel mass:

<snip>

Adding a part to the vessel, switch the variant theme or close and open the report again will cause the it to update though.

Thanks for the bug report!   :)

From the details you've given, I think I have a pretty good idea of what's likely going on.  (Doesn't necessarily mean that it'll be easy to fix-- won't know that until I can get into the code and start tinkering.  But having an idea of where to start is a huge part of the battle, so thanks for that!)

Technobabble in spoiler section, for the curious.  TL;DR is that I think it's a relatively harmless cosmetic bug that only affects the display of the engineer's report, not the actual state of the ship.

Spoiler

I think what's going on here is that the engineer's report is simply not getting updated, because when my code swaps out the resources, KSP doesn't realize that I've done that so the engineer's report doesn't "know" that it needs to be refreshed.

In particular, this comment of yours:

Quote

Adding a part to the vessel, switch the variant theme or close and open the report again will cause the it to update though.

...makes perfect sense.  "Adding a part" or "switching theme" or "close/reopen" are all common stock operations, so of course the KSP devs put the necessary hooks in those places so that when they happen, they tell the engineer report "hey, you're out of date, please update yourself."  But then along comes Snark with his mischievous mod code, swapping out part resources without telling anyone he's done it... so no notification, and the engineer's report is none the wiser.

So, what's needed for me to be able to fix this is, I need to find some way to notify the engineer's report "you're dirty, please update".  The open question is, how do I do that.  It'll require that there's some "hook" I can call to do that, and I don't actually know that such a hook exists-- nor do I know how/where to find it.  So I'll need to do some research and/or ask around in the modding forums.  The happy case is that there will, in fact, be such a hook, and I can just add a line of code to call it and the bug will be all fixed.  The unhappy case would be if there is no such publicly-accessible hook, in which case the bug would be basically unfixable.

My guess is that there will be some way to fix it-- but I'll need to do some digging to figure out exactly how, unless someone who's reading this can just hand me the answer on a silver platter.  ;)

 

8 hours ago, 4x4cheesecake said:

I can totally understand that you want to hide some redundant parts but since they got a different texture and the parts can still be used through the 'advanced mode', it would be nice to add the fuel switch feature to these parts as well, so if you want to use them for a different look, you can still switch the fuel :)

Yeah, I thought about that.  However, I couldn't think of any cure that seemed unambiguously better than the disease, so to speak, which is why I didn't do this.

First of all, one thing that I'm absolutely not going to do is to add new settings or options UI or whatever to the mod to pick that sort of thing.  It's more code, more potential bugs, more maintenance hassle, for a feature that I myself would never use (nor, I suspect, would most users).  I really meant the "Simple" when I named the mod SimpleFuelSwitch.  ;)

So the other alternative-- which would be simple and easy-- would be to add config to the parts that makes them switchable, and then hide them, so that if someone unhides them simply by deleting the relevant config file, they'd be all set.  However, even though it would be easy, it seems... kinda going out on a limb.  It would be making an assumption about what I think such a hypothetical person would actually want.  Why are they restoring the parts?  What do they want from them?  Do they want them to be switchable, too?  Do they want them in their original pristine state?  There's just no way to know, so I'd prefer not to address it at all.  If they want to add resources to them, then they can easily do so with a simple MM patch, basically just copy what I've done to some of the other LF-only tanks.

...Okay, quite a few more responses have piled up since I started typing this, gonna go ahead and post this before addressing the remainder.

Link to comment
Share on other sites

17 hours ago, RealKerbal3x said:

Does this make changes to modded fuel tanks too, or will we need to specify that ourselves?

Yes and no.

What I want is to update all the stock tanks, without being too hamfisted about doing it to modded fuel tanks.  Rationale is that if someone has added a bunch of extra fuel tanks I don't know about, then I don't know how they use them or what the intended behavior is, so I'd prefer not to be too heavy-handed.

That said, though, there will be a certain amount of "slop-over", given the way I've set things up:

For the stock LF-only tanks to which I've added LFO, then only those specific tanks will be affected with this mod, since I called them out by name in the config.  (That's because there were only a few of them.)

However, for the stock LFO tanks (to which I've added LF)... well, there are scads of those and I didn't want to call out all of them individually, so I set up the ModuleManager so that it says "add LF to any tank that has LiquidFuel and Oxidizer".  So that will affect mods, yes.

14 hours ago, 4x4cheesecake said:

Also, is it intented that wings with fuel capacity are not able to switch the fuel? Would be nice for some spaceplanes

Yeah, I realized shortly after I published the mod that I'd forgotten about those.  So no, that was an oversight.

FWIW, though, I think it's really just one part affected, the Big-S delta wing.  IIRC, the only other stock wing-with-fuel-tanks is for the jumbo airliner wing, and that one has such a low temperature tolerance that it's practically unusable for spaceplanes, so I would think that the demand for having LFO in it would be fairly low.

Anyway, yeah, that's a good idea, and (at least for the BigS delta) I'll plan to fix that in the next release.

9 hours ago, DStaal said:

My one problem with this mod is that I'm running other mods that require three other fuel switchers, and I'm not sure how they'd interact.  ;)   Otherwise, I'd install for the part info panel alone.

Yeah, you'd want to be careful about that.  I don't know exactly what would happen, but I suspect that you really don't want multiple resource-switchers arm-wrestling over the same part.

That said, though:  I dunno about the other mods, but for this one, it only affects parts that have explicitly had ModuleSimpleFuelSwitch and ModuleSwitchableResources added to it with config.  So for example, if you were to set up the config so that my mod affects tanks A, B, and C, whereas some other fuel switcher mod only affects tanks D, E, and F, then that ought to work just fine, I think.

9 hours ago, DStaal said:

The question I haven't seen asked: What about other fuels?  Stock KSP has Xenon, and there's of course other fuels out there.  Outside of the scope, or just not implemented?  (There's even rare cases where it might be nice to have an Oxidizer tank - though admittedly that's uncommon.)

Another "yes and no".  The important distinction to bear in mind is the difference between what the mod can do, versus what I've actually configured it to do by default.

I've deliberately not touched monoprop or xenon in the configs I include with SimpleFuelSwitch.  That's because the stock game already has dedicated fuel tanks for those, and in my own gameplay I actually kinda like that I have to use a tank that's specific to what I want to put in it.

The reason I made this mod was not because "I want to have one tank that can be either LFO or LF."  No, my gripe was that there weren't any freaking LF tanks at all, which made it really inconvenient to try to use any rocket engine that is fueled on LF-only.  One way to "fix" that would be to add a whole bunch of LF-only tanks... except that there are so many tank shapes out there that it would seriously bloat the parts panel in the vehicle editor, and I loathe clutter.  So I added the switch so that I could toggle just the LFO-versus-LF, and (by design) all the other fuels still use their dedicated fuel tanks.

That said, though, also by design I made SimpleFuelSwitch flexible.  It's completely controlled by the config, and there's not a single line of code in the mod that cares one whit about which resources it works with.  It will work with any arbitrary resource for any part-- all you need is to add some config.  So, for example, in your own gameplay if you'd prefer to have all the stock LFO tanks be switchable not just to LF, but also to monoprop and/or xenon as well, then that's trivially easy for you to do with a bit of MM config.  Just copy the configs I've provided and switch out some labels and resource names.

(Heck, for that matter, you could make it able to swap between ablator, ore, solid rocket fuel, and electricity, if you were so inclined.  Resources is resources.  The mod don't care.)  :sticktongue:

6 hours ago, Tyko said:

Could you please add MonoProp as well? That's also a stock fuel, so it's a bit of feature creep (sorry) but pretty straightforward.

See above.  No, I won't be adding it to the default configs that the mod installs, because I like that monoprop has its own dedicated fuel tanks.  However, it would be easy for anyone to add it to their own games with a bit of config.

Hmmm... maybe I should spin up a parallel mod, "SimpleFuelSwitch Community Extensions", with some super-permissive license like MIT, to aggregate various helpful and optional user-supplied configs for the mod-- sort of the way I did with IndicatorLights.  That way, for folks like you who want something that I don't supply by default, it would be a conveniently accessible "library" to choose from, thus saving people the hassle of supplying their own config.  I'll think about it.  :)

3 hours ago, TheKurgan said:

Just found a small bug, and I guess it's pretty common.

If a tank has a config like this:

<snip>

Then it hangs on game loading screen.

I've encountered this several times in the last few mins, and edited the tanks to be full.... here goes 4th attempt to load the game :)

Hmm, interesting.  Thanks for the heads-up!  :)  I'll take a look when I get a chance.  I never configure my own tanks to have zeroed resource by default, so this isn't a scenario that it occurred to me to test.

2 hours ago, 4x4cheesecake said:

I've created a config to add all fuels to all tanks, with a few exceptions:

Thanks for helping out!  Will bear that in mind if I end up creating a "community extensions" companion mod.

2 hours ago, linuxgurugamer said:

Does this support Xenon as a fuel?

As described above in this post-- the code does (because it works with any arbitrary resource), it's simply the case that I've deliberately not installed any config for switching out xenon because I happen to like that it has dedicated fuel tanks.  But would be trivial to enable with a bit of MM config.

2 hours ago, 4x4cheesecake said:

 

@Snark adresses the LF tanks by name and not by the resource so no mod part will be affected.

edit: on the other hand, it works with LFO tanks....now I'm confused :confused:

Yeah, I guess that's a bit confusing, sorry.  For the LF tanks, I addressed them individually by name, but for the LFO tanks, I used wildcards so it'll apply to pretty much everything.

The rationale being that any LFO tank in principle could be useful for LF, because what if you've got a nuclear engine somewhere?  Whereas there might be some LF-only tanks out there (e.g. in mods) that are intended to be only on airplanes or something, so I didn't feel comfortable just globally adding LFO to all of them-- didn't want to create undesired side effects.

Would be easy to add options to other LF tanks where desired, using additional config.

(Okay, I think I've finished responding to everything folks mentioned on page one of this thread... wow that's a lot of discussion.  :)  Anyway, I'll continue responding to more stuff in a subsequent post.)

Link to comment
Share on other sites

10 minutes ago, TheKurgan said:

Still freezing on tanks that have amount <  maxAmount 

Yeah, I noticed this one as well...I just got a stupid moment and got confused

6 minutes ago, Snark said:

So, what's needed for me to be able to fix this is, I need to find some way to notify the engineer's report "you're dirty, please update".  The open question is, how do I do that.  It'll require that there's some "hook" I can call to do that, and I don't actually know that such a hook exists-- nor do I know how/where to find it.  So I'll need to do some research and/or ask around in the modding forums.  The happy case is that there will, in fact, be such a hook, and I can just add a line of code to call it and the bug will be all fixed.  The unhappy case would be if there is no such publicly-accessible hook, in which case the bug would be basically unfixable.

My guess is that there will be some way to fix it-- but I'll need to do some digging to figure out exactly how, unless someone who's reading this can just hand me the answer on a silver platter.  ;)

Digging around in code to find solutions for minor cosmetical issues is fun :D Did it several times for different mods already and even if you don't find a solution, there is usually something you can learn from the code (at least I can learn something^^). I'll also take a closer look at this one, just because I'm curious^^

14 minutes ago, Snark said:

Yeah, I thought about that.  However, I couldn't think of any cure that seemed unambiguously better than the disease, so to speak, which is why I didn't do this.

[snip]

If they want to add resources to them, then they can easily do so with a simple MM patch, basically just copy what I've done to some of the other LF-only tanks

I see.

Well, I already started to build my own config and I'll keep sharing the results ;)
 

Link to comment
Share on other sites

40 minutes ago, TheKurgan said:

Still freezing on tanks that have amount <  maxAmount

Yep, that's clearly a pretty bad bug-- it's one I didn't catch 'coz I simply didn't test that.  I'll make fixing that a top priority when I have a chance.  No promises on an exact release date, but it'll be as soon as possible, I really don't want it to do that.

3 minutes ago, 4x4cheesecake said:

Digging around in code to find solutions for minor cosmetical issues is fun :D Did it several times for different mods already and even if you don't find a solution, there is usually something you can learn from the code (at least I can learn something^^). I'll also take a closer look at this one, just because I'm curious^^

To be clear, when I said "minor cosmetic", I didn't mean that in the sense of "...and therefore I can't be bothered with it", but rather in the sense of "...don't worry, it's not dangerous and shouldn't discourage you from using the mod."  I'd really like to fix that, too.  It'll take some research and/or asking around, though, because I need to find out how to tell the game "hey, the engineer's report is 'dirty', you need to refresh it."  I hit a very similar problem in the PAW (right-click window) when coding, but I easily fixed that because the relevant C# class for that window has a handy method to force it to refresh, and I was able to find some sample code in the forums for how to track down the window.  For the engineer's report, I have no idea-- need to find out how.

5 minutes ago, 4x4cheesecake said:

Well, I already started to build my own config and I'll keep sharing the results ;)

Sounds good.  Hopefully I'll have time relatively soon to create a companion "optional community-supplied configs" repository so that you'll have somewhere a bit more "official" to share these things.  :)

 

Link to comment
Share on other sites

just finished editing about 200 parts to make their amout = maxAmount... Shows you I REALLY want this mod to work, because I HATE the alternatives out there.

ok maybe not 200... but alot :P

Edited by TheKurgan
Link to comment
Share on other sites

53 minutes ago, Snark said:

That said, it wouldn't be too hard to add a bit of extra code (plus an optional field for the ModuleSwitchableResources config) so that it would be possible to set up a part to tie a fuel option to a variant, so that switching the variant would switch the fuel option, and vice versa.  Would allow people to make mod parts that actually do have different models per resource type, if they're so inclined.

I am so inclined :)

if you have a look at the Simplex Resources mod (available on SpaceDock) I simply textured the ore tanks with my own variants but had to make it a separate part per unique ore.  Ideally Squad would have done what you have done with the variant switcher to allow different resources on variants, but no.  I'd use this mod to do that.  Same with the Metal Part containers.

Edited by theJesuit
Expanding scope.
Link to comment
Share on other sites

11 minutes ago, theJesuit said:

I am so inclined :)

Okay, thanks-- I'll take it under advisement.  Adding such a feature would depend on my available time, so is a bit unpredictable.  I've already got two bugs reported here (the cosmetic engineer's report one, and the more serious hang-on-startup-if-configured-without-full-resources one), and I'll be prioritizing bugfixes over new features.

But this is kinda piquing my interest now.  :)  I'll follow up with you if-and-when I have time to address this.

Link to comment
Share on other sites

31 minutes ago, Snark said:

Okay, thanks-- I'll take it under advisement.  Adding such a feature would depend on my available time, so is a bit unpredictable.  I've already got two bugs reported here (the cosmetic engineer's report one, and the more serious hang-on-startup-if-configured-without-full-resources one), and I'll be prioritizing bugfixes over new features.

But this is kinda piquing my interest now.  :)  I'll follow up with you if-and-when I have time to address this.

Awesome thanks. To be fair, I'm not expecting it as you initially said no and expands your original concept.  It would make it more modable than say B9 part switch if IFS for the basic modder though so there is that.  But only in so much that it is enjoyable to make :)

Bug fixes more important than new features :)

Peace.

Link to comment
Share on other sites

57 minutes ago, TheKurgan said:

just finished editing about 200 parts to make their amout = maxAmount... Shows you I REALLY want this mod to work, because I HATE the alternatives out there.

ok maybe not 200... but alot :P

Holy cow, dude.  <doffs hat>

Or you could, y'know, wait just a little while until I have a chance to fix that bug.  ;)  Unless someone finds something even worse (hopefully not!), fixing that bug is my #1 priority for this mod.  Would love to get a fix out within the next few days, but can't make any promises since my schedule can be a bit unpredictable.  (Plus, of course, I won't know how tricky it'll be to fix until I've had a chance to see what's actually going on; am not at my KSP machine right now.  Hopefully it'll turn out to be some simple oversight.)  But it'll be pretty soon, hopefully.

Link to comment
Share on other sites

3 hours ago, Snark said:
10 hours ago, Tyko said:

Could you please add MonoProp as well? That's also a stock fuel, so it's a bit of feature creep (sorry) but pretty straightforward.

See above.  No, I won't be adding it to the default configs that the mod installs, because I like that monoprop has its own dedicated fuel tanks.  However, it would be easy for anyone to add it to their own games with a bit of config.

Challenge accepted...please point me in the right direction though. Most of your config is pretty straightforward and I'm familiar with it. I'm guessing that the issue is the resourcesId. Is that defined in your DLL? Would you have to create a new ID called monopropellant in order for me to add it?

The rest should be pretty simple:

    MODULE
    {
        name = ModuleSwitchableResources
        resourcesId = monopropellant
        displayName = #SimpleFuelSwitch_Monopropellant
        selectorFieldName = #SimpleFuelSwitch_fuelTypeLabel
        RESOURCE
        {
            name = Monopropellant
            amount = #$/RESOURCE[LiquidFuel]/amount$   //  Have to do the math here to figure out the right conversion rates for monoprop density
            @amount += #$/RESOURCE[Oxidizer]/amount$
            maxAmount = #$/RESOURCE[LiquidFuel]/maxAmount$
            @maxAmount += #$/RESOURCE[Oxidizer]/maxAmount$
        }
    }

Edited by Tyko
Link to comment
Share on other sites

1 hour ago, Tyko said:

Challenge accepted...please point me in the right direction though. Most of your config is pretty straightforward and I'm familiar with it. I'm guessing that the issue is the resourcesId. Is that defined in your DLL? Would you have to create a new ID called monopropellant in order for me to add it?

Nope, the DLL neither knows nor cares about IDs.  They're completely arbitrary, you could use any string you like.  You could call if "Bob", if you like, and it would work just fine-- doesn't matter.  I'd suggest calling it something human-readable to facilitate debugging (e.g. "monopropellant"), but it's up to you, you can make up your own IDs.

It only needs to meet two rules:

  • Unique within a given part, i.e. you don't want to have two ModuleSwitchableResource on the same part with the same resourcesId.
  • Permanently invariant, i.e. once you've picked one, it is graven in stone and you don't change your mind and rename it later after you've already designed and/or launched ships that have that ID in it.  Because if you changed it, those ships would break.  So pick an ID that you like, because whatever you pick, you (and anyone else who uses your config) are stuck with it forever.  ;)  Fortunately, it's easy to keep-it-the-same-forever-and-never-change-it because it's never displayed to a user; it's an internal programming ID, so there's not really any reason to change it.

How it's used:  A fuel tank equipped for SimpleFuelSwitch needs the following:

  • One ModuleSimpleFuelSwitch.  This is the thing that handles the actual switching of resources, and also is the thing that remembers which option has been chosen for that part.
  • Two or more ModuleSwitchableResoruce.  These are the things that control the display in the info panel in the editor, and also they define what the options are that the ModuleSimpleFuelSwitch can choose among.  No two of them should have the same resourcesId.

The role of resourcesId is that each of the options for a part has its own resourcesId that serves as its "name".  The way ModuleSimpleFuelSwitch remembers "which one of these options is the one that's selected for this part?" is that it has a field called resourcesId, that gets persisted to the .craft and .sfs files.  When the user picks one option, that option's resourceId gets stored in the ModuleSimpleFuelSwitch's resourceId field.

(Why it's done that way:  Maintainability.  When I first started coding, I was just using numeric indexes, i.e. an integer saying "use the first one" or "use the second one", that sort of thing.  But I quickly realized that that would be a maintenance nightmare.  Suppose someone defines a tank where option 1 is LF and option 2 is LFO.  They launch a ship having picked LFO, which is stored simply as a number indicating "use the 2nd one".  Then later on they get a mod update that adds monopropellant as a 3rd option, except that the update makes it so that option 1 is LF, option 2 is monoprop, and option 3 is LFO.  That would then break every ship that had been designed or launched before the update, because all they would know is "use the 2nd one", but the 2nd one has now become monoprop, and suddenly all your ships are flying around with nothing but monoprop on board.  Oops.  :sticktongue:  So by picking a unique string name, that makes it much more maintainable over time.)

So anyway, the upshot of all this is that SimpleFuelSwitch already supports any resource you care to point it at.  All you need is config.

So your proposed config from your post above should work just fine as-is.  A few suggestions, though:

  • You can just leave off displayName, for the sake of simplicity.  The mod will default to the resource's display name, e.g. "Monopropellant".  (I supplied "LF" and "LFO" as display names for my own config because, for example, "Liquid Fuel + Oxidizer" was a long enough string that it didn't fit well in the UI in various places.)
  • Regarding the math on "amount":  One unit of monopropellant is 4 kg, compared with 5 kg for a unit of liquid fuel or oxidizer.  So assuming you want the tank to have the same mass of monoprop as it did of the other stuff (which isn't actually a requirement, by the way-- you could have it weigh something different if you wanted), then the config would look like the below:
amount = #$/RESOURCE[LiquidFuel]/amount$
@amount += #$/RESOURCE[Oxidizer]/amount$
@amount *= 1.25
maxAmount = #$/RESOURCE[LiquidFuel]/maxAmount$
@maxAmount += #$/RESOURCE[Oxidizer]/maxAmount$
@maxAmount *= 1.25

 

Link to comment
Share on other sites

Updated my config :)

Now, every folder represents a tank type (LF,LFO,Mono,Xenon). Each folder contains 4 config files for the different resource types, called 'Add_<Ressource>', so you can choose which fuel types will be added to each tank type.

  • Delete a folder to ignore the tank type
  • Delete a config to remove the fuel type
  • DO NOT DELETE THE REQUIRED FOLDER OR THE CONFIGS OF IT
  • DOES NOT WORK ALONG THE DEFAULT CONFIGS, YOU HAVE TO DELETE 'Add_LF_to_LFO_tanks.cfg' & 'Add_LFO_to_LF_tanks.cfg' (I still try to work around this)

Download: https://www.dropbox.com/s/u1wb4xz0sbwch9v/SFS_Alt_Conf.zip?dl=0

(I've also rebalanced some stuff so the wet mass should always match the stock wet mass, except for the OX-Only tanks)

edit: I forgot that my PR isn't merged (yet?) so the 'LF_Only' tank type will break the game...If anyone want to try the configs anyway, just remove the 'LF_Only' folder until @Snark patched the bug :)

Edited by 4x4cheesecake
Packed into a .zip instead of .rar and updated the link
Link to comment
Share on other sites

13 hours ago, Snark said:

I think what's going on here is that the engineer's report is simply not getting updated, because when my code swaps out the resources, KSP doesn't realize that I've done that so the engineer's report doesn't "know" that it needs to be refreshed.

Just fire off the GameEvents.onEditorShipModified event using EditorLogic.fetch.ship (probably check if it's null, just to avoid potential for weird bugs) as the argument for the event. That's the generic, something-has-changed-here, event that would trigger any kind of update in the editor. It should also trigger the dV calcs to update.

Link to comment
Share on other sites

Hi folks,

I've released SimpleFuelSwitch version 1.0.1.  Changes include:

  • Fix the hang-on-startup bug when resources in a part are zero. (Thanks to @TheKurgan for reporting.)
  • Fix the out-of-date engineering report bug when switching reosurces.  (Thanks to @4x4cheesecake for reporting, and to @DMagic for explaining how to fix.)
  • Add some additional explanation of resourcesId semantics to the README.md file that comes with the configs-- hopefully it's more clear now.  (Thanks to @Tyko for requesting clarification.)
  • Added Big-S Delta Wing to the list of LF-only parts that can now be switched to LFO(Thanks @4x4cheesecake for suggesting.)

Many thanks to everyone for providing tons of feedback-- and within the first 24 hours of release, at that!  Really helps to drive mod quality.

Enjoy!  :)

 

Link to comment
Share on other sites

7 hours ago, 4x4cheesecake said:

Updated my config :)

Thanks for putting that together!

If you don't mind, would you consider posting it in a format that's readable by default on Windows, e.g. .zip?  (As opposed to .rar, which can't be opened there without installing third-party software.)

Rationale:

  • I can't actually look at it now, since I'm on Windows and I'm paranoid about installing unknown third-party apps on my machine.  I'd love to review your config, because based on your instructions (i.e. "delete existing configs and replace"), I suspect you may be making life more difficult for yourself (and anyone using your configs) than it needs to be.  MM is pretty good about allowing patching stuff in-place without having to tinker with the thing that you're patching.  But I can't review your config and provide constructive suggestions if I can't actually open it.
  • By posting it in .zip (which everyone in the universe can open) rather than .rar (which only those few people who have installed 3rd-party software can open), you make your config available to a wider audience.  It's up to you, though.  ;)

Just a thought.

 

Link to comment
Share on other sites

Just now, Snark said:

Thanks for putting that together!

If you don't mind, would you consider posting it in a format that's readable by default on Windows, e.g. .zip?  (As opposed to .rar, which can't be opened there without installing third-party software.)

Rationale:

  • I can't actually look at it now, since I'm on Windows and I'm paranoid about installing unknown third-party apps on my machine.  I'd love to review your config, because based on your instructions (i.e. "delete existing configs and replace"), I suspect you may be making life more difficult for yourself (and anyone using your configs) than it needs to be.  MM is pretty good about allowing patching stuff in-place without having to tinker with the thing that you're patching.  But I can't review your config and provide constructive suggestions if I can't actually open it.
  • By posting it in .zip (which everyone in the universe can open) rather than .rar (which only those few people who have installed 3rd-party software can open), you make your config available to a wider audience.  It's up to you, though.  ;)

Just a thought.

 

Hey Snark, just FYI, 7-Zip will open .rar files and it's a well established third party app

Link to comment
Share on other sites

2 minutes ago, Snark said:

If you don't mind, would you consider posting it in a format that's readable by default on Windows, e.g. .zip?  (As opposed to .rar, which can't be opened there without installing third-party software.)

That's no problem at all and already done ;)

Updated link is in my previous post.

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