Engine¶
Some of the Parts returned by LIST PARTS will be of type Engine. It is also possible to get just the Engine parts by executing LIST ENGINES
, for example:
LIST ENGINES IN myVariable.
FOR eng IN myVariable {
print "An engine exists with ISP = " + eng:ISP.
}.
- structure Engine¶
¶ Suffix
Type (units)
Description
All suffixes of
Part
Turn engine on
Turn engine off
Scalar
(%)Tweaked thrust limit
Scalar
(kN)Untweaked thrust limit. Zero if engine disabled.
Scalar
(kN)Max thrust at the specified pressure (in standard Kerbin atmospheres). Zero if engine disabled.
Scalar
(kN)Current thrust. Zero if engine disabled.
Scalar
(kN)Available thrust at full throttle accounting for thrust limiter. Zero if engine disabled.
Scalar
(kN)Available thrust at the specified pressure (in standard Kerbin atmospheres). Zero if engine disabled.
Scalar
(kN)Possible thrust at full throttle accounting for thrust limiter, when the engine is enabled.
Scalar
(kN)Possible thrust at the specified pressure (in standard Kerbin atmospheres), when the engine is enabled.
Scalar
(unit/s)Current volumetric flow rate of fuel.
Scalar
(unit/s)Untweaked maximum volumetric flow rate of fuel at full throttle.
Scalar
(Mg/s)Current mass flow rate of fuel.
Scalar
(Mg/s)Untweaked maximum mass flow rate of fuel at full throttle.
Specific impulse at the given pressure (in standard Kerbin atmospheres).
Vacuum specific impulse
Synonym for VACUUMISP
Specific impulse at Kerbin sealevel
Synonym for SEALEVELISP
Check if no more fuel
Check if engine is active
Check if engine can be reactivated
Check if engine can be shutdown
Check if throttle can not be changed
Check if engine has multiple modes
List (string) of the engine modes
Name of the current mode (only if multiple)
Switch to another mode (only if multiple)
Is the engine in primary mode? (only if multiple)
Can the engine switch modes automatically? (only if multiple)
Check if engine has gimbal
Gimbal of this engine (only if available)
Does this engine need ullage (for RealFuels)
How stable is the fuel for this engine (for RealFuels)
Is this engine pressure fed? (for RealFuels)
Number of ignitions remaining for this engine (for RealFuels)
The minimum throttle setting for this engine (for RealFuels)
Engine configuration name (for RealFuels)
The fuel resources this engine consumes, and in what ratios
Note
Engine
is a type of Part
, and therefore can use all the suffixes of Part
. Shown below are only the suffixes that are unique to Engine
.
- Engine:ACTIVATE()¶
Call to make the engine turn on.
- Engine:SHUTDOWN()¶
Call to make the engine turn off.
- Engine:THRUSTLIMIT¶
- Access
Get/Set
- Type
Scalar
(%)
If this an engine with a thrust limiter (tweakable) enabled, what percentage is it limited to? Note that this is expressed as a percentage, not a simple 0..1 coefficient. e.g. To set thrustlimit to half, you use a value of 50.0, not 0.5.
This value is not allowed to go outside the range [0..100]. If you attempt to do so, it will be clamped down into the allowed range.
Note that although a kerboscript is allowed to set the value to a very precise number (for example 10.5123), the stock in-game display widget that pops up when you right-click the engine will automatically round it to the nearest 0.5 whenever you open the panel. So if you do something like
set ship:part[20]:thrustlimit to 10.5123.
in your script, then look at the rightclick menu for the engine, the very act of just looking at the menu will cause it to become 10.5 instead of 10.5123. There isn’t much that kOS can do to change this. It’s a user interface decision baked into the stock game.
- Engine:MAXTHRUST¶
- Access
Get only
- Type
Scalar
(kN)
How much thrust would this engine give at its current atmospheric pressure and velocity if the throttle was max at 1.0, and the thrust limiter was max at 100%. Note this might not be the engine’s actual max thrust it could have under other air pressure conditions. Some engines have a very different value for MAXTHRUST in vacuum as opposed to at sea level pressure. Also, some jet engines have a very different value for MAXTHRUST depending on how fast they are currently being rammed through the air. Also note that this will read zero if the engine is currently disabled.
- Engine:MAXTHRUSTAT(pressure)¶
- Parameters
pressure – atmospheric pressure (in standard Kerbin atmospheres)
- Return type
Scalar
(kN)
How much thrust would this engine give if both the throttle and thrust limtier was max at the current velocity, and at the given atmospheric pressure. Use a pressure of 0.0 for vacuum, and 1.0 for sea level (on Kerbin) (or more than 1 for thicker atmospheres like on Eve). Note that this will read zero if the engine is currently disabled. (Pressure must be greater than or equal to zero. If you pass in a negative value, it will be treated as if you had given a zero instead.)
- Engine:THRUST¶
- Access
Get only
- Type
Scalar
(kN)
How much thrust is this engine giving at this very moment.
- Engine:AVAILABLETHRUST¶
- Access
Get only
- Type
Scalar
(kN)
Taking into account the thrust limiter tweakable setting, how much thrust would this engine give if the throttle was max at its current thrust limit setting and atmospheric pressure and velocity conditions. Note that this will read zero if the engine is currently disabled.
- Engine:AVAILABLETHRUSTAT(pressure)¶
- Parameters
pressure – atmospheric pressure (in standard Kerbin atmospheres)
- Return type
Scalar
(kN)
Taking into account the thrust limiter tweakable setting, how much thrust would this engine give if the throttle was max at its current thrust limit setting and velocity, but at a different atmospheric pressure you pass into it. The pressure is measured in ATM’s, meaning 0.0 is a vacuum, 1.0 is sea level at Kerbin. Note that this will read zero if the engine is currently disabled. (Pressure must be greater than or equal to zero. If you pass in a negative value, it will be treated as if you had given a zero instead.)
- Engine:POSSIBLETHRUST¶
- Access
Get only
- Type
Scalar
(kN)
Taking into account the thrust limiter tweakable setting, how much thrust would this engine give if the throttle was max at its current thrust limit setting and atmospheric pressure and velocity conditions. This will give the correct value even if the engine is currently disabled.
- Engine:POSSIBLETHRUSTAT(pressure)¶
- Parameters
pressure – atmospheric pressure (in standard Kerbin atmospheres)
- Return type
Scalar
(kN)
Taking into account the thrust limiter tweakable setting, how much thrust would this engine give if the throttle was max at its current thrust limit setting and velocity, but at a different atmospheric pressure you pass into it. The pressure is measured in ATM’s, meaning 0.0 is a vacuum, 1.0 is sea level at Kerbin. This will give the correct value even if the engine is currently disabled. (Pressure must be greater than or equal to zero. If you pass in a negative value, it will be treated as if you had given a zero instead.)
- Engine:FUELFLOW¶
- Access
Get only
- Type
Scalar
(units/s)
How much fuel volume is this engine consuming at this very moment.
- Engine:MAXFUELFLOW¶
- Access
Get only
- Type
Scalar
(units/s)
How much fuel volume would this engine consume at standard pressure and velocity if the throttle was max at 1.0, and the thrust limiter was max at 100%. Note this might not be the engine’s actual max fuel flow it could have under other air pressure conditions. Some jet engines have a very different fuel consumption depending on how fast they are currently being rammed through the air.
- Engine:MASSFLOW¶
- Access
Get only
- Type
Scalar
(Mg/s)
How much fuel mass is this engine consuming at this very moment.
- Engine:MAXMASSFLOW¶
- Access
Get only
- Type
Scalar
(Mg/s)
How much fuel mass would this engine consume at standard pressure and velocity if the throttle was max at 1.0, and the thrust limiter was max at 100%. Note this might not be the engine’s actual max fuel flow it could have under other air pressure conditions. Some jet engines have a very different fuel consumption depending on how fast they are currently being rammed through the air.
- Engine:ISP¶
- Access
Get only
- Type
- Engine:ISPAT(pressure)¶
- Parameters
pressure – atmospheric pressure (in standard Kerbin atmospheres)
- Return type
Specific impulse at the given atmospheric pressure. Use a pressure of 0 for vacuum, and 1 for sea level (on Kerbin). (Pressure must be greater than or equal to zero. If you pass in a negative value, it will be treated as if you had given a zero instead.)
- Engine:VACUUMISP¶
- Access
Get only
- Type
Vacuum specific impulse
- Engine:SEALEVELISP¶
- Access
Get only
- Type
Specific impulse at Kerbin sealevel.
- Engine:FLAMEOUT¶
- Access
Get only
- Type
Is this engine failed because it is starved of a resource (liquidfuel, oxidizer, oxygen)?
- Engine:IGNITION¶
- Access
Get only
- Type
Has this engine been ignited? If both
Engine:IGNITION
andEngine:FLAMEOUT
are true, that means the engine could start up again immediately if more resources were made available to it.
- Engine:ALLOWRESTART¶
- Access
Get only
- Type
Is this an engine that can be started again? Usually True, but false for solid boosters.
- Engine:ALLOWSHUTDOWN¶
- Access
Get only
- Type
Is this an engine that can be shut off once started? Usually True, but false for solid boosters.
- Engine:THROTTLELOCK¶
- Access
Get only
- Type
Is this an engine that is stuck at a fixed throttle? (i.e. solid boosters)
- Engine:MULTIMODE¶
- Access
Get only
- Type
Does this engine have multiple modes (i.e. RAPIER)? Check this before calling multi-mode specific suffixes.
- Engine:MODES¶
- Access
Get only
- Type
List
of strings
Lists names of modes of this engine if multimode, returns a list of 1 string “Single mode” otherwise.
- Engine:MODE¶
- Access
Get only
- Type
Name of the current mode. Only assessible for multi-mode engines.
- Engine:TOGGLEMODE()¶
Call to switch to another mode. Only assessible for multi-mode engines.
- Engine:PRIMARYMODE¶
- Access
Get/Set
- Type
True for primary mode, false for secondary. Setting to other value equals toggling the mode. Only assessible for multi-mode engines.
- Engine:AUTOSWITCH¶
- Access
Get/Set
- Type
Is automatic switching enabled? Can set to switch between manual and automatic switching. Only assessible for multi-mode engines.
- Engine:GIMBAL¶
- Access
Get only
- Type
Returns the
Gimbal
attached to this engine. Only accessible if the gimbal is present (UseEngine:HASGIMBAL
to check if available).
- Engine:ULLAGE¶
- Access
Get only
- Type
If RealFuels is installed, returns true if this engine is a type of engine that requires ullage, otherwise returns false. Note: this is a static property of the engine, for current fuel status, check FUELSTABILITY.
- Engine:FUELSTABILITY¶
- Access
Get only
- Type
If RealFuels is installed, returns the fuel stability of this engine as a value between 0 and 1 (where 1 is fullly stable), otherwise returns 1. Engines that don’t require ullage will always return 1, unless they are pressure fed and the feed pressure is too low.
- Engine:PRESSUREFED¶
- Access
Get only
- Type
If RealFuels is installed, returns true if this engine is pressure fed, otherwise returns false.
- Engine:IGNITIONS¶
- Access
Get only
- Type
If RealFuels is installed, returns the number of ignitions remaining, or -1 if it is unlimited, otherwise returns -1.
- Engine:MINTHROTTLE¶
- Access
Get only
- Type
If RealFuels is installed, returns the minimum throttle setting as a value between 0 and 1, otherwise returns 0.
- Engine:CONFIG¶
- Access
Get only
- Type
If RealFuels is installed, returns the configuration name of this engine if applicable, otherwise returns the part title.
- Engine:CONSUMEDRESOURCES¶
- Access
Get only
- Type
The fuel resources this engine consumes, and in what ratios.