Jump to content

Fuel Flow Alteration


Recommended Posts

You can't, AFAIK.

Fuel crossfeed works by each part having a table of parts it feeds with. Fuel lines add things to that table. It's not separated out per resource. At best you can just set different flow modes per resource (which really just means "do we ignore the table and flow everywhere (ALL_VESSEL, STAGE_PRIORITY), or do we use the table (STACK_PRIORITY) or do we not flow at all (NO_FLOW) ).

Link to comment
Share on other sites

No. There is no don't-attach-to-these-parts list in the editor.

But you can check to which part a fuel line is attached to and disable crossfeed on it. But I'm not sure if that'll work out. The fuel line is a special kind of part.

Link to comment
Share on other sites

That'll do it, now how do you do it? :)

EDIT:

Seems like you can do it like so:

(This is a mock up structure, with some syntax. I'm trying to find out what you would need in C#)

IF(Parent = mbs_sfs125 || Parent = mbs_sfs250 || Parent = mbs_sfs0625){

closeFuelLine();

}

Edited by Starwhip
Link to comment
Share on other sites

Check if your code runs in the editor. E. g.:

if (HighLogic.LoadedSceneIsEditor) ...

Then cycle through the parts list to find all fuel lines. E. g.:

EditorLogic.fetch.ship.parts.FindAll(IsAFuelLine);
...
private bool IsAFuelLine(Part part)
{
return part.GetType().Equals(typeof(FuelLine)) == true;
}

Then check if the fuel line is connected to your part. E. g.:

EditorLogic.fetch.ship.parts.FindAll(IsAFuelLine).ForEach(DisableCrossFeedIfAttachedToYourPart);
...
private void DisableCrossFeedIfAttachedToYourPart(Part part)
{
FuelLine fuelLine = part as FuelLine;
...
}

I don't know how to get the attached parts. I couldn't find a property or method in the object which immediately sounds like it'll return the attached parts. That's your work. ;)

Also I found several methods and property which sound like they could be used to disable fuel flow. But it has to be tested which one is the correct one. Or look in the source code of other mods.

Edit:

I'm also not sure if the editor saves the disabled crossfeed to the save file. It could be that you'll also have to disable crossfeed when the flight scene starts up.

Edited by *Aqua*
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...