Skip to content

MASFlightComputer

MOARdV edited this page Jan 21, 2018 · 12 revisions

MASFlightComputerProxy.cs

Contents

The fc group contains the core interface between KSP, Avionics Systems, and props in an IVA. It consists of many 'variable' functions that can be used to get information as well as numerous 'action' functions that are used to do things.

Due to the number of methods in the fc group, this document has been split across three pages:

NOTE: If a variable listed below includes an entry for 'Required Mod(s)', then the mod listed (or any of the mods, if more than one) must be installed for that particular feature to work.


Abort Category

The Abort action and the GetAbort query belong in this category.

fc.Abort()

Returns: 1 (abort is always a SET, not a toggle).

Trigger the Abort action group.

fc.GetAbort()

Returns 1 if the Abort action has been triggered.


Action Groups Category

Variables and actions related to player-configured action groups are in this category.

fc.ActionGroupHasActions(double groupID)

  • groupID: A number between 0 and 9 (inclusive).

Returns: 1 if there are actions for this action group, 0 otherwise.

Returns 1 if there is at least one action associated with the action group. 0 otherwise, or if an invalid action group is specified.

fc.GetActionGroup(double groupID)

  • groupID: A number between 0 and 9 (inclusive)

Returns: 1 if active, 0 if inactive

Get the current state of the specified action group.

fc.SetActionGroup(double groupID, bool active)

  • groupID: A number between 0 and 9 (inclusive)
  • active: true or false to set the state.

Set the specified action group to the requested state.

fc.ToggleActionGroup(double groupID)

  • groupID: A number between 0 and 9 (inclusive)

Toggle the action group.


Altitudes Category

Variables relating to the current vessel's altitude are found in this category.

fc.Altitude()

Returns the vessel's altitude above the datum (sea level where applicable), in meters.

fc.AltitudeAtmospheric()

Returns altitude above datum (or sea level) for vessels in an atmosphere. Returns 0 otherwise. Altitude in meters.

fc.AltitudeBottom()

Returns the distance from the lowest point of the craft to the surface of the planet. Ocean is treated as surface for this purpose. Precision reporting sets in at 500m (above 500m it reports the same as AltitudeTerrain(false)). Distance in meters.

fc.AltitudeTerrain(bool ignoreOcean)

  • ignoreOcean: When false, returns height above sea level when over the ocean; when true, always returns ground height.

Returns: Altitude above the terrain in meters.

Returns the height above the ground, optionally treating the ocean surface as ground. Altitude in meters.

fc.TerrainHeight()

Returns the terrain height beneath the vessel relative to the planet's datum (sea level or equivalent). Height in meters.


Atmosphere Category

Atmosphere and airflow variables are found in this category.

fc.AtmosphereDepth()

Returns the atmospheric depth as reported by the KSP atmosphere gauge, a number ranging between 0 and 1.

fc.AtmosphereTop()

Returns the altitude of the top of atmosphere, or 0 if there is no atmo. Altitude in meters.

fc.AtmosphericDensity()

Returns the atmospheric density.

fc.DynamicPressure()

Returns: Dynamic pressure in kPa.

Returns the current dynamic pressure on the vessel in kPa. If FAR is installed, this variable uses FAR's computation instead.

fc.HasAtmosphere()

Returns: 1 if there is an atmosphere, 0 otherwise.

Returns 1 if the body the vessel is orbiting has an atmosphere.

fc.StaticPressureAtm()

Returns the static atmospheric pressure in standard atmospheres.

fc.StaticPressureKPa()

Returns: Static pressure in kPa.

Returns the static atmospheric pressure in kiloPascals.


Body Category

Information about the Celestial Bodies may be fetched using the methods in this category.

Most of these methods function in one of two ways: by name or by number. By name means using the name of the body to select it (eg, fc.BodyMass("Jool")). However, since strings are slightly slower than numbers for lookups, these methods will accept numbers. The number for a world can be fetched using fc.BodyIndex, or one of two special values may be used:

  • -1: Return information about the body the vessel is currently orbiting.
  • -2: Return information about the body currently being targeted.

Obviously, if no body is being targted, no data will be returned when -2 is used.

fc.BodyArea(object id)

  • id: The name or index of the body of interest.

Returns: Surface area of the planet in m^2.

Returns the surface area of the selected body.

fc.BodyAtmosphereTop(object id)

  • id: The name or index of the body of interest.

Returns: The altitude of the top of the atmosphere, in meters, or 0.

Returns the altitude of the top of the selected body's atmosphere. If the body does not have an atmosphere, or an invalid body is selected, 0 is returned.

fc.BodyBiome(object id, double latitude, double longitude)

  • id: The name or index of the body of interest.
  • latitude: Latitude of the location of interest.
  • longitude: Longitude of the location of interest.

Returns: The name of the biome at the specified location, or an empty string.

Returns the name of the biome at the given location on the selected body.

fc.BodyEscapeVelocity(object id)

  • id: The name or index of the body of interest.

Returns: Escape velocity in m/s, or 0 if the body was invalid.

Returns the escape velocity of the body.

fc.BodyGeeASL(object id)

  • id: The name or index of the body of interest.

Returns: Acceleration in G's, or 0 if the body was invalid.

Returns the acceleration from gravity as the surface for the selected body.

fc.BodyGM(object id)

  • id: The name or index of the body of interest.

Returns: GM in m^3/s^2, or 0 if the body is invalid.

Returns the standard gravitational parameter of the body.

fc.BodyHasAtmosphere(object id)

  • id: The name or index of the body of interest.

Returns: 1 if the body has an atmosphere, 0 if it does not, or an invalid body was selected.

Indicates if the selected body has an atmosphere.

fc.BodyHasOxygen(object id)

  • id: The name or index of the body of interest.

Returns: 1 if the body has an atmosphere that contains oxygen, 0 if it does not, or an invalid body was selected.

Indicates if the selected body's atmosphere has oxygen.

fc.BodyIndex(object id)

  • id: The name of the body, eg. "Kerbin" or one of the indices (including -1 and -2).

Returns: An index from 0 to (number of Celestial Bodies - 1), or -1 if the named body was not found.

Returns the numeric identifier for the named body. If the name is invalid (no such body exists), returns -1. May also use the index, which is useful for -1 and -2.

fc.BodyIsHome(object id)

  • id: The name or index of the body of interest.

Returns: 1 if the body is home, 0 otherwise.

Returns 1 if the selected body is "Home" (Kerbin in un-modded KSP).

fc.BodyMass(object id)

  • id: The name or index of the body of interest.

Returns: Mass in kg.

Returns the mass of the requested body.

fc.BodyMoonCount(object id)

  • id: The name or index of the body of interest.

Returns: The number of moons, or 0.

Returns the number of natural satellites (moons) orbiting the selected body.

fc.BodyName(object id)

  • id: The name or index of the body of interest.

Returns: The name of the body, or an empty string if invalid.

Returns the name of the requested body. While this method can be used with a name for its parameter, that is kind of pointless.

fc.BodyNumMoons(object id)

  • id: The name or index of the body of interest.

Returns: The number of moons, or 0 if an invalid value was provided.

Returns the number of worlds orbiting the selected body. If the body is a planet, this is the number of moons. If the body is the Sun, this number is the number of planets.

fc.BodyRadius(object id)

  • id: The name or index of the body of interest.

Returns: Radius in meters, or 0 if the body is invalid.

Returns the radius of the selected body.

fc.BodyRotationPeriod(object id)

  • id: The name or index of the body of interest.

Returns: Rotation period in seconds, or 0.

Returns the rotation period of the body. If the body does not rotate, 0 is returned.

fc.BodySoI(object id)

  • id: The name or index of the body of interest.

Returns: SoI in meters

Returns the radius of the body's Sphere of Influence.

fc.BodySunLongitude(object id)

  • id: The name or index of the body of interest.

Returns: Longitude of local noon, or 0 if it could not be determined.

Returns the longitude on the body that is directly below the sun (longitude of local noon).

fc.BodySurfaceTemp(object id, bool useKelvin)

  • id: The name or index of the body of interest.
  • useKelvin: If true, temperature is in Kelvin; if false, temperature is in Celsius.

Returns: Surface temperature in K or C; 0 if the selected object was invalid

Returns the temperature of the body at sea level.

fc.BodySyncOrbitSMA(object id)

  • id: The name or index of the body of interest.

Returns: SMA in meters, or 0 if the body is invalid, or the synchronous orbit is out side the body's SoI.

Returns the semi-major axis of a synchronous orbit with the selected body. When a vessel's SMA matches the sync orbit SMA, a craft is in a synchronous orbit.

fc.BodySyncOrbitVelocity(object id)

  • id: The name or index of the body of interest.

Returns: Velocity in m/s, or 0 if there is no synchronous orbit.

Returns the speed of a synchronous orbit. Provided an orbit is perfectly circular, an orbit that has this velocity will be synchronous.

fc.BodyTerrainHeight(object id, double latitude, double longitude)

  • id: The name or index of the body of interest.
  • latitude: Latitude of the location of interest in degrees.
  • longitude: Longitude of the location of interest in degrees.

Returns: Terrain height in meters. Will return negative values for locations below sea level.

Returns the terrain height at a given latitude and longitude relative to the planet's datum (sea level or equivalent). Height in meters.

fc.BodyTerrainSlope(object id, double latitude, double longitude)

  • id: The name or index of the body of interest.
  • latitude: Latitude of the location of interest in degrees.
  • longitude: Longitude of the location of interest in degrees.

Returns: Slope in degrees.

Returns an estimate of the terrain slope at a given latitude and longitude. If the location is beneath the ocean, it provides the slope of the ocean floor. Values near the poles may be very inaccurate.


Brakes Category

Variables related to a vessel's brakes are in this category.

fc.BrakesHasActions()

Returns 1 if the brakes action group has at least one action assigned to it.

fc.GetBrakes()

Returns the current state of the Brakes action group

fc.SetBrakes(bool active)

Set the brakes to the specified state.

fc.ToggleBrakes()

Toggle the state of the brakes.


Cameras Category

The methods in this section are focused around controlling external cameras installed on the vessel. They provide an interface between the MASCamera part module and CAMERA nodes in a monitor page.

fc.AddFoV(double index, double deltaFoV)

Returns: The new field of view setting, or 0 if an invalid index was supplied.

Adjusts the field of view setting on the selected camera.

fc.AddPan(double index, double deltaPan)

Returns: The new pan setting, or 0 if an invalid index was supplied.

Adjusts the pan setting on the selected camera.

fc.AddTilt(double index, double deltaTilt)

Returns: The new tilt setting, or 0 if an invalid index was supplied.

Adjusts the tilt setting on the selected camera.

fc.CameraCount()

Returns: The number of valid MASCamera modules installed on this vessel.

Returns a count of the valid MASCamera modules found on this vessel.

fc.GetCameraMode(double index)

  • index: A number between 0 and fc.CameraCount() - 1.

Returns: The number of the modes (between 0 and fc.GetCameraModeCount(index)-1), or 0 if an invalid camera was selected.

Returns the id number of the currently-active mode on the MASCamera selected by index.

fc.GetCameraModeCount(double index)

  • index: A number between 0 and fc.CameraCount() - 1.

Returns: The number of modes (1 or higher), or 0 if an invalid camera was selected.

Returns the number of modes available to the MASCamera selected by index.

fc.GetCameraModeName(double index, double mode)

  • index: A number between 0 and fc.CameraCount() - 1.
  • mode: A number between 0 and fc.GetCameraModeCount(index) - 1.

Returns: The name of the selected mode, or an empty string if an invalid camera or mode was selected.

Returns the id number of the currently-active mode on the MASCamera selected by index.

fc.GetCameraName(double index)

  • index: A number between 0 and fc.CameraCount() - 1.

Returns: The name of the camera, or an empty string.

Returns the name of the camera selected by index, or an empty string if the index is invalid.

fc.GetFoV(double index)

Returns: The current field of view setting, or 0 if an invalid index was supplied.

Retrieve the field of view setting on the selected camera.

fc.GetPan(double index)

Returns: The current pan setting, or 0 if an invalid index was supplied.

Retrieve the pan setting on the selected camera.

fc.GetTilt(double index)

Returns: The current tilt setting, or 0 if an invalid index was supplied.

Retrieve the tilt setting on the selected camera.

fc.SetCameraMode(double index, double mode)

  • index: A number between 0 and fc.CameraCount() - 1.
  • mode: A number between 0 and fc.GetCameraModeCount(index) - 1.

Returns: The mode that was selected, or 0 if an invalid camera was selected.

Returns the id number of the currently-active mode on the MASCamera selected by index.

fc.SetFoV(double index, double newFoV)

Returns: The new field of view setting, or 0 if an invalid index was supplied.

Adjusts the field of view setting on the selected camera.

fc.SetPan(double index, double setPan)

Returns: The new pan setting, or 0 if an invalid index was supplied.

Adjusts the pan setting on the selected camera.

fc.SetTilt(double index, double setTilt)

Returns: The new tilt setting, or 0 if an invalid index was supplied.

Adjusts the tilt setting on the selected camera.


CommNet Category

Variables related to CommNet connectivity are in this category.

fc.AntennaCount()

Returns: The number of deployable antennae on the vessel.

Returns the number of antennae on the vessel.

fc.AntennaDamaged()

Returns: 1 if all antennae are damaged; 0 otherwise.

Returns 1 if all antennae are damaged.

fc.AntennaDeployable()

Returns: 1 if any antenna is retracted and available to deploy; 0 otherwise.

Returns 1 if at least one antenna may be deployed.

fc.AntennaMoving()

Returns: 1 if any antenna is moving (deploying or retracting).

Returns 1 if at least one antenna is moving.

fc.AntennaPosition()

Returns: Antenna Position (a number between 0 and 4); 1 if no antennae are installed.

Returns a number representing deployable antenna position:

  • 0 = Broken
  • 1 = Retracted
  • 2 = Retracting
  • 3 = Extending
  • 4 = Extended

If there are multiple antennae, the first non-broken antenna's state is reported; if all antennae are broken, the state will be 0.

fc.AntennaRetractable()

Returns: 1 if a antenna is deployed, and it may be retracted; 0 otherwise.

Returns 1 if at least one antenna is retractable.

fc.CommNetCanCommunicate()

Returns: 1 if the vessel can communicate, 0 otherwise.

Reports if the vessel can communicate.

fc.CommNetCanScience()

Returns: 1 if the vessel can transmit science, 0 otherwise.

Reports if the vessel can transmit science.

fc.CommNetConnected()

Returns: 1 if the vessel is connected, 0 otherwise.

Reports if the vessel is connected to CommNet.

fc.CommNetConnectedHome()

Returns: 1 if the vessel can talk to home, 0 otherwise.

Reports if the vessel has a connection home.

fc.CommNetControlState()

Returns: A value between -1 and +2

Returns the current control state of the vessel:

  • 2: Full Kerbal control
  • 1: Partial Kerbal control
  • 0: No Kerbal control
  • -1: Other control state

fc.CommNetEndpoint()

Returns: The name of the endpoint.

Returns the name of the endpoint of the CommNet connection.

fc.CommNetLatitude()

Returns: Latitude of the DSN relay, or 0.

Returns the latitude on Kerbin of the current CommNet deep space relay. If there is no link home, returns 0.

fc.CommNetLongitude()

Returns: Longitude of the DSN relay, or 0.

Returns the longitude on Kerbin of the current CommNet deep space relay. If there is no link home, returns 0.

fc.CommNetSignalDelay()

Returns: Delay in seconds.

Returns the signal delay between the vessel and its CommNet endpoint.

fc.CommNetSignalQuality()

Returns: A value from 0 to 4 as described in the summary.

Returns a quality value for the CommNet signal. The quality value correlates to the "signal bars" display on the KSP UI.

  • 0 - No signal
  • 1 - Red
  • 2 - Orange
  • 3 - Yellow
  • 4 - Green

fc.CommNetSignalStrength()

Returns: A value between 0 (no signal) and 1 (maximum signal strength).

Returns the signal strength of the CommNet signal.

fc.ToggleAntenna()

Returns: 1 if any antennas were toggled, 0 otherwise

Deploys / undeploys antennae.


Control Input State Category

Variables and actions related to the controls (roll / pitch / yaw / translation) are in this category.

fc.ControlNeutral()

Returns 1 when roll/translation controls are near neutral.

fc.StickPitch()

Returns the current pitch control state.

fc.StickRoll()

Returns the current roll control state.

fc.StickTranslationX()

Returns: A value between -1 (full left) and +1 (full right).

Returns the current X translation state. Note that this value is the direction the thrust is firing, not the direction the vessel will move.

fc.StickTranslationY()

Returns: A value between -1 (full top) and +1 (full bottom).

Returns the current Y translation state. Note that this value is the direction the thrust is firing, not the direction the vessel will move.

fc.StickTranslationZ()

Returns: A value between -1 (full aft) and +1 (full forward).

Returns the current Z translation state. Note that this value is the direction the thrust is firing, not the direction the vessel will move.

fc.StickTrimPitch()

Returns: Trim setting, between -1 and +1

Returns the current pitch trim setting.

fc.StickTrimRoll()

Returns: Trim setting, between -1 and +1

Returns the current roll trim setting.

fc.StickTrimYaw()

Returns: Trim setting, between -1 and +1

Returns the current yaw trim setting.

fc.StickYaw()

Returns the current yaw control state.


Crew Category

The Crew category provides information about the crew aboard the vessel.

seatNumber is a 0-based index to select which seat is being queried. This means that a 3-seat pod has valid seat numbers 0, 1, and 2. A single-seat pod has a valid seat number 0.

One difference to be aware of between RPM and MAS: The full-vessel crew info (those methods starting 'VesselCrew') provide info on crew members without regards to seating arrangements. For instance, if the command pod has 2 of 3 seats occupied, and a passenger pod as 1 of 4 seats occupied, VesselCrewCount will return 3, and the crew info (eg, VesselCrewName) will provide values for indices 0, 1, and 2.

fc.CrewBadS(double seatNumber)

  • seatNumber: The index of the seat to check. Indices start at 0.

Returns: 1 or 0 (see summary)

Returns 1 if the crew in seatNumber has the 'BadS' trait. Returns 0 if seatNumber is invalid or there is no crew in that seat, or the crew does not possess the 'BadS' trait.

fc.CrewExperience(double seatNumber)

  • seatNumber: The index of the seat to check. Indices start at 0.

Returns: A number 0 or higher; 0 if the requested seat is invalid or empty.

Returns the number of experience points for the selected crew member.

fc.CrewGender(double seatNumber)

  • seatNumber: The index of the seat to check. Indices start at 0.

Returns: 1 if the crew is male, 2 if the crew is female, 0 if the seat is empty.

Returns a number representing the gender of the selected crew member.

fc.CrewLevel(double seatNumber)

  • seatNumber: The index of the seat to check. Indices start at 0.

Returns: A number 0-5; 0 if the requested seat is invalid or empty.

Returns the experience level of the selected crew member.

fc.CrewName(double seatNumber)

  • seatNumber: The index of the seat to check. Indices start at 0.

Returns: The crew name, or an empty string if there is no crew in the given seat.

Returns the name of the crew member seated in seatNumber. If the number is invalid, or no Kerbal is in the seat, returns an empty string.

fc.CrewPanic(double seatNumber)

  • seatNumber: The index of the seat to check. Indices start at 0.

Returns: A number between 0 and 1; 0 if the requested seat is invalid or empty.

Returns the 'PANIC' level of the selected crew member.

fc.CrewStupidity(double seatNumber)

  • seatNumber: The index of the seat to check. Indices start at 0.

Returns: A number between 0 and 1; 0 if the requested seat is invalid or empty.

Returns the stupidity rating of the selected crew member.

fc.CrewTitle(double seatNumber)

  • seatNumber: The index of the seat to check. Indices start at 0.

Returns: The name of the job title, or an empty string if seatNumber is invalid or unoccupied.

Returns the job title of the selected crew member.

fc.CrewWhee(double seatNumber)

  • seatNumber: The index of the seat to check. Indices start at 0.

Returns: A number between 0 and 1; 0 if the requested seat is invalid or empty.

Returns the 'WHEE' level of the selected crew member.

fc.NumberSeats()

Returns: The selected number of seats (1 or more).

Returns the number of seats in the current IVA pod.

fc.SeatOccupied(double seatNumber)

  • seatNumber: The index of the seat to check. Indices start at 0.

Returns: 1 if seatNumber is a valid seat; 0 otherwise.

Indicates whether a given seat is occupied by a Kerbal. Returns 1 when seatNumber is valid and there is a Kerbal in the given seat, and returns 0 in all other instances.

fc.VesselCrewBadS(double crewIndex)

  • crewIndex: The index of the crewmember to check. Indices start at 0.

Returns: 1 or 0 (see summary)

Returns 1 if the selected crew has the 'BadS' trait. Returns 0 if crewIndex is invalid or the crew does not possess the 'BadS' trait.

fc.VesselCrewCapacity()

Returns: 0 or higher.

Capacity of all crewed locations on the vessel.

fc.VesselCrewCount()

Returns: 0 or higher.

Total count of crew aboard the vessel.

fc.VesselCrewExperience(double crewIndex)

  • crewIndex: The index of the crewmember to check. Indices start at 0.

Returns: A number 0 or higher; 0 if the requested seat is invalid.

Returns the number of experience points for the selected crew member.

fc.VesselCrewGender(double crewIndex)

  • crewIndex: The index of the crewmember to check. Indices start at 0.

Returns: 1 if the crew is male, 2 if the crew is female, 0 if the index is invalid.

Returns a number representing the gender of the selected crew member.

fc.VesselCrewLevel(double crewIndex)

  • crewIndex: The index of the crewmember to check. Indices start at 0.

Returns: A number 0-5; 0 if the requested index is invalid.

Returns the experience level of the selected crew member.

fc.VesselCrewName(double crewIndex)

  • crewIndex: The index of the crewmember to check. Indices start at 0.

Returns: The crew name, or an empty string if index is invalid.

Returns the name of the crew member seated in seatNumber. If the number is invalid, or no Kerbal is in the seat, returns an empty string.

fc.VesselCrewPanic(double crewIndex)

  • crewIndex: The index of the crewmember to check. Indices start at 0.

Returns: A number between 0 and 1; 0 if the requested index is invalid.

Returns the 'PANIC' level of the selected crew member.

fc.VesselCrewStupidity(double crewIndex)

  • crewIndex: The index of the crewmember to check. Indices start at 0.

Returns: A number between 0 and 1; 0 if the requested index is invalid.

Returns the stupidity rating of the selected crew member.

fc.VesselCrewTitle(double crewIndex)

  • crewIndex: The index of the crewmember to check. Indices start at 0.

Returns: The name of the job title, or an empty string if crewIndex is invalid.

Returns the job title of the selected crew member.

fc.VesselCrewWhee(double crewIndex)

  • crewIndex: The index of the crewmember to check. Indices start at 0.

Returns: A number between 0 and 1; 0 if the requested index is invalid.

Returns the 'WHEE' level of the selected crew member.


Docking Category

Docking control and status are in the Docking category.

Many of these methods use the concept of "Primary Docking Port". The primary docking port is defined as the first or only docking port found on the vessel. These features are primarily centered around CTV / OTV type spacecraft where there is a single dock, not space stations or large craft with many docks.

fc.Docked()

Return 1 if the dock is attached to something (either in-flight docking or attached in the VAB); return 0 otherwise.

fc.DockReady()

Return 1 if the dock is ready; return 0 otherwise.

fc.GetDockIsReference()

Returns 1 if the primary docking port on the vessel is the current reference transform.

Returns 0 if the primary docking port is not the reference transform, or if there is no docking port, or if a docking port other than the primary port is the reference transform.

fc.GetPodIsReference()

Returns 1 if the current IVA pod is the reference transform. Returns 0 otherwise.

fc.SetDockToReference()

Set the primary docking port to be the reference transform.

fc.SetPodToReference()

Set the current IVA pod to be the reference transform.

fc.Undock()

Returns: If the active dock undocked from something.

Undock / detach (if pre-attached) the active docking node.


Engine Category

Engine status and control methods are in the Engine category.

fc.CurrentFuelFlow()

Returns the current fuel flow in grams/second

fc.CurrentGimbalDeflection()

Returns the average deflection of active, unlocked gimbals, from 0 (no deflection) to 1 (max deflection).

The direction of the deflection is ignored, but the value accounts for assymetrical gimbal configurations, eg, if X+ is 5.0, and X- is -3.0, the deflection percentage accounts for this difference.

fc.CurrentIsp()

Returns: The current Isp.

Return the current specific impulse in seconds.

fc.CurrentThrust(bool useThrottleLimits)

Returns: Thrust output, ranging from 0 to 1.

Returns the current thrust output, from 0.0 to 1.0.

fc.CurrentThrustkN()

Returns the current thrust in kiloNewtons

fc.CurrentTWR()

Returns the current thrust-to-weight ratio.

fc.DeltaV()

Returns: Remaining delta-V in m/s.

Required Mod(s): MechJeb

If MechJeb is installed, returns the total delta-V remaining for the vessel.

Otherwise, 0 is returned.

fc.DeltaVStage()

Returns: Remaining delta-V for this stage in m/s.

Required Mod(s): MechJeb

If MechJeb is installed, returns the total delta-V remaining for the current stage.

Otherwise, 0 is returned.

fc.EngineCountActive()

Returns a count of the total number of engines that are active.

fc.EngineCountTotal()

Returns a count of the total number of engines tracked. This count includes engines that have not staged.

fc.EngineFlameout()

Returns 1 if any active engines are in a flameout condition.

fc.GetEnginesEnabled()

Returns 1 if at least one engine is enabled.

fc.GetGimbalLimit()

Returns the currently-configured limit of active gimbals, as set in the right-click part menus. This value ranges between 0 (no gimbal) and 1 (100% gimbal).

fc.GetGimbalsActive()

Returns 1 if any gimbals are currently active.

fc.GetGimbalsLocked()

Returns 1 if at least one active gimbal is locked.

fc.GetThrottle()

Returns the current main throttle setting, from 0.0 to 1.0.

fc.GetThrottleLimit()

Returns the average of the throttle limit for the active engines, ranging from 0 (no thrust) to 1 (maximum thrust).

fc.MaxFuelFlow()

Returns the maximum fuel flow in grams/second

fc.MaxIsp()

Returns the maximum specific impulse in seconds.

fc.MaxThrustkN(bool useThrottleLimits)

  • useThrottleLimits: Apply throttle limits?

Returns: Maximum thrust in kN

Returns the maximum thrust in kN for the current altitude.

fc.MaxTWR(bool useThrottleLimits)

  • useThrottleLimits: Apply throttle limits?

Returns: Thrust-to-weight ratio, between 0 and 1.

Returns the maximum thrust-to-weight ratio.

fc.SetGimbalLimit(double newLimit)

  • newLimit: The new gimbal limit, between 0 and 1.

Returns: 1 if any gimbals were updated, 0 otherwise.

Change the gimbal limit for active gimbals. Values less than 0 or greater than 1 are clamped to that range.

fc.SetThrottle(double throttlePercentage)

  • throttlePercentage: Throttle setting, between 0 and 1.

Returns: The new throttle setting.

Set the throttle. May be set to any value between 0 and 1. Values outside that range are clamped to [0, 1].

fc.SetThrottleLimit(double newLimit)

Set the throttle limit. May be set to any value between 0 and 1. Values outside that range are clamped to [0, 1].

fc.ToggleEnginesEnabled()

Returns: 1 if engines are now enabled, 0 if they are disabled.

Turns on/off engines for the current stage

fc.ToggleGimbalLock()

Returns: 1 if active gimbals are now locked, 0 if they are unlocked.

Toggles gimbal lock on/off for the current stage.


Flight Status Category

Flight status variables are in this category.

fc.VesselLanded()

Returns 1 if the vessel is in a landed state (LANDED, SPLASHED, or PRELAUNCH); 0 otherwise

fc.VesselFlying()

Returns 1 if the vessel is in a flying state (FLYING, SUB_ORBITAL, ORBITING, ESCAPING, DOCKED).

fc.VesselSituation()

Returns: A number between 0 and 7 (inclusive).

Returns the vessel's situation, based on the KSP variable:

  • 0 - LANDED
  • 1 - SPLASHED
  • 2 - PRELAUNCH
  • 3 - FLYING
  • 4 - SUB_ORBITAL
  • 5 - ORBITING
  • 6 - ESCAPING
  • 7 - DOCKED

Gear Category

Variables and control methods for the Gear action group are in this category.

fc.GearHasActions()

Returns 1 if there are actions assigned to the landing gear AG.

fc.GetGear()

Returns 1 if the landing gear action group is active.

fc.SetGear(bool active)

Set the landing gear action group to the specified state.

fc.ToggleGear()

Toggle the landing gear action group


Life Support Category

The Life Support region provides specialized functionality for interfacing with the MASClimateControl cabin temperature system.

fc.ClimateControlLoad()

Returns: A value between 0 and 1.

When the MASClimateControl module is installed, returns the current load on the heating / cooling system as a percentage (from 0 to 1). If the module is off, or it is not installed, this method returns 0.

fc.GetClimateControl()

Returns: 1 if MASClimateControl is installed and active, 0 otherwise.

Returns 1 if the MASClimateControl module is installed in this pod, and it is enabled. Returns 0 otherwise.

fc.ToggleClimateControl()

Toggle the MASClimateControl module on or off.


Lights Category

The Lights action group can be controlled and queried through this category.

fc.LightsHasActions()

Returns 1 if the Lights action group has at least one action assigned to it.

fc.GetLights()

Returns 1 if the Lights action group is active.

fc.SetLights(bool active)

Set the state of the lights action group.

fc.ToggleLights()

Toggle the lights action group.


This documentation was automatically generated from source code at 19:30 UTC on 20/Jan/2018.

Clone this wiki locally