Skip to content

CelestialBody Type

Jeremie Rossignol edited this page Dec 15, 2016 · 23 revisions

The CelestialBody class represents a planet, moon or star in KSP.

Methods

Method Signature Description
string Name() The name of the celestial body.
int Index() The index of the celestial body int he global list. Useful for sorting.
bool HasAtmosphere() Indicates whether the given body has an atmosphere.
bool HasOcean() Indicates whether the given body has an ocean.
bool HasSurface() Indicates whether the given body has a surface (ie. isn't a gas giant).
bool IsHomeWorld() Indicates whether the given body is the home world (ie. Kerbin).
bool IsSun() Indicates whether the given body is the Sun.
bool IsPlanet() Indicates whether the given body is a planet (not a moon or star).
bool IsMoon() Indicates whether the given body is a moon.
bool HaveReached() Whether the player has reached the given celestial body.
bool HaveOrbited() Whether the player has orbited the given celestial body.
bool HaveLandedOn() Whether the player has landed on the given celestial body.
bool HaveEscaped() Whether the player has escaped from the given celestial body.
bool HaveReturnedFrom() Whether the player has returned from the given celestial body.
bool IsOrbitalSurveyComplete() Indicates whether an orbital survey has been complete for the body.
bool CanHaveKolniyaOrbit() Whether the body's size, SOI and orbital period allow for a Kolniya orbit.
bool CanHaveSynchronousOrbit(double eccentricity) Whether the body's size, SOI, orbital period and the provided eccentricity allow for a synchronous orbit.
bool CanHaveTundraOrbit() Whether the body's size, SOI and orbital period allow for a tundra orbit.
CelestialBody Parent() Returns the body's parent body (ex. The Mun's parent body is Kerbin).
List<CelestialBody> Children() Returns the body's child bodies (ex. Kerbin's child bodies are the Mun and Minmus).
List<PQSCity> PQSCities() Returns the body's PQSCity objects (things like KSC, monoliths, etc.).
double Mass() Returns the planet's mass (in kg).
double RotationalPeriod() Returns the planet's rotational period (in s).
double Radius() Returns the planet's radius (in meters).
double SemiMajorAxis() Returns the semi-major axis of the planet (in meters).
float FlyingAltitudeThreshold() The altitude threshold between 'flying low' and 'flying high'.
float AtmosphereAltitude() Returns the altitude of planet's atmosphere (in meters).
float SpaceAltitudeThreshold() The altitude threshold between 'low in space' and 'high in space'.
double SphereOfInfluence() Returns the radius of the planet's sphere of influence (in meters).
List<Biome> Biomes() Returns all the biomes for the given celestial body.
double RemoteTechCoverage() (RemoteTech only) Indicates the commsat coverage percentage of the given body.
double SCANsatCoverage(string scanType) (SCANsat only) Indicates the SCANsat coverage percentage of the given body for the given scan type.
double Multiplier() Gets the science/contract reward multiplier for this body.

Global Functions

Function Signature Description
CelestialBody HomeWorld() Returns the home world (ie. Kerbin).
CelestialBody Sun() Returns the sun. Works even when it has a differen name than 'Sun'.
List<CelestialBody> AllBodies() Returns a list of all celestial bodies.
List<CelestialBody> ReachedBodies() Returns a list of all celestial bodies that the player has reached.
List<CelestialBody> OrbitedBodies() Returns a list of all celestial bodies that the player has orbited.
List<CelestialBody> LandedBodies() Returns a list of all celestial bodies that the player has landed on.
List<CelestialBody> EscapedBodies() Returns a list of all celestial bodies that the player has escaped from.
List<CelestialBody> ReturnedFromBodies() Returns a list of all celestial bodies that the player has returned from.
CelestialBody CelestialBody(string identifier) Returns the CelestialBody for the given identifier.
CelestialBody NextUnreachedBody() Returns the next unreached body in a logical progression.
List<CelestialBody> NextUnreachedBodies(int count) Returns the next count unreached bodies in the logical progression.
Clone this wiki locally