Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | Properties | List of all members
ModuleEngines Class Reference
Inheritance diagram for ModuleEngines:
PartModule IEngineStatus IModuleInfo IResourceConsumer IThrustProvider IConstruction ModuleEnginesFX

Public Member Functions

virtual void Activate ()
 
virtual void ActivateAction (KSPActionParam param)
 
void ActivatePowerFX ()
 
void ActivateRunningFX ()
 
void AutoPlaceFXGroup (FXGroup group, Transform thruster)
 
void BurstFlameoutGroups ()
 
float CalculateThrust ()
 
virtual bool CanBeDetached ()
 Returns true if not active/producing thrust More...
 
virtual bool CanBeOffset ()
 Returns true if not active/producing thrust More...
 
virtual bool CanBeRotated ()
 Returns true if not active/producing thrust More...
 
virtual bool CheckDeprived (double requiredPropellant, out string propName)
 
virtual void DeactivateLoopingFX ()
 
virtual void DeactivatePowerFX ()
 
virtual void DeactivateRunningFX ()
 
virtual void EngineExhaustDamage ()
 
void FixedUpdate ()
 
virtual void Flameout (string message, bool statusOnly=false, bool showFX=true)
 Sets flameout true and, if the first time, plays FX. Sets status messages as appropriate. More...
 
virtual void FXReset ()
 
virtual void FXUpdate ()
 
List< PartResourceDefinitionGetConsumedResources ()
 
float GetCurrentThrust ()
 
Callback< Rect > GetDrawModulePanelCallback ()
 Return a method delegate to draw a custom panel, or null if not necessary. More...
 
float GetEngineThrust (float isp, float throttle)
 Get the Engine Thrust given the input isp and throttle More...
 
EngineType GetEngineType ()
 
float getExhaustVelocity (float isp)
 Get the Exhaust Velocity for specified isp More...
 
virtual float getFuelFlow (Propellant p, float fuelFlow)
 Get the fuel flow in units/sec for the given propellant and fuelFlow amount. fuelFlow is clamped between the Engines min ans max fuel flow settings. More...
 
override string GetInfo ()
 return a simple string for the module info. Supports rich-text syntax. More...
 
virtual float getMaxFuelFlow (Propellant p)
 Get the Maximum fuel flow in units/sec for the given propellant at Maximum flow. More...
 
float GetMaxThrust ()
 
override string GetModuleDisplayName ()
 Override this to provide a Localized version of the PartModules Name for UI components More...
 
string GetModuleTitle ()
 Return a string title for your module. More...
 
string GetPrimaryField ()
 Return a string to be displayed in the main information box on the tooltip, or null if nothing is that important to be up there. More...
 
float GetThrottlingMult (float atm, float throttle)
 Get the Throttle multiplier evaluated against the ISP Curve given the input atmosphere and throttle values. More...
 
virtual void InitializeFX ()
 
bool IsEngineDead ()
 Is an adjuster being applied that makes the Engine dead? More...
 
override bool IsStageable ()
 Should this module be counted when seeing whether to have a stack icon present? Override in a module for custom behavior; otherwise returns true if the module (or something the module inherits from above PartModule itself) overrides OnActive() More...
 
double MassFlow ()
 Get the current MassFlow requirement. More...
 
virtual float MaxThrustOutputAtm (bool runningActive=false, bool useThrustLimiter=true, float atmPressure=1f, double atmTemp=310f, double atmDensity=PhysicsGlobals.EngineDefaultAtmDensity)
 Get the Maximum Thrust Output in Atmosphere More...
 
virtual float MaxThrustOutputVac (bool useThrustLimiter=true)
 Get the Maximum Thrust Output in Vac More...
 
virtual void OnAction (KSPActionParam param)
 
override void OnActive ()
 Called when the part is set active (after unpacking etc) More...
 
override void OnAwake ()
 Method fires once the module has been added to the part. Use for first time setup. Module will not have loaded fully by this point More...
 
virtual void OnCenterOfThrustQuery (CenterOfThrustQuery qry)
 
override void OnInventoryModeDisable ()
 This method will be called when this modules part and itself is first disabled (when it is not attached to a vessel) when created in Inventory/Construction mode. More...
 
override void OnLoad (ConfigNode node)
 Use OnLoad to load any additional data from the ConfigNode provided More...
 
override void OnModuleAdjusterRemoved (AdjusterPartModuleBase adjuster)
 Perform processing specific to this part module when an adjuster is removed. More...
 
override void OnStart (PartModule.StartState state)
 
virtual void PlayEngageFX ()
 
virtual void PlayFlameoutFX (bool flamingOut)
 plays Flameout FX More...
 
virtual void PlayShutdownFX ()
 
virtual double RequestPropellant (double mass)
 
virtual void SetListener ()
 
void SetPowerGroupsActive (bool active)
 
void SetRunningGroupsActive (bool active)
 
void SetupFXGroups ()
 
void SetupPropellant ()
 
virtual void Shutdown ()
 
virtual void ShutdownAction (KSPActionParam param)
 
virtual void ToggleIncludeinDV ()
 
virtual void ToggleThrottle (KSPActionParam param)
 
virtual void UnFlameout (bool showFX=true)
 Sets flameout false and, if the first time, plays FX Hides status line 2. More...
 
virtual void UpdateThrottle ()
 
- Public Member Functions inherited from PartModule
void AddPartModuleAdjuster (AdjusterPartModuleBase newAdjuster)
 Call this to add an adjuster to this part module. More...
 
void AddPartModuleAdjusterList (List< AdjusterPartModuleBase > moduleAdjusters)
 Applies the appropriate module adjusters. Performs checks to make sure that the adjusters are valid too. More...
 
bool AppliedUpgrades ()
 Returns true if upgrades are applied More...
 
void ApplyAdjustersOnStart ()
 Called when a part module is loaded and applies all of the currently loaded adjusters. More...
 
virtual void ApplyUpgradeNode (List< string > appliedUps, ConfigNode node, bool doLoad)
 Applies the upgrades to a confignode. Will either copy the upgrades back to the node or (if doLoad) calls load/onload on it. More...
 
virtual bool ApplyUpgrades (StartState state)
 Will find and apply upgrades. Called during Part's ModulesOnStart, before a module's OnStart. More...
 
void Awake ()
 
delegate bool boolPMApplyUpgrades (PartModule pm, StartState state)
 
delegate bool boolPMBoolDelegate (PartModule pm, bool apply)
 
void ClearPersistentId ()
 Clear the modules persistentId More...
 
void Copy (PartModule fromModule)
 
virtual void DemoteToPhysicslessPart ()
 This method will be called from Part class DemoteToPhysicslessPart when the part is being converted from physical to physicsless part. It is called before the joints and rigidbodies are destroyed. More...
 
virtual bool FindUpgrades (bool fillApplied, ConfigNode node=null)
 Find applicable upgrades to the partmodule (isunlocked and isenabled) and add to the upgradesApplied list. Pass true if you want to add the upgrades to upgradesApplied, false if you just want to know if at least one upgrade is applicable (unlocked rather than enabled) More...
 
virtual Color GetCurrentColor ()
 Returns the current part module color. More...
 
virtual Color GetCurrentColor (string fieldName)
 Returns the current part module color for a field where usespe. More...
 
uint GetPersistenActiontId ()
 Get the modules persistentID, and create one if it doesnt already have one More...
 
uint GetPersistentId ()
 Get the modules persistentID, and create one if it doesnt already have one More...
 
virtual string GetStagingDisableText ()
 
virtual string GetStagingEnableText ()
 
virtual string GetUpgradeInfo ()
 Called by Upgrade Stats dialog More...
 
bool HasUpgrades ()
 Returns true if upgrades exist for the partmodule More...
 
bool IsValidContractObjective (string objectiveType)
 Returns if, for example, an antenna part module qualifies as an antenna for contracts. More...
 
void Load (ConfigNode node)
 
virtual void LoadUpgrades (ConfigNode node)
 Loads module-relevant upgrades from the partmodule confignode More...
 
uint NewPersistentId ()
 Reset the modules persistentId to a new number More...
 
virtual void OnColorChanged (Color color)
 Meant to be overwritten by part modules implementing color changes. In this case, it doesn't matter which color picker changed specifically. More...
 
virtual void OnColorChanged (Color color, string pickerID="")
 Meant to be overwritten by part modules implementing color changes More...
 
virtual void OnConstructionModeFixedUpdate ()
 This method will be called when in EVA Construction mode and this part and itself is disabled (when it is not attached to a vessel) every FixedUpdate(). More...
 
virtual void OnConstructionModeUpdate ()
 This method will be called when in EVA Construction mode and this part and itself is disabled (when it is not attached to a vessel) every Update(). More...
 
virtual void OnCopy (PartModule fromModule)
 Use OnCopy to copy any additional data from the PartModule provided More...
 
virtual void OnFixedUpdate ()
 Called every physics/fixed frame that the part is active More...
 
virtual void OnIconCreate ()
 Method fires just before components are stripped from the gameobject to make it an icon. (The part is instantiated and then various components like Part, PartModule, EffectBehaviour, Colliders, Particles, etc are stripped and then it's set as the icon prefab. This lets PartModules do stuff to the model right before that happens. More...
 
virtual void OnInactive ()
 Called before the part goes inactive (after packing etc) More...
 
virtual void OnInitialize ()
 Called on all modules after all parts are loaded but before they give the ship to the game More...
 
virtual void OnInventoryModeEnable ()
 This method will be called when this modules part and itself is first enabled (when it is attached to a vessel) when created in Inventory/Construction mode. More...
 
void OnModuleAdjusterAddedWrapper (AdjusterPartModuleBase adjuster)
 Wrapper to check the mission expansion availability before performing processing specific to this part module when an adjuster is added. More...
 
virtual void OnPartCreatedFomInventory (ModuleInventoryPart moduleInventoryPart)
 This method is called when a part is being taken out from a slot while being in EVAConstruction mode. More...
 
virtual void OnSave (ConfigNode node)
 Use OnSave to serialize additional module information into the ConfigNode provided More...
 
virtual void OnStart (StartState state)
 Called when the part starts. The StartState gives an indication of where in flight you are. All values may not be plugged in! More...
 
virtual void OnStartBeforePartAttachJoint (StartState state)
 Called in flight scene in Part.Start just before the Part attachnode joints are created. More...
 
virtual void OnStartFinished (StartState state)
 Called when the part finishes starting. The StartState gives an indication of where in flight you are. All values may not be plugged in! More...
 
virtual void OnStoredInInventory (ModuleInventoryPart moduleInventoryPart)
 Called when the part is stored in an inventory. More...
 
virtual void OnUpdate ()
 Called every frame that the part is active More...
 
virtual void OnWasCopied (PartModule copyPartModule, bool asSymCounterpart)
 Called when the PartModule was copied, through Alt+Copy or symmetry More...
 
virtual void OnWillBeCopied (bool asSymCounterpart)
 Called when the PartModule is about to be copied, through Alt+Copy or symmetry More...
 
virtual bool OnWillBeMirrored (ref Quaternion rotation, AttachNode selPartNode, Part partParent)
 This is called in the Editor scene when a symmetry copy of a part is being positioned. Only called on the symmetry parts and only when symmetry mode is set to Mirror. It allows the mirror rotation to be changed and returned before being applied to the symmetry copy part.

Parameters
rotationThe current calculated rotation. Will be updated if method returns true.
selPartNodeThe attachnode.
partParentThe part that will become this part's parent.
Returns
True if the rotation was changed. Otherwise will return false.
More...
 
virtual List< Color > PresetColors ()
 Preset colors received for any part module. By default, returns only black, override to make your own selection. More...
 
virtual string PrintUpgrades ()
 
virtual void PromoteToPhysicalPart ()
 This method will be called from Part class PromoteToPhysicalPart when the part is being converted from physicsless to physical part. More...
 
void RemovePartModuleAdjuster (AdjusterPartModuleBase oldAdjuster)
 Call this to remove an adjuster from this part module. More...
 
void RemovePartModuleAdjusterList (List< AdjusterPartModuleBase > moduleAdjusters)
 Removes the appropriate module adjusters. Performs checks to make sure that the adjusters are valid too. More...
 
void Save (ConfigNode node)
 
virtual void SetStaging (bool newValue)
 Run by the part's staging toggle handler, sets staging on modules on symmetry counterparts. More...
 
void SetStagingState (bool newState)
 Set the staging enabled bool for this module. More...
 
virtual bool StagingEnabled ()
 Gets current staging status (is staging enabled for this module) Override me! More...
 
virtual bool StagingToggleEnabledEditor ()
 
virtual bool StagingToggleEnabledFlight ()
 
void ToggleStaging ()
 
virtual void UpdateStagingToggle ()
 Updates the staging toggle More...
 
delegate void voidPMApplyNodeDelegate (PartModule pm, List< string > appliedUps, ConfigNode node, bool doLoad)
 
delegate void voidPMDelegate (PartModule pm)
 
delegate void voidPMNodeDelegate (PartModule pm, ConfigNode node)
 

Public Attributes

bool allowRestart = true
 By default allow restart. More...
 
bool allowShutdown = true
 By default allow shutdown. More...
 
bool atmChangeFlow = false
 Atmospheric density will change fuel flow (and thus thrust) More...
 
FloatCurve atmCurve = new FloatCurve()
 Normally thrust is proportional to density, but we allow tuning. Tuning is especially needed because there's no stratosphere, so temperature keeps decreasing and thus speed of sound keeps decreasing. More...
 
FloatCurve atmCurveIsp = new FloatCurve()
 Same as atmCurve, but changes Isp not flow More...
 
FloatCurve atmosphereCurve
 a curve to determine loss or gain of thrust due to changes in atmosphere vs vacuum values are based on ISP to ATM Pressure More...
 
bool autoPositionFX = false
 
float CLAMP = 1e-5f
 tunable clamp. The flow multiplier will never go below this. More...
 
bool clampPropReceived = false
 do we clamp the return percent to the min ratio (and never request more on followups) or do we request all always, and average? More...
 
double clampPropReceivedMinLowerAmount = 0.999d
 
float currentThrottle
 
bool disableUnderwater = false
 Temp and module values. More...
 
float engineAccelerationSpeed = 0.2f
 
float engineDecelerationSpeed = 0.1f
 
string engineID = "Engine"
 
bool EngineIgnited = false
 
bool engineShutdown = false
 
EngineType engineType = EngineType.Generic
 
bool exhaustDamage = true
 
double exhaustDamageDistanceOffset = 0d
 
double exhaustDamageFalloffPower = 1d
 
bool exhaustDamageLogEvent = false
 
double exhaustDamageMaxMutliplier = 100d
 
float exhaustDamageMaxRange = 10f
 
double exhaustDamageMultiplier = 165d
 
double exhaustDamageSplashbackFallofPower = 2.5d
 
double exhaustDamageSplashbackMaxMutliplier = 1d
 
double exhaustDamageSplashbackMult = 0.0d
 
bool exhaustSplashbackDamage = true
 
float finalThrust
 
bool flameout = false
 
float flameoutBar = 0.07f
 When the flow multiplier goes below this, we "flameout" the engine. NOTE: THIS FIXES ASYMMETRIC FLAMEOUTS. More...
 
FXGroup flameoutGroup
 
float flowMultCap = float.MaxValue
 cap beyond which increases to flow multiplier aren't fully felt (start to taper off) More...
 
float flowMultCapSharpness = 2f
 Sharpness of the tapering off of flow increase beyond cap More...
 
float flowMultiplier = 1f
 
float fuelFlowGui
 Used to display fuel flow to the UI Look into better ways of displaying this perhaps. More...
 
string fxGroupPrefix = "thruster_"
 
Vector3 fxOffset = Vector3.zero
 
float g = 9.80665f
 
float heatProduction = 370f
 KSp fields! More...
 
float ignitionThreshold = 0.1f
 
bool includeinDVCalcs = false
 Only used/available in the Part Action Window if nonThrustMotor is true. Set to true will include this motor in the Delta-v calcs. More...
 
bool independentThrottle = false
 Should the main throttle be overridable by an axis More...
 
float independentThrottlePercentage = 0f
 If the throttle is overrideable, this is the throttle control More...
 
float machHeatMult = 1f
 heat multiplier for "over-mach" heat More...
 
float machLimit = float.MaxValue
 Thermal limit, in Mach, for the engine. Defaults to VERYHIGH. This is not when the engine blows up, but merely when it starts generating more heat than 'usual'. More...
 
bool manuallyOverridden = false
 
float maxFuelFlow = 20f
 
float maxThrust = 215f
 
float minFuelFlow = 0f
 
float minThrust = 0f
 
float mixtureDensity
 What is the density of the mixture. More...
 
double mixtureDensityRecip
 
float multFlow = 1f
 Multiplier to final flow as calculated More...
 
float multIsp = 1f
 Multiplier to final Isp as calculated More...
 
bool nonThrustMotor = false
 set true to tag this motor as one that can be excluded from delta-V calculations. use for things like separation motors that aren't used for thrusting the rocket More...
 
bool normalizeHeatForFlow = true
 Do we divide the heat produced by the flow multiplier to get the final flux? I.e. do we always produce the same heat for the same throttle setting? More...
 
AudioSource powerSfx
 
float propellantReqMet
 How much of our requirement was met. Starts hidden, shown on activate. More...
 
List< Propellantpropellants
 
double ratioSum
 
float realIsp = 0.0f
 
float requestedMassFlow = 0f
 
float requestedThrottle = 0f
 
float resultingThrust = 0f
 
List< FXGrouprunningGroups
 
bool shieldedCanActivate = true
 
bool staged = false
 
string status = "Nominal"
 
string statusL2 = " "
 
float throttleIgniteLevelMult = 1f
 
bool throttleInstant = false
 
bool throttleInstantShutdown = true
 
FloatCurve throttleIspCurve = new FloatCurve()
 Modifies Isp based on throttle. time is throttle, value is multiplier to Isp More...
 
FloatCurve throttleIspCurveAtmStrength = new FloatCurve()
 Modifies Isp based on throttle. time is pressure in atm, value is how much throttling affects Isp (i.e. Isp = input * Lerp(1, throttleIspCurve, throttleIspCurveAtmStrength) More...
 
bool throttleLocked = false
 
float throttleMin = 0f
 
float throttleResponseRate = -1f
 
float throttleShutdownMult = 100f
 
float throttleStartedMult = 1f
 
float throttleStartupMult = 1f
 
bool throttleUseAlternate = false
 
double throttlingBaseClamp = 1.1d
 
double throttlingBaseDivisor = 0.2d
 Thrust Vector. More...
 
double throttlingBaseRate = 10d
 
FloatCurve thrustCurve = new FloatCurve()
 The curve to use More...
 
float thrustCurveDisplay = 1f
 
float thrustCurveRatio = 1f
 
float thrustPercentage = 100f
 
List< float > thrustTransformMultipliers
 Gui Fields. More...
 
List< Transform > thrustTransforms
 
string thrustVectorTransformName = "thrustTransform"
 
bool useAtmCurve = false
 Do we use the atm curve? If not, and atmChangeFlow is true, just use atm linearly. More...
 
bool useAtmCurveIsp = false
 
bool useEngineResponseTime = false
 
bool useThrottleIspCurve = false
 
bool useThrustCurve = false
 should we use a thrust curve (based on resource remaining) ? More...
 
bool useVelCurve = false
 If false, we don't use the new velCurve. More...
 
bool useVelCurveIsp = false
 
FloatCurve velCurve = new FloatCurve()
 replacement for the existing module's velocityCurve. Note that its x value is Mach, not m/s velocity. High-bypass turbofans will see thrust decrease steadily from static. Low-bypass turbofans and turbojets will see thrust decrease slightly up to about 0.2 Mach then increase steadily until the limit is reached (both in terms of heat, and incoming compression vs compressor compression). Ramjets have 0 static thrust, and do not light until 0.3 Mach or so, but once lit have steadily increasing thrust until Mach 5, when the incoming air can no longer be slowed to subsonic (combustion must be subsonic for ramjets). Thermal limits also apply, of course. For heat limits, see machLimit, below. More...
 
FloatCurve velCurveIsp = new FloatCurve()
 Same as velCurve but changes Isp not flow More...
 
- Public Attributes inherited from PartModule
bool isEnabled = true
 
bool moduleIsEnabled = true
 
string moduleName
 
bool overrideStagingIconIfBlank = true
 
ModuleResourceHandler resHandler = new ModuleResourceHandler()
 
bool showUpgradesInModuleInfo = false
 
ProtoPartModuleSnapshot snapshot
 
string stagingDisableText = ""
 
bool stagingEnabled = true
 
string stagingEnableText = ""
 
bool stagingToggleEnabledEditor = false
 
bool stagingToggleEnabledFlight = false
 
List< ConfigNodeupgrades
 
List< string > upgradesApplied = new List<string>()
 
bool upgradesApply = true
 
bool upgradesAsk = true
 

Protected Member Functions

bool CheckTransformsUnderwater ()
 
virtual string GetInfoThrust (bool mainInfoWindow)
 
void HijackFX (FXGroup group, string groupName)
 
virtual float ModifyFlow ()
 Returns a multiplier to fuel flow (and thus thrust). Will only do so if atmChangeFlow is true (in which case flow is modified by atmsopheric density, either linearly or via a curve, that's toggled by useAtmCurve) and/or if useVelCurve is true, in which case it's modified by mach finally, it's clamped to CLAMP so it never quite goes to 0. If neither situation obtains, we just return 1.0. More...
 
override void OnModuleAdjusterAdded (AdjusterPartModuleBase adjuster)
 Perform processing specific to this part module when an adjuster is added. More...
 
double RequiredPropellantMass (float throttleAmount)
 
void throttleModeChanged (object obj)
 
void ThrustUpdate ()
 
bool TimeWarping ()
 
void UpdatePropellantGauge (Propellant p)
 
void UpdatePropellantStatus (bool doGauge=true)
 
- Protected Member Functions inherited from PartModule
ConfigNode GetUpgrade (string name)
 
virtual void LoadUpgradesApplied (List< string > applieds, ConfigNode node)
 Load the applied upgrade names More...
 
virtual void SaveUpgradesApplied (ConfigNode node)
 Save the applied upgrades. More...
 
IEnumerator UpgradeWaitForScenarioModules ()
 

Protected Attributes

List< PartResourceDefinitionconsumedResources
 
RaycastHit hit
 
double massFlow = 0f
 
Dictionary< Propellant,
KSP.UI.Screens.ProtoStageIconInfo
PropellantGauges
 
BaseField statusL2Field
 

Static Protected Attributes

static int damageLayerMask
 
- Static Protected Attributes inherited from PartModule
static Dictionary< string,
ConfigNode
exclusives = new Dictionary<string, ConfigNode>()
 
static Dictionary< Type,
ReflectedAttributes
reflectedAttributeCache = new Dictionary<Type, ReflectedAttributes>()
 

Properties

string engineName [get]
 
bool getFlameoutState [get]
 
bool getIgnitionState [get]
 
bool isOperational [get]
 
float normalizedOutput [get]
 
float normalizedThrustOutput [get]
 
float throttleSetting [get]
 
- Properties inherited from PartModule
BaseActionList Actions [get]
 
int ClassID [get]
 
string ClassName [get]
 
List< AdjusterPartModuleBaseCurrentModuleAdjusterList [get]
 List of all the module adjusters that are currently active on this part module. More...
 
BaseEventList Events [get]
 
BaseFieldList Fields [get]
 
string GUIName [get]
 
bool HasAdjusters [get]
 Has this part module been adjusted? More...
 
ReflectedAttributes ModuleAttributes [get, set]
 
Part part [get, set]
 
uint PersistentActionsId [get, set]
 A unique identifier for each vessel including from when it was Shipconstruct More...
 
uint PersistentId [get]
 A unique identifier for each vessel including from when it was Shipconstruct More...
 
Vessel vessel [get]
 
- Properties inherited from IEngineStatus
string engineName [get]
 
bool isOperational [get]
 
float normalizedOutput [get]
 
float throttleSetting [get]
 

Additional Inherited Members

- Public Types inherited from PartModule
enum  PartUpgradeState { PartUpgradeState.NONE, PartUpgradeState.LOCKED, PartUpgradeState.AVAILABLE }
 
enum  StartState {
  StartState.None = 0, StartState.Editor = 1, StartState.PreLaunch = 2, StartState.Landed = 4,
  StartState.Docked = 8, StartState.Flying = 16, StartState.Splashed = 32, StartState.SubOrbital = 64,
  StartState.Orbital = 128
}
 
- Static Public Member Functions inherited from PartModule
static ReflectedAttributes GetReflectedAttributes (Type partModuleType)
 
static PartUpgradeState UpgradesAvailable (Part part)
 Returns true if at least one module on the part has at least one upgrade available (isUnlocked) More...
 
static PartUpgradeState UpgradesAvailable (Part part, ConfigNode node)
 Returns true if at least one module on the part has at least one upgrade available (isUnlocked) More...
 
- Static Public Attributes inherited from PartModule
static voidPMApplyNodeDelegate ApplyUpgradeNodeDel
 
static boolPMApplyUpgrades ApplyUpgradesDel
 
static bool ApplyUpgradesEditorAuto = true
 
static boolPMBoolDelegate FindUpgradesDel
 
static voidPMNodeDelegate LoadExpansionNodes
 Hook for loading extra nodes common to all part modules. More...
 
static voidPMNodeDelegate LoadUpgradesDel
 
static voidPMNodeDelegate SaveExpansionNodes
 Hook for saving extra nodes common to all part modules. More...
 
static voidPMDelegate SetupExpansion
 Hook for performing extra setup common to all part modules. More...
 
static string UpgradesAvailableString = "#autoLOC_6002273"
 
static string UpgradesLockedString = "#autoLOC_6002274"
 

Member Function Documentation

virtual void ModuleEngines.Activate ( )
inlinevirtual

< If the engines were shutdown previously and restarting is not allowed, prevent restart of engines

< activate any gimbals on this part.

virtual void ModuleEngines.ActivateAction ( KSPActionParam  param)
inlinevirtual
void ModuleEngines.ActivatePowerFX ( )
inline
void ModuleEngines.ActivateRunningFX ( )
inline
void ModuleEngines.AutoPlaceFXGroup ( FXGroup  group,
Transform  thruster 
)
inline
void ModuleEngines.BurstFlameoutGroups ( )
inline
float ModuleEngines.CalculateThrust ( )
inline

< Check if flow multiplier is too low, if so flameout.

< Request a mass of propellant and see what percentage of that was returned

< Multipy the thrust by the normalized amount of propellant we recieved

< Display the fuel flow to gui

virtual bool ModuleEngines.CanBeDetached ( )
inlinevirtual

Returns true if not active/producing thrust

Returns

Implements IConstruction.

virtual bool ModuleEngines.CanBeOffset ( )
inlinevirtual

Returns true if not active/producing thrust

Returns

Implements IConstruction.

virtual bool ModuleEngines.CanBeRotated ( )
inlinevirtual

Returns true if not active/producing thrust

Returns

Implements IConstruction.

virtual bool ModuleEngines.CheckDeprived ( double  requiredPropellant,
out string  propName 
)
inlinevirtual

< Get how much fuel we need for this request

bool ModuleEngines.CheckTransformsUnderwater ( )
inlineprotected
virtual void ModuleEngines.DeactivateLoopingFX ( )
inlinevirtual

Reimplemented in ModuleEnginesFX.

virtual void ModuleEngines.DeactivatePowerFX ( )
inlinevirtual

Reimplemented in ModuleEnginesFX.

virtual void ModuleEngines.DeactivateRunningFX ( )
inlinevirtual

Reimplemented in ModuleEnginesFX.

virtual void ModuleEngines.EngineExhaustDamage ( )
inlinevirtual

< roughly 1 watt/Newton base, times the multiplier

void ModuleEngines.FixedUpdate ( )
inline

< Update the condition of the propellants.

virtual void ModuleEngines.Flameout ( string  message,
bool  statusOnly = false,
bool  showFX = true 
)
inlinevirtual

Sets flameout true and, if the first time, plays FX. Sets status messages as appropriate.

Parameters
messageThe message to display
statusOnlyFor use in ModuleEnginesFX.CanStart()
virtual void ModuleEngines.FXReset ( )
inlinevirtual

Reimplemented in ModuleEnginesFX.

virtual void ModuleEngines.FXUpdate ( )
inlinevirtual

Reimplemented in ModuleEnginesFX.

List<PartResourceDefinition> ModuleEngines.GetConsumedResources ( )
inline

Implements IResourceConsumer.

float ModuleEngines.GetCurrentThrust ( )
inline

Implements IThrustProvider.

Callback<Rect> ModuleEngines.GetDrawModulePanelCallback ( )
inline

Return a method delegate to draw a custom panel, or null if not necessary.

Parameters
rect

Implements IModuleInfo.

float ModuleEngines.GetEngineThrust ( float  isp,
float  throttle 
)
inline

Get the Engine Thrust given the input isp and throttle

Parameters
isp
throttle
Returns
EngineType ModuleEngines.GetEngineType ( )
inline

Implements IThrustProvider.

float ModuleEngines.getExhaustVelocity ( float  isp)
inline

Get the Exhaust Velocity for specified isp

Parameters
isp
Returns
virtual float ModuleEngines.getFuelFlow ( Propellant  p,
float  fuelFlow 
)
inlinevirtual

Get the fuel flow in units/sec for the given propellant and fuelFlow amount. fuelFlow is clamped between the Engines min ans max fuel flow settings.

Parameters
p
fuelFlow
Returns
override string ModuleEngines.GetInfo ( )
inline

return a simple string for the module info. Supports rich-text syntax.

Returns

Implements IModuleInfo.

virtual string ModuleEngines.GetInfoThrust ( bool  mainInfoWindow)
inlineprotectedvirtual

< get the max mult, and thus report maximum thrust possible.

virtual float ModuleEngines.getMaxFuelFlow ( Propellant  p)
inlinevirtual

Get the Maximum fuel flow in units/sec for the given propellant at Maximum flow.

Parameters
p
Returns
float ModuleEngines.GetMaxThrust ( )
inline

Implements IThrustProvider.

override string ModuleEngines.GetModuleDisplayName ( )
inlinevirtual

Override this to provide a Localized version of the PartModules Name for UI components

Returns

Reimplemented from PartModule.

string ModuleEngines.GetModuleTitle ( )
inline

Return a string title for your module.

Returns

Implements IModuleInfo.

string ModuleEngines.GetPrimaryField ( )
inline

Return a string to be displayed in the main information box on the tooltip, or null if nothing is that important to be up there.

Returns

< report static thrust

Implements IModuleInfo.

float ModuleEngines.GetThrottlingMult ( float  atm,
float  throttle 
)
inline

Get the Throttle multiplier evaluated against the ISP Curve given the input atmosphere and throttle values.

Parameters
atm
throttle
Returns
void ModuleEngines.HijackFX ( FXGroup  group,
string  groupName 
)
inlineprotected
virtual void ModuleEngines.InitializeFX ( )
inlinevirtual

Reimplemented in ModuleEnginesFX.

bool ModuleEngines.IsEngineDead ( )
inline

Is an adjuster being applied that makes the Engine dead?

Returns
override bool ModuleEngines.IsStageable ( )
inlinevirtual

Should this module be counted when seeing whether to have a stack icon present? Override in a module for custom behavior; otherwise returns true if the module (or something the module inherits from above PartModule itself) overrides OnActive()

Reimplemented from PartModule.

double ModuleEngines.MassFlow ( )
inline

Get the current MassFlow requirement.

Returns
virtual float ModuleEngines.MaxThrustOutputAtm ( bool  runningActive = false,
bool  useThrustLimiter = true,
float  atmPressure = 1f,
double  atmTemp = 310f,
double  atmDensity = PhysicsGlobals.EngineDefaultAtmDensity 
)
inlinevirtual

Get the Maximum Thrust Output in Atmosphere

Parameters
runningActiveSet to true if wanting actual thrust from an active vessel in flight
useThrustLimiterSet to false to ignore thrust limiter setting.
atmPressureThe atmospheric pressure. Default = 1f - at sea level
atmTempSet to the atmospheric temperature. Default = 310f (temp at KSC on Kerbin)
atmDensitySet to the atmospheric density. Default = 1.225f PhysicsGlobals.EngineDefaultAtmDensity (sea level on Kerbin) currentMainBody.GetFullTemperature(altitude, atmosphereTemperatureOffset) - pass in for real vessel atmTemp = vessel.atmosphericTemperature part.atmDensity - pass in for real density
Returns

< First get density (normalized to 1.0 = sea level)

virtual float ModuleEngines.MaxThrustOutputVac ( bool  useThrustLimiter = true)
inlinevirtual

Get the Maximum Thrust Output in Vac

Parameters
useThrustLimiterSet to false to ignore thrust limiter setting.
Returns
virtual float ModuleEngines.ModifyFlow ( )
inlineprotectedvirtual

Returns a multiplier to fuel flow (and thus thrust). Will only do so if atmChangeFlow is true (in which case flow is modified by atmsopheric density, either linearly or via a curve, that's toggled by useAtmCurve) and/or if useVelCurve is true, in which case it's modified by mach finally, it's clamped to CLAMP so it never quite goes to 0. If neither situation obtains, we just return 1.0.

Returns
fuel flow multiplier

< First get density (normalized to 1.0 = sea level)

virtual void ModuleEngines.OnAction ( KSPActionParam  param)
inlinevirtual
override void ModuleEngines.OnActive ( )
inlinevirtual

Called when the part is set active (after unpacking etc)

Reimplemented from PartModule.

override void ModuleEngines.OnAwake ( )
inlinevirtual

Method fires once the module has been added to the part. Use for first time setup. Module will not have loaded fully by this point

Reimplemented from PartModule.

Reimplemented in ModuleEnginesFX.

virtual void ModuleEngines.OnCenterOfThrustQuery ( CenterOfThrustQuery  qry)
inlinevirtual

Implements IThrustProvider.

override void ModuleEngines.OnInventoryModeDisable ( )
inlinevirtual

This method will be called when this modules part and itself is first disabled (when it is not attached to a vessel) when created in Inventory/Construction mode.

Reimplemented from PartModule.

override void ModuleEngines.OnLoad ( ConfigNode  node)
inlinevirtual

Use OnLoad to load any additional data from the ConfigNode provided

Parameters
node

< are we overriding the portion of thrust per transform?

< to catch the case where the last is left unspecified

Reimplemented from PartModule.

override void ModuleEngines.OnModuleAdjusterAdded ( AdjusterPartModuleBase  adjuster)
inlineprotectedvirtual

Perform processing specific to this part module when an adjuster is added.

Parameters
adjusterAdjuster which will be applied to part module.

Reimplemented from PartModule.

override void ModuleEngines.OnModuleAdjusterRemoved ( AdjusterPartModuleBase  adjuster)
inlinevirtual

Perform processing specific to this part module when an adjuster is removed.

Parameters
adjusterAdjuster which is being removed from part module.

Reimplemented from PartModule.

override void ModuleEngines.OnStart ( PartModule.StartState  state)
inline
virtual void ModuleEngines.PlayEngageFX ( )
inlinevirtual

Reimplemented in ModuleEnginesFX.

virtual void ModuleEngines.PlayFlameoutFX ( bool  flamingOut)
inlinevirtual

plays Flameout FX

Parameters
flamingOutuse True if flaming out, false if un-flaming-out

Reimplemented in ModuleEnginesFX.

virtual void ModuleEngines.PlayShutdownFX ( )
inlinevirtual

Reimplemented in ModuleEnginesFX.

virtual double ModuleEngines.RequestPropellant ( double  mass)
inlinevirtual

< How many units of propellant do we need to get our mass

< not requesting any propellant, so just return 0

< How much fuel did we get?

< How much fuel did we get?

< Store propellant fractions recieved for final normalization of thrust

< From 0 to 1, how much of our request did we get.

double ModuleEngines.RequiredPropellantMass ( float  throttleAmount)
inlineprotected

< Apply flow (i.e. atm/vel) multipliers

virtual void ModuleEngines.SetListener ( )
inlinevirtual

Reimplemented in ModuleEnginesFX.

void ModuleEngines.SetPowerGroupsActive ( bool  active)
inline
void ModuleEngines.SetRunningGroupsActive ( bool  active)
inline
void ModuleEngines.SetupFXGroups ( )
inline
void ModuleEngines.SetupPropellant ( )
inline

< Debug.Log("Propellant ID: " + p.id);

virtual void ModuleEngines.Shutdown ( )
inlinevirtual

< If engine cannot be shutdown. Ignore the event.

virtual void ModuleEngines.ShutdownAction ( KSPActionParam  param)
inlinevirtual
void ModuleEngines.throttleModeChanged ( object  obj)
inlineprotected
void ModuleEngines.ThrustUpdate ( )
inlineprotected

< Get the amount of actual thrust the engines are producing

< calculate heat multiplier, starting at 1.0

< No fuel is flowing, zero out gui values

bool ModuleEngines.TimeWarping ( )
inlineprotected

< Prevent engines from operating if in high warp. Seems to happen with super low thrust engines, that are below accel detection threshold (Ion Engines)

virtual void ModuleEngines.ToggleIncludeinDV ( )
inlinevirtual
virtual void ModuleEngines.ToggleThrottle ( KSPActionParam  param)
inlinevirtual
virtual void ModuleEngines.UnFlameout ( bool  showFX = true)
inlinevirtual

Sets flameout false and, if the first time, plays FX Hides status line 2.

void ModuleEngines.UpdatePropellantGauge ( Propellant  p)
inlineprotected
void ModuleEngines.UpdatePropellantStatus ( bool  doGauge = true)
inlineprotected

< Update Connected Resources first, or they'll be off a frame on the guages

< Update the propellant guages after the connected resources

virtual void ModuleEngines.UpdateThrottle ( )
inlinevirtual

< This yields F-1 like curves where F-1 responserate is about 1.

Member Data Documentation

bool ModuleEngines.allowRestart = true

By default allow restart.

bool ModuleEngines.allowShutdown = true

By default allow shutdown.

bool ModuleEngines.atmChangeFlow = false

Atmospheric density will change fuel flow (and thus thrust)

FloatCurve ModuleEngines.atmCurve = new FloatCurve()

Normally thrust is proportional to density, but we allow tuning. Tuning is especially needed because there's no stratosphere, so temperature keeps decreasing and thus speed of sound keeps decreasing.

FloatCurve ModuleEngines.atmCurveIsp = new FloatCurve()

Same as atmCurve, but changes Isp not flow

FloatCurve ModuleEngines.atmosphereCurve

a curve to determine loss or gain of thrust due to changes in atmosphere vs vacuum values are based on ISP to ATM Pressure

bool ModuleEngines.autoPositionFX = false
float ModuleEngines.CLAMP = 1e-5f

tunable clamp. The flow multiplier will never go below this.

bool ModuleEngines.clampPropReceived = false

do we clamp the return percent to the min ratio (and never request more on followups) or do we request all always, and average?

double ModuleEngines.clampPropReceivedMinLowerAmount = 0.999d
List<PartResourceDefinition> ModuleEngines.consumedResources
protected
float ModuleEngines.currentThrottle
int ModuleEngines.damageLayerMask
staticprotected
bool ModuleEngines.disableUnderwater = false

Temp and module values.

float ModuleEngines.engineAccelerationSpeed = 0.2f
float ModuleEngines.engineDecelerationSpeed = 0.1f
string ModuleEngines.engineID = "Engine"
bool ModuleEngines.EngineIgnited = false
bool ModuleEngines.engineShutdown = false
EngineType ModuleEngines.engineType = EngineType.Generic
bool ModuleEngines.exhaustDamage = true
double ModuleEngines.exhaustDamageDistanceOffset = 0d
double ModuleEngines.exhaustDamageFalloffPower = 1d
bool ModuleEngines.exhaustDamageLogEvent = false
double ModuleEngines.exhaustDamageMaxMutliplier = 100d
float ModuleEngines.exhaustDamageMaxRange = 10f
double ModuleEngines.exhaustDamageMultiplier = 165d
double ModuleEngines.exhaustDamageSplashbackFallofPower = 2.5d
double ModuleEngines.exhaustDamageSplashbackMaxMutliplier = 1d
double ModuleEngines.exhaustDamageSplashbackMult = 0.0d
bool ModuleEngines.exhaustSplashbackDamage = true
float ModuleEngines.finalThrust
bool ModuleEngines.flameout = false
float ModuleEngines.flameoutBar = 0.07f

When the flow multiplier goes below this, we "flameout" the engine. NOTE: THIS FIXES ASYMMETRIC FLAMEOUTS.

FXGroup ModuleEngines.flameoutGroup
float ModuleEngines.flowMultCap = float.MaxValue

cap beyond which increases to flow multiplier aren't fully felt (start to taper off)

float ModuleEngines.flowMultCapSharpness = 2f

Sharpness of the tapering off of flow increase beyond cap

float ModuleEngines.flowMultiplier = 1f
float ModuleEngines.fuelFlowGui

Used to display fuel flow to the UI Look into better ways of displaying this perhaps.

string ModuleEngines.fxGroupPrefix = "thruster_"
Vector3 ModuleEngines.fxOffset = Vector3.zero
float ModuleEngines.g = 9.80665f
float ModuleEngines.heatProduction = 370f

KSp fields!

RaycastHit ModuleEngines.hit
protected
float ModuleEngines.ignitionThreshold = 0.1f
bool ModuleEngines.includeinDVCalcs = false

Only used/available in the Part Action Window if nonThrustMotor is true. Set to true will include this motor in the Delta-v calcs.

bool ModuleEngines.independentThrottle = false

Should the main throttle be overridable by an axis

float ModuleEngines.independentThrottlePercentage = 0f

If the throttle is overrideable, this is the throttle control

float ModuleEngines.machHeatMult = 1f

heat multiplier for "over-mach" heat

float ModuleEngines.machLimit = float.MaxValue

Thermal limit, in Mach, for the engine. Defaults to VERYHIGH. This is not when the engine blows up, but merely when it starts generating more heat than 'usual'.

bool ModuleEngines.manuallyOverridden = false
double ModuleEngines.massFlow = 0f
protected
float ModuleEngines.maxFuelFlow = 20f
float ModuleEngines.maxThrust = 215f
float ModuleEngines.minFuelFlow = 0f
float ModuleEngines.minThrust = 0f
float ModuleEngines.mixtureDensity

What is the density of the mixture.

double ModuleEngines.mixtureDensityRecip
float ModuleEngines.multFlow = 1f

Multiplier to final flow as calculated

float ModuleEngines.multIsp = 1f

Multiplier to final Isp as calculated

bool ModuleEngines.nonThrustMotor = false

set true to tag this motor as one that can be excluded from delta-V calculations. use for things like separation motors that aren't used for thrusting the rocket

bool ModuleEngines.normalizeHeatForFlow = true

Do we divide the heat produced by the flow multiplier to get the final flux? I.e. do we always produce the same heat for the same throttle setting?

AudioSource ModuleEngines.powerSfx
Dictionary<Propellant, KSP.UI.Screens.ProtoStageIconInfo> ModuleEngines.PropellantGauges
protected
float ModuleEngines.propellantReqMet

How much of our requirement was met. Starts hidden, shown on activate.

List<Propellant> ModuleEngines.propellants
double ModuleEngines.ratioSum
float ModuleEngines.realIsp = 0.0f
float ModuleEngines.requestedMassFlow = 0f
float ModuleEngines.requestedThrottle = 0f
float ModuleEngines.resultingThrust = 0f
List<FXGroup> ModuleEngines.runningGroups
bool ModuleEngines.shieldedCanActivate = true
bool ModuleEngines.staged = false
string ModuleEngines.status = "Nominal"
string ModuleEngines.statusL2 = " "
BaseField ModuleEngines.statusL2Field
protected
float ModuleEngines.throttleIgniteLevelMult = 1f
bool ModuleEngines.throttleInstant = false
bool ModuleEngines.throttleInstantShutdown = true
FloatCurve ModuleEngines.throttleIspCurve = new FloatCurve()

Modifies Isp based on throttle. time is throttle, value is multiplier to Isp

tracking fields for it (default non-displaying)

FloatCurve ModuleEngines.throttleIspCurveAtmStrength = new FloatCurve()

Modifies Isp based on throttle. time is pressure in atm, value is how much throttling affects Isp (i.e. Isp = input * Lerp(1, throttleIspCurve, throttleIspCurveAtmStrength)

bool ModuleEngines.throttleLocked = false
float ModuleEngines.throttleMin = 0f
float ModuleEngines.throttleResponseRate = -1f
float ModuleEngines.throttleShutdownMult = 100f
float ModuleEngines.throttleStartedMult = 1f
float ModuleEngines.throttleStartupMult = 1f
bool ModuleEngines.throttleUseAlternate = false
double ModuleEngines.throttlingBaseClamp = 1.1d
double ModuleEngines.throttlingBaseDivisor = 0.2d

Thrust Vector.

double ModuleEngines.throttlingBaseRate = 10d
FloatCurve ModuleEngines.thrustCurve = new FloatCurve()

The curve to use

float ModuleEngines.thrustCurveDisplay = 1f
float ModuleEngines.thrustCurveRatio = 1f
float ModuleEngines.thrustPercentage = 100f
List<float> ModuleEngines.thrustTransformMultipliers

Gui Fields.

List<Transform> ModuleEngines.thrustTransforms
string ModuleEngines.thrustVectorTransformName = "thrustTransform"
bool ModuleEngines.useAtmCurve = false

Do we use the atm curve? If not, and atmChangeFlow is true, just use atm linearly.

bool ModuleEngines.useAtmCurveIsp = false
bool ModuleEngines.useEngineResponseTime = false
bool ModuleEngines.useThrottleIspCurve = false
bool ModuleEngines.useThrustCurve = false

should we use a thrust curve (based on resource remaining) ?

bool ModuleEngines.useVelCurve = false

If false, we don't use the new velCurve.

bool ModuleEngines.useVelCurveIsp = false
FloatCurve ModuleEngines.velCurve = new FloatCurve()

replacement for the existing module's velocityCurve. Note that its x value is Mach, not m/s velocity. High-bypass turbofans will see thrust decrease steadily from static. Low-bypass turbofans and turbojets will see thrust decrease slightly up to about 0.2 Mach then increase steadily until the limit is reached (both in terms of heat, and incoming compression vs compressor compression). Ramjets have 0 static thrust, and do not light until 0.3 Mach or so, but once lit have steadily increasing thrust until Mach 5, when the incoming air can no longer be slowed to subsonic (combustion must be subsonic for ramjets). Thermal limits also apply, of course. For heat limits, see machLimit, below.

FloatCurve ModuleEngines.velCurveIsp = new FloatCurve()

Same as velCurve but changes Isp not flow

Property Documentation

string ModuleEngines.engineName
get
bool ModuleEngines.getFlameoutState
get
bool ModuleEngines.getIgnitionState
get
bool ModuleEngines.isOperational
get
float ModuleEngines.normalizedOutput
get
float ModuleEngines.normalizedThrustOutput
get
float ModuleEngines.throttleSetting
get

The documentation for this class was generated from the following file: