Service#

Provides functionality to modify the state of the simulation directly, in ways the game normally does not allow: teleporting a vessel, setting its attitude, applying forces to its parts, refilling its tanks and enabling the game’s cheat options.

Note

Everything in this service is cheating. It has the same effect on a save as the game’s own debug menu (Alt+F12), and the same consequences: contracts, records and career progress made with it are not earned. It is intended for setting up a scenario to fly or a script to test, without flying there first.

POST /debug/set-circular-orbit#

Move the active vessel onto a circular orbit around a body.

Request JSON Object:
  • body (SpaceCenter.CelestialBody) – Body to orbit.

  • altitude (double) – Altitude of the orbit, in meters above sea level.

POST /debug/set-orbit#

Move the active vessel onto the orbit with the given orbital elements. The angles use the same units and conventions as SpaceCenter.Orbit.

Request JSON Object:
  • body (SpaceCenter.CelestialBody) – Body to orbit.

  • semi_major_axis (double) – Semi-major axis of the orbit, in meters.

  • eccentricity (double) – Eccentricity of the orbit.

  • inclination (double) – Inclination of the orbit, in radians.

  • longitude_of_ascending_node (double) – Longitude of the ascending node, in radians.

  • argument_of_periapsis (double) – Argument of periapsis, in radians.

  • mean_anomaly_at_epoch (double) – Mean anomaly at epoch, in radians.

  • epoch (double) – Universal time of the epoch, in seconds.

POST /debug/set-landed#

Place the active vessel on the surface of a body at the given latitude and longitude, and wait for it to come to rest.

Request JSON Object:
  • body (SpaceCenter.CelestialBody) – Body to land on.

  • latitude (double) – Latitude in degrees.

  • longitude (double) – Longitude in degrees.

  • altitude (double) – Height above the terrain to settle at, in meters. Defaults to 0, resting on the surface. Optional, defaults to 0.0.

POST /debug/set-flight#

Place the active vessel in atmospheric flight over the given point: at the given altitude and airspeed, pointing along the given heading at the given pitch and roll, and let physics resume so that it is flying. Use this to set up an in-air scenario without flying the craft up from the runway.

Note

The pitch, heading and roll match those reported by the vessel’s SpaceCenter.Flight.

Request JSON Object:
  • body (SpaceCenter.CelestialBody) – Body to fly over.

  • latitude (double) – Latitude in degrees.

  • longitude (double) – Longitude in degrees.

  • altitude (double) – Altitude in meters above sea level.

  • speed (double) – Airspeed in \(\mathrm{m/s}\), relative to the surface.

  • heading (double) – Compass heading to point along, in degrees (90 is east).

  • pitch (double) – Pitch above the horizon, in degrees. Defaults to 0 (level). Optional, defaults to 0.0.

  • roll (double) – Roll, in degrees. Defaults to 0 (wings level). Optional, defaults to 0.0.

  • angle_of_attack (double) – Angle of attack in degrees: how far the airspeed vector sits below the nose, in the pitch plane. 0 (the default) puts the airspeed along the nose; a positive value gives a nose-up attitude relative to the flight path, so the flight-path angle is pitch minus this. Optional, defaults to 0.0.

POST /debug/set-position#

Move the active vessel to the given position, leaving its velocity as it is. To put it alongside another vessel, pass a position in that vessel’s reference frame.

Note

This is the inverse of POST /space-center/vessel/(id)/position in the same reference frame.

Request JSON Object:
  • position (tuple<double, double, double>) – Position of the vessel’s center of mass, in meters.

  • reference_frame (SpaceCenter.ReferenceFrame?) – Reference frame the position is in. Defaults to the reference frame of the body being orbited. Optional, defaults to null.

POST /debug/set-velocity#

Set the velocity of the active vessel, leaving it where it is. The vessel is moved onto the orbit that passes through its current position at the new velocity, so this works in orbit and in the atmosphere alike.

Note

This is the inverse of POST /space-center/vessel/(id)/velocity in the same reference frame.

Request JSON Object:
  • velocity (tuple<double, double, double>) – Velocity in \(\mathrm{m/s}\).

  • reference_frame (SpaceCenter.ReferenceFrame?) – Reference frame the velocity is in. Defaults to the reference frame of the body being orbited, which rotates with it, so a zero velocity leaves the vessel at rest relative to the ground. Optional, defaults to null.

POST /debug/set-pitch-heading-roll#

Set the attitude of a vessel to the given pitch, heading and roll in the given reference frame, and stop it rotating. Lets a script start from a fixed, still pose without first flying the autopilot there.

Note

The angles match those reported by the vessel’s SpaceCenter.Flight.

Request JSON Object:
  • pitch (double) – Target pitch, in degrees.

  • heading (double) – Target heading, in degrees.

  • roll (double) – Target roll, in degrees.

  • reference_frame (SpaceCenter.ReferenceFrame?) – Reference frame the angles are in. Defaults to the vessel’s surface reference frame. Optional, defaults to null.

  • vessel (SpaceCenter.Vessel?) – Vessel to rotate. Defaults to the active vessel. Optional, defaults to null.

POST /debug/set-direction#

Point a vessel along the given direction in the given reference frame, and stop it rotating. This is POST /debug/set-pitch-heading-roll with a pointing vector instead of a pitch and heading, matching the attitude the autopilot holds for the same target direction and roll.

Request JSON Object:
  • direction (tuple<double, double, double>) – Direction to point the nose of the vessel in.

  • roll (double) – Target roll, in degrees, or NaN to leave the roll uncontrolled.

  • reference_frame (SpaceCenter.ReferenceFrame?) – Reference frame the direction and roll are in. Defaults to the vessel’s surface reference frame. Optional, defaults to null.

  • vessel (SpaceCenter.Vessel?) – Vessel to rotate. Defaults to the active vessel. Optional, defaults to null.

POST /debug/apply-rotation#

Rotate a vessel about the given axis, in its own reference frame, by the given angle.

Request JSON Object:
  • angle (double) – Angle to rotate by, in degrees.

  • axis (tuple<double, double, double>) – Axis to rotate about.

  • vessel (SpaceCenter.Vessel?) – Vessel to rotate. Defaults to the active vessel. Optional, defaults to null.

POST /debug/set-angular-velocity#

Set the angular velocity of a vessel, expressed in the given reference frame. Pass a zero vector to stop the vessel rotating.

Note

The whole vessel is put into a rigid rotation about its center of mass, so it spins in place rather than shearing apart or translating.

Request JSON Object:
  • angular_velocity (tuple<double, double, double>) – Angular velocity, in \(\mathrm{rad/s}\). The direction is the axis of rotation and the magnitude is the rate.

  • reference_frame (SpaceCenter.ReferenceFrame?) – Reference frame the angular velocity is in. Defaults to the vessel’s surface reference frame. Optional, defaults to null.

  • vessel (SpaceCenter.Vessel?) – Vessel to rotate. Defaults to the active vessel. Optional, defaults to null.

POST /debug/add-force#

Exert a constant force on a part, acting at the given position.

Note

The force is removed when the client that added it disconnects.

Request JSON Object:
  • part (SpaceCenter.Part) – The part to apply the force to.

  • force (tuple<double, double, double>) – A vector pointing in the direction that the force acts, with its magnitude equal to the strength of the force in Newtons.

  • position (tuple<double, double, double>) – The position at which the force acts, as a vector.

  • reference_frame (SpaceCenter.ReferenceFrame) – The reference frame that the force and position are in.

Response JSON Object:
  • value (SpaceCenter.Force) – An object that can be used to remove or modify the force.

POST /debug/instantaneous-force#

Exert an instantaneous force on a part, acting at the given position.

Note

The force is applied instantaneously in a single physics update.

Request JSON Object:
  • part (SpaceCenter.Part) – The part to apply the force to.

  • force (tuple<double, double, double>) – A vector pointing in the direction that the force acts, with its magnitude equal to the strength of the force in Newtons.

  • position (tuple<double, double, double>) – The position at which the force acts, as a vector.

  • reference_frame (SpaceCenter.ReferenceFrame) – The reference frame that the force and position are in.

POST /debug/fill-all-resources#

Fill every resource tank on a vessel to its maximum capacity.

Request JSON Object:
  • vessel (SpaceCenter.Vessel?) – Vessel to fill. Defaults to the active vessel. Optional, defaults to null.

POST /debug/fill-resources#

Fill the tanks of a single resource on a vessel to their maximum capacity.

Request JSON Object:
  • resource_name (string) – Name of the resource to fill, for example "LiquidFuel".

  • vessel (SpaceCenter.Vessel?) – Vessel to fill. Defaults to the active vessel. Optional, defaults to null.

GET /debug/infinite-propellant#

Whether engines and RCS thrusters draw no propellant.

Response JSON Object:
  • value (bool)

PUT /debug/infinite-propellant#

Whether engines and RCS thrusters draw no propellant.

Request JSON Object:
  • value (bool) – The new value.

GET /debug/infinite-electricity#

Whether parts draw no electric charge.

Response JSON Object:
  • value (bool)

PUT /debug/infinite-electricity#

Whether parts draw no electric charge.

Request JSON Object:
  • value (bool) – The new value.

GET /debug/no-crash-damage#

Whether parts survive collisions that would otherwise destroy them.

Response JSON Object:
  • value (bool)

PUT /debug/no-crash-damage#

Whether parts survive collisions that would otherwise destroy them.

Request JSON Object:
  • value (bool) – The new value.

GET /debug/unbreakable-joints#

Whether the joints between parts are rigid and cannot break.

Response JSON Object:
  • value (bool)

PUT /debug/unbreakable-joints#

Whether the joints between parts are rigid and cannot break.

Request JSON Object:
  • value (bool) – The new value.

GET /debug/ignore-max-temperature#

Whether parts survive temperatures above their maximum, instead of exploding.

Response JSON Object:
  • value (bool)

PUT /debug/ignore-max-temperature#

Whether parts survive temperatures above their maximum, instead of exploding.

Request JSON Object:
  • value (bool) – The new value.

GET /debug/allow-part-clipping#

Whether parts may be placed so that they intersect one another in the editor.

Response JSON Object:
  • value (bool)

PUT /debug/allow-part-clipping#

Whether parts may be placed so that they intersect one another in the editor.

Request JSON Object:
  • value (bool) – The new value.

GET /debug/non-strict-attachment-orientation#

Whether parts may be attached in any orientation, rather than only the ones their attachment nodes allow.

Response JSON Object:
  • value (bool)

PUT /debug/non-strict-attachment-orientation#

Whether parts may be attached in any orientation, rather than only the ones their attachment nodes allow.

Request JSON Object:
  • value (bool) – The new value.

GET /debug/ignore-kerbal-inventory-limits#

Whether a kerbal’s inventory may hold more than its slot and mass limits allow.

Response JSON Object:
  • value (bool)

PUT /debug/ignore-kerbal-inventory-limits#

Whether a kerbal’s inventory may hold more than its slot and mass limits allow.

Request JSON Object:
  • value (bool) – The new value.

GET /debug/ignore-eva-construction-mass-limit#

Whether EVA construction may move parts heavier than a kerbal can normally carry.

Response JSON Object:
  • value (bool)

PUT /debug/ignore-eva-construction-mass-limit#

Whether EVA construction may move parts heavier than a kerbal can normally carry.

Request JSON Object:
  • value (bool) – The new value.

GET /debug/ignore-agency-mindset-on-contracts#

Whether contracts are offered regardless of the agency mindset that normally restricts which ones appear.

Response JSON Object:
  • value (bool)

PUT /debug/ignore-agency-mindset-on-contracts#

Whether contracts are offered regardless of the agency mindset that normally restricts which ones appear.

Request JSON Object:
  • value (bool) – The new value.

GET /debug/pause-on-vessel-unpack#

Whether the game pauses whenever a vessel comes off rails.

Response JSON Object:
  • value (bool)

PUT /debug/pause-on-vessel-unpack#

Whether the game pauses whenever a vessel comes off rails.

Request JSON Object:
  • value (bool) – The new value.

GET /debug/biomes-visible#

Whether biome boundaries are drawn on the surface of bodies.

Response JSON Object:
  • value (bool)

PUT /debug/biomes-visible#

Whether biome boundaries are drawn on the surface of bodies.

Request JSON Object:
  • value (bool) – The new value.

GET /debug/gravity-multiplier#

Multiplier applied to the force of gravity on every vessel. 1 is normal gravity, 0 is weightlessness.

Response JSON Object:
  • value (double)

PUT /debug/gravity-multiplier#

Multiplier applied to the force of gravity on every vessel. 1 is normal gravity, 0 is weightlessness.

Request JSON Object:
  • value (double) – The new value.

GET /debug/funds#

The number of funds the player has. Only available in career mode.

Response JSON Object:
  • value (double)

PUT /debug/funds#

The number of funds the player has. Only available in career mode.

Request JSON Object:
  • value (double) – The new value.

GET /debug/science#

The amount of science the player has. Only available in career and science mode.

Response JSON Object:
  • value (float)

PUT /debug/science#

The amount of science the player has. Only available in career and science mode.

Request JSON Object:
  • value (float) – The new value.

GET /debug/reputation#

The player’s reputation. Only available in career mode.

Response JSON Object:
  • value (float)

PUT /debug/reputation#

The player’s reputation. Only available in career mode.

Request JSON Object:
  • value (float) – The new value.

POST /debug/unlock-technology-tree#

Research every node in the technology tree and purchase every part in it. Only available in career and science mode.

POST /debug/upgrade-facilities#

Upgrade every building at the space center to its highest level. Only available in career mode.

POST /debug/max-kerbal-experience#

Raise every kerbal in the roster to the highest experience level.