Jump to content

[1.0.4]Intake Build Aid (obsolete for 1.0.5)


LordFjord

Recommended Posts

But work is not clear enough. Auto reassign function works weak. Not affected sometimes.

Can you give me more info on this? Maybe a screenshot before and after the auto-assignment with the IBA GUI visible on both shots.

The auto assignment is the part of the mod that works most reliably, I did not have issues with it so far, also not on big or complicated vessels with many mixed engine and intake types.

Manual assign is not work if the engines attached symmetricaly (all intakes connected to one jet and F8 don't select intakes!).

I will need to look into this, but an example screenshot could help here as well.

A hint: you will usually never need the manual intake assignment if you use the auto-assign button and watch that the numbers of intakes per type and engines match. The only case where I could think of manual assignments being useful are: air-flow optimized staged engines / intakes or air-flow optimized shut off engines.

But this tool only allow to balanse intakes and jets.

Yes that is what it's supposed to do :) Sorry, I didn't understand what you meant by this.

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

I have found the following bug.

If i revert flight in SPH next time i see my plane i have 2-3 IBA icons in the toolbar (stock not blizzy's) for some reason.

This could be caused either by:

1. reverting

2. detaching an optimized engine and replacing with another (put on double exhaust with mirror symmetry)

Link to comment
Share on other sites

Just an fyi, but for me at least I do not see any other buttons/information aside from "Auto arrange" and "Close". I do not even get anything highlighted when I turn this on and when I have the IBA screen open and I go to look at other parts this is what happens: http://imgur.com/p0kmCSM Just wanted to bring these issues to your attention.

Link to comment
Share on other sites

  • 2 weeks later...

Thanks for the late bugreports, sorry that I couldn't respond earlier.

@Grunf911:

That's a weird one and i couldn't reproduce the issue. I did not integrate blizzy's toolbar, only the stock one.

@FusionItalian: In the pic I see that the IBA icon is highlighted, so the GUI "should" be shown. Probably it conflicts with the tooltip of the selected part on the left.

How does it behave if you do not select a part?

A few words to my defense ;)

The mod was really done quick&dirty and I still only have a slight idea about how unity works - expecially the GUI and shader stuff is a lot of magic and fairy dust. I'm lazy and do more than enough programming @work so I didn't read the unity docs. The fancy untiy parts were copied and modified from other mods (with permission). The more experienced modders around here would probably giggle and laugh about my unity code.

However, the very basic part of the mod, the intake reorganization, that works reliably as it has nothing to do with unity.

I doubt that I will fix the existing issues - as much as I would like to, and my programmer background basically demands it - BUT with KSP 1.0 imminent, this mod will become obsolete very soon.

Sorry to the folks who still want to run older KSP versions, I won't fix the bugs but the mod's basic functionality works (hit F7).

In any case, feel free to pick up the code at https://github.com/LordFjord/KSP/tree/master/IntakeBuildAid . Its Beerware, so you can do whatever you want to with it. It'd be cool if you drop me a message, I'd happily post your fixes here.

Fjord

Link to comment
Share on other sites

  • 2 weeks later...
Is the intake air distribution across engines in stock balanced from 1.0 onward?

I don't think so. My planes keep flipping at high altitudes when engines cut out. It may have better code integration but I believe this mod is essential in reading the craft file to make sure all engines are balanced.

I would request the creator of this mod to further advance this wonderful mod. "Don't just think on linear thrust, also think of VTOL" We need your mod. Please don't push it under the rug so easily.

Link to comment
Share on other sites

We need your mod. Please don't push it under the rug so easily.

Yup, we're screwed without it. At least you gotta pay attention to the order in which you place the parts. This particular part of the game really feels unfinished and needs some love – if not from Squad then from the modding community.

Link to comment
Share on other sites

Honestly, the current stock code applied to jets in the game that let them pull liquid fuel evenly from across a craft needs to be applied to IntakeAir as well. Or at least make it so that intakes by default get assigned to the closest jet (this is to take into account the newer aerodynamics and the likes of NEAR/FAR - asymmetric flameouts should still occur due to flight conditions).

Having to plan out my assembly of a craft (or completely re-do one in a planned manner once I have the design I want) is ridiculous, IMHO. When I found out the method KSP uses for IntakeAir, I thought it was stupid (still do). I found out about IBA because of that. I consider IBA essential for any spaceplane/atmos-only plane build. I'm hoping for an update to full 1.0 compatibility and functionality. I can still get asymmetric flameouts in 1.0.x due to Intake/Engine assembly order, so no, this mod is not (yet) obsolete.

If I may be a bit greedy, the only thing I could ask for as an extra (if it isn't already a feature and I'm just stupid) is the ability to re-order engines so I have some control over what engines get excess IntakeAir first (mainly for the likes of VTOLs that rarely have all engines running at once. Usually only have one set at a time.)

Link to comment
Share on other sites

good news: I have fixed the toolbar problem (multiple copies, unresponsive button) here locally. IntakebuildAid now works here for KSP 1.0.2.

Only little code changes for the Applauncher registration/deregistration is needed.

LordFjord, this is the updated IntakeBuildAid.cs (sorry, I have no clue how to get this as a pull request to the githb repo):


using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;


namespace IntakeBuildAid
{
[KSPAddon( KSPAddon.Startup.EditorAny, false )]
public class IntakeBuildAid : MonoBehaviour
{
private EditorLogic _editor;
private static Material _material; // shader to highlight stuff
// highlight colors
private static Color _selectedIntakeColor = new Color( 0f, 0.2f, 1f, 1f );
private static Color _selectedEngineIntakeColor = new Color( 0f, 0.2f, 1f, 1f ); // todo: pick better colors...
private static Color _selectedEngineColor = new Color( 1f, 0f, 0f, 1f );
private static Color _selectedIntakeEngineColor = new Color( 1f, 0f, 0f, 1f ); // todo: pick better colors...

// used for highlighting intakes and engines
private static Dictionary<Part, List<SavedMaterial>> _managedParts;
private static Part _mouseOverPart;


// used to manually select and assign intakes to engines
private static List<Part> _manualAssignedList;

// from settings
private static bool _useCustomShader;
private static KeyCode _keyHighlight = KeyCode.F6;
private static KeyCode _keyBalanceIntakes = KeyCode.F7;
private static KeyCode _keyManualAssign = KeyCode.F8;


// toolbar
private ApplicationLauncherButton _launcherButton = null; // toolbar


private bool _guiVisible;
private Rect _guiRect;


public void Start()
{
_material = new Material( global::IntakeBuildAid.Resource.OutlineShaderContents );
_managedParts = new Dictionary<Part, List<SavedMaterial>>();
_manualAssignedList = new List<Part>();
GameEvents.onPartAttach.Add( OnPartAttach );
_useCustomShader = false;
LoadSettings();
_editor = EditorLogic.fetch;


// init GUI
//GameEvents.onGUIApplicationLauncherReady.Add( OnGUIApplicationLauncherReady );
OnGUIApplicationLauncherReady();
_guiRect = new Rect( ( Screen.width ) / 4, Screen.height / 2, 300, 100 );
_guiVisible = false;
Utils.DebugLog( "IntakeBuildAid Start() finished" );
}


private void LoadSettings()
{


ConfigNode config = ConfigNode.Load( KSPUtil.ApplicationRootPath + "GameData/IntakeBuildAid/settings.cfg" );

if ( config == null )
{
Utils.Log( "Failed to load settings.cfg" );
}
else
{
ConfigNode rootNode = config.GetNode( "IntakeBuildAid" );
if ( rootNode != null )
{
_useCustomShader = rootNode.GetValue( "useCustomShader" ) == "true";
_keyHighlight = (KeyCode)Enum.Parse( typeof( KeyCode ), rootNode.GetValue( "keyHighlight" ) );
_keyBalanceIntakes = (KeyCode)Enum.Parse( typeof( KeyCode ), rootNode.GetValue( "keyBalanceIntakes" ) );
_keyManualAssign = (KeyCode)Enum.Parse( typeof( KeyCode ), rootNode.GetValue( "keyManualAssign" ) );
}
}
}


public void OnPartAttach( GameEvents.HostTargetAction<Part, Part> eventData )
{
PartType partType = GetPartType( eventData.host );
if ( partType == PartType.AirBreatherEngine || partType == PartType.Intake || partType == PartType.IntakeAndEngine )
{
eventData.host.AddOnMouseEnter( OnMouseEnter );
eventData.host.AddOnMouseExit( OnMouseExit );
Utils.DebugLog( "Added events for part: {0}", eventData.host.name );
}
}


public void OnPartDetach( GameEvents.HostTargetAction<Part, Part> eventData )
{
ResetAllColors();
}


private void OnMouseExit( Part p )
{
_mouseOverPart = null;
}


private void OnMouseEnter( Part p )
{
_mouseOverPart = p;
}


private void Update()
{
if ( !HighLogic.LoadedSceneIsEditor )
{
Destroy( this );
return;
}


if ( Input.GetKeyDown( _keyHighlight ) )
{
#region Highlight intakes and engines
if ( _mouseOverPart != null )
{
ResetAllColors();
// mouse is over a part
// check if part is intake
PartType partType = this.GetPartType( _mouseOverPart );
if ( partType == PartType.Intake )
{
Utils.DebugLog( "Intake found: {0}", _mouseOverPart.name );
ColorPart( _mouseOverPart, _selectedIntakeColor );
// find engine and set color
Part intakeEngine = FindEngineOfIntake( _mouseOverPart );
if ( intakeEngine != null )
{

ColorPart( intakeEngine, _selectedIntakeEngineColor );
}
return;
}
// check if part is engine
else if ( partType == PartType.AirBreatherEngine || partType == PartType.IntakeAndEngine )
{
Utils.DebugLog( "Engine found: {0}", _mouseOverPart.name );
ColorPart( _mouseOverPart, _selectedEngineColor );
List<Part> engineIntakes = FindIntakesOfEngine( _mouseOverPart );
Utils.DebugLog( "Intakes found: {0}", string.Join( ", ", engineIntakes.Select( x => x.name ).ToArray() ) );
foreach ( Part part in engineIntakes )
{
ColorPart( part, _selectedEngineIntakeColor );
}
return;
}
ResetAllColors();
return;
}
else
{
ResetAllColors();

}
#endregion Highlight intakes and engines
}
else if ( Input.GetKeyDown( _keyManualAssign ) && _mouseOverPart != null )
{
#region Manual assign intakes to engines
// get type of part
PartType partType = GetPartType( _mouseOverPart );
if ( partType == PartType.Intake )
{
if ( !_manualAssignedList.Contains( _mouseOverPart ) )
{
// add part to manually assigned list
_manualAssignedList.Add( _mouseOverPart );
ColorPart( _mouseOverPart, _selectedIntakeColor );
Utils.Log( "Part {0} added to manual assigned list.", _mouseOverPart.name );
}
else
{
// remove part from manually assigned list
_manualAssignedList.Remove( _mouseOverPart );
ResetColor( _mouseOverPart );
Utils.Log( "Part {0} removed from manual assigned list.", _mouseOverPart.name );
}
}
else if ( partType == PartType.AirBreatherEngine || partType == PartType.IntakeAndEngine )
{
// end manual assignment once an engine is selected
// add engine to manual list
_manualAssignedList.Add( _mouseOverPart );


// now turn off all coloring
foreach ( Part part in _manualAssignedList )
{
ResetColor( part );
}
// remove these parts from the ship
_editor.ship.Parts.RemoveAll( x => _manualAssignedList.Contains( x ) );
// re-add parts to ship, these now are in a proper order
_editor.ship.Parts.AddRange( _manualAssignedList );
Utils.Log( "Finished manual intake-engine assignment: {0}", string.Join( ", ", _manualAssignedList.Select( x => x.name ).ToArray() ) );
_manualAssignedList.Clear(); // reset list
}
#endregion Manual assign intakes to engines
}
else if ( Input.GetKeyDown( _keyBalanceIntakes ) ) // key triggers
{
#region Balance intakes to engines
// order intakes desceding by intake area
BalanceIntakes();
#endregion Balance intakes to engines
}
#region Debug stuff


#if DEBUG
else if ( Input.GetKeyDown( KeyCode.F11 ) )
{
Utils.DebugLog( "Ship partList:\r\n {0}", string.Join( "\r\n ", _editor.ship.parts.Select( x => x.name ).ToArray() ) );


// dump some logs
if ( _managedParts != null && _managedParts.Count > 0 )
{
Utils.DebugLog( "ManagedParts: {0}", string.Join( ", ", _managedParts.Select( x => x.Key.name ).ToArray() ) );
}
if ( _manualAssignedList != null && _manualAssignedList.Count > 0 )
{
Utils.DebugLog( "ManualList: {0}", string.Join( ", ", _manualAssignedList.Select( x => x.name ).ToArray() ) );
}
}
#endif
#endregion Debug stuff
}


public void OnDestroy()
{
Utils.DebugLog( "OnDestroy" );
if ( _managedParts != null )
{
foreach ( KeyValuePair<Part, List<SavedMaterial>> kvp in _managedParts )
{
ResetColor( kvp.Key );
}
}
_managedParts.Clear();
_manualAssignedList.Clear();


//TheDog, 03.05.2015: FIXED for KSP 1.0.2
if (_launcherButton != null)
{
ApplicationLauncher.Instance.RemoveModApplication( _launcherButton );
//GameEvents.onGUIApplicationLauncherReady.Remove( OnGUIApplicationLauncherReady );
Destroy( this );
_launcherButton = null;
}
}


#region Helpers


private void BalanceIntakes()
{
Queue<Part> intakeQueue = new Queue<Part>( _editor.ship.Parts.Where( x => GetPartType( x ) == PartType.Intake ) // do not treat intakeandengine parts as intake but as engine
.OrderByDescending( x => x.Modules.OfType<ModuleResourceIntake>().First().area ) ); // queue is easier to handle when distributing items to engines - this makes sure we can only handle a part once


Utils.Log( "Intakes found: {0}", string.Join( ", ", intakeQueue.Select( x => x.partInfo.title + ": " + x.Modules.OfType<ModuleResourceIntake>().First().area ).ToArray() ) );
List<WeightedPartList> totalPartList = new List<WeightedPartList>();
// so far all jets have intakeair ratio of 15, so we treat jets, turbos and rapiers alike
// TODO for future: take intakeair ratio into account. how exactly? I donno


// handle engines grouped by type, so far its by placement order
foreach ( Part part in _editor.ship.parts )
{
if ( GetPartType( part ) == PartType.AirBreatherEngine )
{
WeightedPartList wpl = new WeightedPartList();
wpl.AddPart( part );
totalPartList.Add( wpl );
}
else if ( GetPartType( part ) == PartType.IntakeAndEngine )
{
WeightedPartList wpl = new WeightedPartList();
wpl.IntakeAreaSum = part.Modules.OfType<ModuleResourceIntake>().First().area; // add intake area of part that has both intake and engine in one
wpl.AddPart( part );
totalPartList.Add( wpl );
}
}


Utils.Log( "Jets found: {0}", string.Join( ", ", totalPartList.Select( x => x.PartList.First().partInfo.title ).ToArray() ) );


if ( intakeQueue.Count > 0 && totalPartList.Count > 0 )
{
// strip ship from intakes and jets
_editor.ship.parts.RemoveAll( x => intakeQueue.Contains( x ) );
Utils.Log( "removed intakes temporarily" );
_editor.ship.parts.RemoveAll( x => totalPartList.Select( y => y.PartList.First() ).Contains( x ) );
Utils.Log( "removed jets temporarily" );


int intakeCount = intakeQueue.Count;
for ( int i = 0; i < intakeCount; i++ )
{
Part part = intakeQueue.Dequeue();
totalPartList.Where( x => x.IntakeAreaSum == totalPartList.Min( y => y.IntakeAreaSum ) ).First().AddPart( part ); // WeightedPartList with the least IntakeAreaSum will get the next intake assigned
}


// go through all part lists, reverse them and add them back to ship
foreach ( WeightedPartList partList in totalPartList )
{
partList.PartList.Reverse();
_editor.ship.parts.AddRange( partList.PartList ); // add parts for engine and its intakes back to ship
Utils.Log( "Intake/engine set: {0}, total intake area: {1}", string.Join( ", ", partList.PartList.Select( x => x.name ).ToArray() ), partList.IntakeAreaSum );
}


Utils.Log( "Finished intakes - jets balance" );
}
else
{
Utils.Log( "There are either no intakes or no engines" );
}
}


private void ColorPart( Part part, Color color )
{
if ( !_managedParts.ContainsKey( part ) )
{
if ( _useCustomShader )
{
List<SavedMaterial> savedMaterials = new List<SavedMaterial>();
Renderer[] renderers = part.FindModelComponents<Renderer>();


if ( renderers.Length > 0 )
{
for ( int i = 0; i < renderers.Length; ++i )
{
savedMaterials.Insert( i, new SavedMaterial() { Shader = renderers[i].sharedMaterial.shader, Color = renderers[i].sharedMaterial.GetColor( "_Color" ) } );
renderers[i].sharedMaterial.shader = _material.shader;
renderers[i].sharedMaterial.SetColor( "_Color", color );
}


_managedParts.Add( part, savedMaterials );
}
}
else
{
part.SetHighlight( true, false );
part.SetHighlightColor( color );
part.SetHighlightType( Part.HighlightType.AlwaysOn );
}
}
}


private void ResetColor( Part part )
{
if ( _useCustomShader )
{
if ( _managedParts.ContainsKey( part ) )
{
List<SavedMaterial> savedMaterials = _managedParts[part];
if ( savedMaterials.Count == 0 )
{
_managedParts.Remove( part );
return;
}


Renderer[] renderers = part.FindModelComponents<Renderer>();
if ( renderers.Length > 0 )
{
for ( int i = 0; i < renderers.Length; ++i )
{
renderers[i].sharedMaterial.shader = savedMaterials[i].Shader;
renderers[i].sharedMaterial.SetColor( "_Color", savedMaterials[i].Color );
}
}


if ( _managedParts.ContainsKey( part ) )
{
_managedParts.Remove( part );
}
}
}
else
{
part.SetHighlight( false, true );
if ( _managedParts.ContainsKey( part ) )
{
_managedParts.Remove( part );
}
}
}


private void ResetAllColors()
{
foreach ( Part part in _editor.ship.parts )
{
ResetColor( part );
}
_managedParts.Clear();
}


private void OnGUIApplicationLauncherReady()
{
//TheDog, 03.05.2015: FIXED for KSP 1.0.2
if (_launcherButton != null) {
return;
}


// Create the button in the KSP AppLauncher
Utils.DebugLog( "Adding toolbar icon" );
_launcherButton = ApplicationLauncher.Instance.AddModApplication( ToggleGUI, ToggleGUI,
null, null,
null, null,
ApplicationLauncher.AppScenes.SPH | ApplicationLauncher.AppScenes.VAB,
GameDatabase.Instance.GetTexture( "IntakeBuildAid/icons/Toolbar", false ) );


_launcherButton.toggleButton.startTrue = true; //TheDog, 03.05.2015: FIXED for KSP 1.0.2
//GameEvents.onGUIApplicationLauncherReady.Remove (OnGUIApplicationLauncherReady);
}


private Part FindEngineOfIntake( Part intakePart )
{
if ( GetPartType( intakePart ) != PartType.Intake )
{
return null;
}
int startIndex = _editor.ship.Parts.IndexOf( intakePart );
for ( int i = startIndex; i <= _editor.ship.Parts.Count - 1; i++ )
{
if ( GetPartType( _editor.ship.Parts[i] ) == PartType.AirBreatherEngine || GetPartType( _editor.ship.Parts[i] ) == PartType.IntakeAndEngine )
{
return _editor.ship.Parts[i];
}


// handle loop overflow
if ( i == _editor.ship.Parts.Count - 1 )
{
i = 0;
}
if ( i == startIndex - 1 )
{
break; // no engines found
}
}
return null;
}


private List<Part> FindIntakesOfEngine( Part enginePart )
{
PartType enginePartType = GetPartType( enginePart );
if ( !(enginePartType == PartType.AirBreatherEngine || enginePartType == PartType.IntakeAndEngine ) )
{
Utils.DebugLog("Part is no engine, cant find its intakes.");
return null;
}
List<Part> intakes = new List<Part>();
int startIndex = _editor.ship.Parts.IndexOf( enginePart ); // find index of engine in the part list
for ( int i = startIndex - 1; i >= 0; i-- ) // iterate backwards from the engine, find all intakes
{
PartType partType = GetPartType( _editor.ship.Parts[i] );
if ( partType == PartType.AirBreatherEngine || partType == PartType.IntakeAndEngine )
{
Utils.DebugLog( "FindIntakesOfEngine at {0}, engine: {1}", i, _editor.ship.Parts[i].name );
break; // we found another engine, done
}
else if ( partType == PartType.Intake )
{
intakes.Add( _editor.ship.Parts[i] ); // add found intake to the list
}

// handle loop overflow, if there is no engine at the end of the partlist, there might be some more intakes that belong to the engine at the end of the list.
if ( i == 0 )
{
i = _editor.ship.Parts.Count; // start at the end of the list again
Utils.DebugLog( "FindIntakesOfEngine reset loop" );
}
if ( i == startIndex )
{
Utils.DebugLog( "FindIntakesOfEngine done" );
break; // we are through the list, abort
}
}
return intakes;
}


private PartType GetPartType( Part part )
{
// find engines by ModuleEngines and ModuleEnginesFX module with intakeair propellant
// this is for modded engines that are both intakes and engines in one part
if ( ( ( part.Modules.OfType<ModuleEnginesFX>().Any( x => x.propellants.Any( y => y.name == "IntakeAir" ) ) )
|| ( part.Modules.OfType<ModuleEngines>().Any( x => x.propellants.Any( y => y.name == "IntakeAir" ) ) ) )
&& ( part.Modules.OfType<ModuleResourceIntake>().Any( x => x.resourceName == "IntakeAir" ) )
)
{
return PartType.IntakeAndEngine;
}
// find engines by ModuleEngines and ModuleEnginesFX module with intakeair propellant
else if ( ( part.Modules.OfType<ModuleEnginesFX>().Any( x => x.propellants.Any( y => y.name == "IntakeAir" ) ) )
|| ( part.Modules.OfType<ModuleEngines>().Any( x => x.propellants.Any( y => y.name == "IntakeAir" ) ) )
)
{
return PartType.AirBreatherEngine;
}
// find intakes by resource intakeair
else if ( part.Modules.OfType<ModuleResourceIntake>().Any( x => x.resourceName == "IntakeAir" )
)
{
return PartType.Intake;
}
else
{
return PartType.SomethingElse;
}
}

#endregion Helpers


#region GUI

// old shabby onscreen message...


//GUIStyle osdLabelStyle;
//private void InitStyles()
//{
// osdLabelStyle = new GUIStyle();
// osdLabelStyle.stretchWidth = true;
// osdLabelStyle.alignment = TextAnchor.MiddleCenter;
// osdLabelStyle.fontSize = 24;
// osdLabelStyle.fontStyle = FontStyle.Bold;
// osdLabelStyle.normal.textColor = Color.black;
//}


//float messageCutoff = 0;
//string messageText = "";
//private void OSDMessage( string message, float delay )
//{
// messageCutoff = Time.time + delay;
// messageText = message;
// Utils.DebugLog( messageText );
//}


//private void DisplayOSD()
//{
// if ( Time.time < messageCutoff )
// {
// GUILayout.BeginArea( new Rect( 0, ( Screen.height / 4 ), Screen.width, Screen.height / 2 ), osdLabelStyle );
// GUILayout.Label( messageText, osdLabelStyle );
// GUILayout.EndArea();
// }
//}


public void OnGUI()
{
if(_guiVisible)
{
_guiRect = GUILayout.Window( 0, _guiRect, PaintWindow, "Intake Build Aid" );
}
}


private void ToggleGUI()
{
if ( _guiVisible )
{
// hide GUI


_guiVisible = false;
Utils.DebugLog( "GUI hidden" );
}
else
{
// show GUI
_guiVisible = true;
Utils.DebugLog( "GUI shown" );
}
}


private void PaintWindow(int windowID)
{
GUILayout.BeginVertical();
GUILayout.BeginHorizontal();
if ( GUILayout.Button( "Autoarrange engines and intakes" ) )
{
BalanceIntakes();
}
if ( GUILayout.Button( "Close" ) )
{
_guiVisible = false;
}
GUILayout.EndHorizontal();
foreach ( Part engine in _editor.ship.parts.Where( x => GetPartType( x ) == PartType.AirBreatherEngine ) )
{
List<Part> intakes = FindIntakesOfEngine( engine );
GUILayout.Label( string.Format( "{0}: ∑={1}", engine.partInfo.title, intakes.Sum( x => x.Modules.OfType<ModuleResourceIntake>().First().area ) ) );
foreach ( Part intake in intakes )
{
GUILayout.BeginHorizontal();
GUILayout.Label( string.Format( " {0}: {1}", intake.partInfo.title, intake.Modules.OfType<ModuleResourceIntake>().First().area ) );
GUILayout.EndHorizontal();
}
}


foreach ( Part engine in _editor.ship.parts.Where( x => GetPartType( x ) == PartType.IntakeAndEngine ) )
{
List<Part> intakes = FindIntakesOfEngine( engine );
GUILayout.Label( string.Format( "{0}: ∑={1}", engine.partInfo.title, intakes.Sum( x => x.Modules.OfType<ModuleResourceIntake>().First().area ) + engine.Modules.OfType<ModuleResourceIntake>().First().area ) );
foreach ( Part intake in intakes )
{
GUILayout.BeginHorizontal();
GUILayout.Label( string.Format( " {0}: {1}", intake.partInfo.title, intake.Modules.OfType<ModuleResourceIntake>().First().area ) );
GUILayout.EndHorizontal();
}
}

GUILayout.EndVertical();
GUI.DragWindow();
}


#endregion GUI
}
}


If someone can advise me how to make pull requests out of a locally cloned github repo, I'd be very grateful!

Link to comment
Share on other sites

@TheDog: Wow, thanky you for doing this. Let's bump this for visibilty and hope, someone who knows how to do the github thingy sees this.

Thanks go out to TheDog and whoever gets this over to Github for release.

Link to comment
Share on other sites

Pull request has been sent to LordFjord! :)

Hope he can integrate this for a new release soon.

(this has cost be 2 hours of my life now... either I am too stupid for github, or I really need a good tutorial about forking, cloning, ....)

Link to comment
Share on other sites

You need to compile the source with a properly set up build environment (monodevelop)...

But I have an easier solution:

since my changes have not yet been picked up by LordFjord, I hereby distribute an "unofficial" re-compile for KSP 1.0.2.

Download it here. (Updated DLL only, you still need LordFjords package first, then update the DLL with my updated one)

** Once LordFjord published his own updated release this download will get pulled! **

Integrated in latest official download, please only use version from the front page.

Edited by TheDog
Link to comment
Share on other sites

Whoa, sorry, I didn't notice all the new posts here, so sorry for the delay. And I never even thought there is such a high demand for the mod.

Are you really sure that the engines do not flame out synced? Because since playing 1.0 I have built quite some SSTOs and it never happened to me. Squad stated that they adjusted the resource flow for both LF and intake air for airbreather engines. I just can't find the link now, it was either some article by Harvester or some tuesday's devnote.

@TheDog:

Cheers and thanks a lot for adapting the mod for 1.0 and the patch, I will take a look at github and try to update it (and ofc kerbalstuff as well).

Just gimme a few days, RL is currently very busy.

Link to comment
Share on other sites

Whoa, sorry, I didn't notice all the new posts here, so sorry for the delay. And I never even thought there is such a high demand for the mod.

Are you really sure that the engines do not flame out synced? Because since playing 1.0 I have built quite some SSTOs and it never happened to me. Squad stated that they adjusted the resource flow for both LF and intake air for airbreather engines. I just can't find the link now, it was either some article by Harvester or some tuesday's devnote.

@TheDog:

Cheers and thanks a lot for adapting the mod for 1.0 and the patch, I will take a look at github and try to update it (and ofc kerbalstuff as well).

Just gimme a few days, RL is currently very busy.

Thanks go out to both LordFjord and TheDog, This mod rocks. Don't think of this mod as discarded. It can be a wonderful tool for custom optimizations. It helps me assign engines to intakes pointed in a non linear manner. Not all crafts travel only in one direction. Lets think outside of the box... Regards and best wishes to you... Thanks again.

Link to comment
Share on other sites

Whoa, sorry, I didn't notice all the new posts here, so sorry for the delay. And I never even thought there is such a high demand for the mod.

Are you really sure that the engines do not flame out synced? Because since playing 1.0 I have built quite some SSTOs and it never happened to me. Squad stated that they adjusted the resource flow for both LF and intake air for airbreather engines. I just can't find the link now, it was either some article by Harvester or some tuesday's devnote.

Just gimme a few days, RL is currently very busy.

Yes, I can confirm asymmetric flame-out does still happen in 1.0.2. On a newly build orange tank SSTO lifter, 1 out of 14 rapiers would flame out when using only 1 ram intake per engine (of course it was also the most asymmetric engine).

Link to comment
Share on other sites

Since people have been doubting the relevance of this mod, I wanted to say what it means to me.

This mod is my #1 mod. Not scatterer Not engineer, this mod. Asymmetric flame outs are the biggest problem in stock for me and I am happy that there is a simple and easy to use mod that addresses them

that said the asymmetric flame outs that still occur should really be looked at.

Link to comment
Share on other sites

I merged TheDog's changes and did a few quick tests. Works still the same as in 0.90.

Updated 1st post, IBA 0.6 is now on KerbalStuff.

@landfish2

Thanks for the kind words, but this mod is nowhere near the complexity and quality of the other mods you mentioned ;)

Fjord

Edited by LordFjord
Link to comment
Share on other sites

Yes... this mod makes life so much easier when you have more than two engines. Complicated MK3 builds go so much further and more stably now :) Honestly can't believe it's not been integrated into stock, asymmetric flameout is such a massive gotcha for new players it's just not funny.

One thing I did find though; I hit the highlight key to see what was assigned to what, and couldn't un-highlight again. My plane ended up on the runway with transparent blue intakes and one red engine xD Since then I found the menu and haven't had to press any F keys, but it was an interesting phenomenon ^^

*edit* Also you've still got a link to TheDog's patch in the front page post, which is a little confusing :)

Link to comment
Share on other sites

Thanks for the hint, eddiew - note to self, don't post tired...

And you found the most annoying bug that I built into the mod and I couldn't fix it yet (unity - what? ;) ).

Just make sure you un-highlight everything before launching or the colors will stick.

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