Posted February 11, 201510 yr 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.
February 11, 201510 yr 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
February 11, 201510 yr 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) ).
February 11, 201510 yr 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?
February 11, 201510 yr 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.
February 11, 201510 yr 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 February 11, 201510 yr by Starwhip
February 11, 201510 yr 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 February 11, 201510 yr 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.