Jump to content
View in the app

A better way to browse. Learn more.

Kerbal Space Program Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

What needs to be done to have a resource flow only through a stack and not through fuel lines? I would assume that you disable fuel line crossfeed, but I do not know where to start.

placement of fuel lines is important - fuel flows linearly.

  • Author

I mean disabling it in the code. Trying to make an SRB equivalent with stackable fuel parts, but the fuel can be transferred with the fuel lines. I don't want this.

MBS Page

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

  • Author

Darn.

Oh, well, I suppose users just shouldn't connect fuel lines...

OR:

Is there a way to disable fuel lines from attaching to the surface of a specified part, while still allowing other parts to attach to the surface?

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.

  • Author

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

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*

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.