Parts#

type krpc_KSA_Part_t#

A part of a vehicle. Obtained from krpc_KSA_Vehicle_Parts().

Note

A part keeps its object when the vehicle it belongs to changes, for example when a decoupler separates it. Throws an exception once the part no longer exists.

krpc_error_t krpc_KSA_Part_Name(krpc_connection_t connection, char **returnValue, krpc_KSA_Part_t instance)#

The id of the part’s template.

krpc_error_t krpc_KSA_Part_Title(krpc_connection_t connection, char **returnValue, krpc_KSA_Part_t instance)#

The name of the part, as shown in the game.

krpc_error_t krpc_KSA_Part_Vehicle(krpc_connection_t connection, krpc_KSA_Vehicle_t *returnValue, krpc_KSA_Part_t instance)#

The vehicle the part belongs to.

krpc_error_t krpc_KSA_Part_Parent(krpc_connection_t connection, krpc_KSA_Part_t *returnValue, krpc_KSA_Part_t instance)#

The part this part is attached to, or nullptr for the root part.

krpc_error_t krpc_KSA_Part_Children(krpc_connection_t connection, krpc_list_object_t *returnValue, krpc_KSA_Part_t instance)#

The parts attached to this part.

krpc_error_t krpc_KSA_Part_Sequence(krpc_connection_t connection, int32_t *returnValue, krpc_KSA_Part_t instance)#

The number of the sequence that activates the part, or -1 if no sequence does.

krpc_error_t krpc_KSA_Part_Mass(krpc_connection_t connection, float *returnValue, krpc_KSA_Part_t instance)#

The mass of the part, including its propellant, in kilograms.

krpc_error_t krpc_KSA_Part_DryMass(krpc_connection_t connection, float *returnValue, krpc_KSA_Part_t instance)#

The mass of the part without its propellant, in kilograms.

krpc_error_t krpc_KSA_Part_Resources(krpc_connection_t connection, krpc_list_object_t *returnValue, krpc_KSA_Part_t instance)#

The resources the part holds, one for each substance.

krpc_error_t krpc_KSA_Part_Tanks(krpc_connection_t connection, krpc_list_object_t *returnValue, krpc_KSA_Part_t instance)#

The part’s propellant tanks. Empty if it has none.

krpc_error_t krpc_KSA_Part_Batteries(krpc_connection_t connection, krpc_list_object_t *returnValue, krpc_KSA_Part_t instance)#

The part’s batteries.

krpc_error_t krpc_KSA_Part_SolarPanels(krpc_connection_t connection, krpc_list_object_t *returnValue, krpc_KSA_Part_t instance)#

The part’s solar panels.

krpc_error_t krpc_KSA_Part_Generators(krpc_connection_t connection, krpc_list_object_t *returnValue, krpc_KSA_Part_t instance)#

The part’s generators.

krpc_error_t krpc_KSA_Part_PowerConsumers(krpc_connection_t connection, krpc_list_object_t *returnValue, krpc_KSA_Part_t instance)#

The part’s power consumers.

krpc_error_t krpc_KSA_Part_Lights(krpc_connection_t connection, krpc_list_object_t *returnValue, krpc_KSA_Part_t instance)#

The part’s lights.

krpc_error_t krpc_KSA_Part_Deployables(krpc_connection_t connection, krpc_list_object_t *returnValue, krpc_KSA_Part_t instance)#

The part’s deployable sections. A part can have several, such as the doors of a service module.

krpc_error_t krpc_KSA_Part_MagneticScoops(krpc_connection_t connection, krpc_list_object_t *returnValue, krpc_KSA_Part_t instance)#

The part’s magnetic scoops. Empty if it has none.

krpc_error_t krpc_KSA_Part_Position(krpc_connection_t connection, krpc_tuple_double_double_double_t *returnValue, krpc_KSA_Part_t instance, krpc_KSA_ReferenceFrame_t referenceFrame)#

The position of the part’s origin, in meters.

Parameters:
  • referenceFrame – The reference frame of the position.

krpc_error_t krpc_KSA_Part_Velocity(krpc_connection_t connection, krpc_tuple_double_double_double_t *returnValue, krpc_KSA_Part_t instance, krpc_KSA_ReferenceFrame_t referenceFrame)#

The velocity of the part’s origin, in meters per second.

Parameters:
  • referenceFrame – The reference frame of the velocity.

krpc_error_t krpc_KSA_Part_Rotation(krpc_connection_t connection, krpc_tuple_double_double_double_double_t *returnValue, krpc_KSA_Part_t instance, krpc_KSA_ReferenceFrame_t referenceFrame)#

The rotation of the part’s axes, relative to the given frame.

Parameters:
  • referenceFrame – The reference frame of the rotation.

krpc_error_t krpc_KSA_Part_Engine(krpc_connection_t connection, krpc_KSA_Engine_t *returnValue, krpc_KSA_Part_t instance)#

The part’s engine, or nullptr if it has none.

krpc_error_t krpc_KSA_Part_Gimbals(krpc_connection_t connection, krpc_list_object_t *returnValue, krpc_KSA_Part_t instance)#

The part’s gimbals. An engine part can have several, each steering one nozzle.

krpc_error_t krpc_KSA_Part_RCS(krpc_connection_t connection, krpc_KSA_RCS_t *returnValue, krpc_KSA_Part_t instance)#

The part’s RCS thrusters, or nullptr if it has none.

krpc_error_t krpc_KSA_Part_Decoupler(krpc_connection_t connection, krpc_KSA_Decoupler_t *returnValue, krpc_KSA_Part_t instance)#

The part’s decoupler, or nullptr if it has none.

krpc_error_t krpc_KSA_Part_Parachute(krpc_connection_t connection, krpc_KSA_Parachute_t *returnValue, krpc_KSA_Part_t instance)#

The part’s parachute, or nullptr if it has none.

krpc_error_t krpc_KSA_Part_DockingPort(krpc_connection_t connection, krpc_KSA_DockingPort_t *returnValue, krpc_KSA_Part_t instance)#

The part’s docking port, or nullptr if it has none.

krpc_error_t krpc_KSA_Part_Seats(krpc_connection_t connection, krpc_list_object_t *returnValue, krpc_KSA_Part_t instance)#

The part’s crew seats.

krpc_error_t krpc_KSA_Part_Crew(krpc_connection_t connection, krpc_list_object_t *returnValue, krpc_KSA_Part_t instance)#

The kittens in the part’s seats.

type krpc_KSA_Engine_t#

An engine. Obtained from krpc_KSA_Part_Engine().

Note

An active engine fires when the vehicle’s engines are on, at the vehicle’s throttle. See krpc_KSA_Control_EngineOn() and krpc_KSA_Control_Throttle().

krpc_error_t krpc_KSA_Engine_Part(krpc_connection_t connection, krpc_KSA_Part_t *returnValue, krpc_KSA_Engine_t instance)#

The part the engine is in.

krpc_error_t krpc_KSA_Engine_Gimbals(krpc_connection_t connection, krpc_list_object_t *returnValue, krpc_KSA_Engine_t instance)#

The gimbals that steer the engine’s nozzles. Empty if the engine has none.

krpc_error_t krpc_KSA_Engine_Active(krpc_connection_t connection, bool *returnValue, krpc_KSA_Engine_t instance)#
krpc_error_t krpc_KSA_Engine_set_Active(krpc_connection_t connection, krpc_KSA_Engine_t instance, bool value)#

Whether the engine is active, as when its sequence is activated. Setting it returns once the change has applied.

krpc_error_t krpc_KSA_Engine_HasPropellant(krpc_connection_t connection, bool *returnValue, krpc_KSA_Engine_t instance)#

Whether the engine has propellant to burn.

krpc_error_t krpc_KSA_Engine_MinimumThrottle(krpc_connection_t connection, float *returnValue, krpc_KSA_Engine_t instance)#

The lowest throttle the engine runs at, between 0 and 1.

krpc_error_t krpc_KSA_Engine_Propellants(krpc_connection_t connection, krpc_list_string_t *returnValue, krpc_KSA_Engine_t instance)#

The names of the substances the engine burns. See krpc_KSA_Resource_Name().

krpc_error_t krpc_KSA_Engine_Thrust(krpc_connection_t connection, float *returnValue, krpc_KSA_Engine_t instance)#

The thrust of the engine at its current throttle and the current atmospheric pressure, in Newtons. Zero when it is not firing.

krpc_error_t krpc_KSA_Engine_AvailableThrust(krpc_connection_t connection, float *returnValue, krpc_KSA_Engine_t instance)#

The thrust of the engine at full throttle and the current atmospheric pressure, in Newtons. Zero when it is inactive or has no propellant.

krpc_error_t krpc_KSA_Engine_SpecificImpulse(krpc_connection_t connection, float *returnValue, krpc_KSA_Engine_t instance)#

The specific impulse of the engine at the current atmospheric pressure, in seconds. Zero when it is inactive or has no propellant.

type krpc_KSA_Gimbal_t#

A gimbal that steers an engine nozzle. Obtained from krpc_KSA_Part_Gimbals() or krpc_KSA_Engine_Gimbals().

Note

A gimbal turns about the y and z axes of its mount, which krpc_KSA_Gimbal_Rotation() gives. The flight computer steers it while an engine it belongs to is krpc_KSA_Gimbal_Active().

krpc_error_t krpc_KSA_Gimbal_Part(krpc_connection_t connection, krpc_KSA_Part_t *returnValue, krpc_KSA_Gimbal_t instance)#

The part the gimbal is in.

krpc_error_t krpc_KSA_Gimbal_AngleY(krpc_connection_t connection, float *returnValue, krpc_KSA_Gimbal_t instance)#

The angle of the gimbal about its y axis, in degrees.

krpc_error_t krpc_KSA_Gimbal_AngleZ(krpc_connection_t connection, float *returnValue, krpc_KSA_Gimbal_t instance)#

The angle of the gimbal about its z axis, in degrees.

krpc_error_t krpc_KSA_Gimbal_MaxAngleY(krpc_connection_t connection, float *returnValue, krpc_KSA_Gimbal_t instance)#

The largest angle of the gimbal about its y axis, in degrees. Zero if it does not turn about that axis.

krpc_error_t krpc_KSA_Gimbal_MaxAngleZ(krpc_connection_t connection, float *returnValue, krpc_KSA_Gimbal_t instance)#

The largest angle of the gimbal about its z axis, in degrees. Zero if it does not turn about that axis.

krpc_error_t krpc_KSA_Gimbal_Active(krpc_connection_t connection, bool *returnValue, krpc_KSA_Gimbal_t instance)#

Whether an engine the gimbal steers is active.

krpc_error_t krpc_KSA_Gimbal_Rotation(krpc_connection_t connection, krpc_tuple_double_double_double_double_t *returnValue, krpc_KSA_Gimbal_t instance, krpc_KSA_ReferenceFrame_t referenceFrame)#

The rotation of the gimbal’s mount, whose y and z axes the gimbal turns about.

Parameters:
  • referenceFrame – The reference frame of the rotation.

type krpc_KSA_RCS_t#

The RCS thrusters of a part. Obtained from krpc_KSA_Part_RCS().

Note

Active thrusters fire when the vehicle’s RCS is on. See krpc_KSA_Control_RCS().

krpc_error_t krpc_KSA_RCS_Part(krpc_connection_t connection, krpc_KSA_Part_t *returnValue, krpc_KSA_RCS_t instance)#

The part the thrusters are in.

krpc_error_t krpc_KSA_RCS_Active(krpc_connection_t connection, bool *returnValue, krpc_KSA_RCS_t instance)#
krpc_error_t krpc_KSA_RCS_set_Active(krpc_connection_t connection, krpc_KSA_RCS_t instance, bool value)#

Whether the thrusters are active. Setting it returns once the change has applied.

type krpc_KSA_Decoupler_t#

A decoupler. Obtained from krpc_KSA_Part_Decoupler().

krpc_error_t krpc_KSA_Decoupler_Part(krpc_connection_t connection, krpc_KSA_Part_t *returnValue, krpc_KSA_Decoupler_t instance)#

The part the decoupler is in.

krpc_error_t krpc_KSA_Decoupler_Enabled(krpc_connection_t connection, bool *returnValue, krpc_KSA_Decoupler_t instance)#

Whether the decoupler can fire.

krpc_error_t krpc_KSA_Decoupler_Decoupled(krpc_connection_t connection, bool *returnValue, krpc_KSA_Decoupler_t instance)#

Whether the decoupler has fired, or is attached to nothing.

krpc_error_t krpc_KSA_Decoupler_Decouple(krpc_connection_t connection, krpc_list_object_t *returnValue, krpc_KSA_Decoupler_t instance)#

Fire the decoupler, separating the vehicle into two. Returns once it has fired. Throws an exception if the decoupler is disabled or krpc_KSA_Decoupler_Decoupled().

Returns:

The vehicles that separated from this one.

type krpc_KSA_Parachute_t#

A parachute. Obtained from krpc_KSA_Part_Parachute().

krpc_error_t krpc_KSA_Parachute_Part(krpc_connection_t connection, krpc_KSA_Part_t *returnValue, krpc_KSA_Parachute_t instance)#

The part the parachute is in.

krpc_error_t krpc_KSA_Parachute_State(krpc_connection_t connection, krpc_KSA_ParachuteState_t *returnValue, krpc_KSA_Parachute_t instance)#

The state of the parachute.

krpc_error_t krpc_KSA_Parachute_Fill(krpc_connection_t connection, float *returnValue, krpc_KSA_Parachute_t instance)#

How far the canopy is open, from 0 to 1.

krpc_error_t krpc_KSA_Parachute_DeployAltitude(krpc_connection_t connection, float *returnValue, krpc_KSA_Parachute_t instance)#

The height above the terrain at which an armed parachute deploys, in meters.

krpc_error_t krpc_KSA_Parachute_CanCut(krpc_connection_t connection, bool *returnValue, krpc_KSA_Parachute_t instance)#

Whether the parachute can be cut away. Main parachutes cannot.

krpc_error_t krpc_KSA_Parachute_Deploy(krpc_connection_t connection, krpc_KSA_Parachute_t instance)#

Arm the parachute, so that it deploys at krpc_KSA_Parachute_DeployAltitude(). Returns once it is armed. Throws an exception if it is not stowed.

krpc_error_t krpc_KSA_Parachute_Cut(krpc_connection_t connection, krpc_KSA_Parachute_t instance)#

Cut the parachute away. Returns once it is cut. Throws an exception if it cannot be cut. See krpc_KSA_Parachute_CanCut().

type krpc_KSA_ParachuteState_t#

The state of a parachute. See krpc_KSA_Parachute_State().

KRPC_KSA_PARACHUTESTATE_STOWED#

Packed away.

KRPC_KSA_PARACHUTESTATE_ARMED#

Waiting to deploy at krpc_KSA_Parachute_DeployAltitude().

KRPC_KSA_PARACHUTESTATE_LINESTRETCH#

Leaving the pack.

KRPC_KSA_PARACHUTESTATE_REEFED#

Partly open, to limit the opening load.

KRPC_KSA_PARACHUTESTATE_DISREEFING#

Opening from reefed to full.

KRPC_KSA_PARACHUTESTATE_FULL#

Fully open.

KRPC_KSA_PARACHUTESTATE_CUT#

Cut away.

KRPC_KSA_PARACHUTESTATE_RIPPED#

Torn by too much dynamic pressure.

KRPC_KSA_PARACHUTESTATE_SEVEREDLINES#

Lost after its lines broke under too much load.

type krpc_KSA_DockingPort_t#

A docking port. Obtained from krpc_KSA_Part_DockingPort().

krpc_error_t krpc_KSA_DockingPort_Part(krpc_connection_t connection, krpc_KSA_Part_t *returnValue, krpc_KSA_DockingPort_t instance)#

The part the docking port is in.

krpc_error_t krpc_KSA_DockingPort_Docked(krpc_connection_t connection, bool *returnValue, krpc_KSA_DockingPort_t instance)#

Whether the port is docked.

krpc_error_t krpc_KSA_DockingPort_DockedPart(krpc_connection_t connection, krpc_KSA_Part_t *returnValue, krpc_KSA_DockingPort_t instance)#

The part the port is docked to, or nullptr if it is not docked.

krpc_error_t krpc_KSA_DockingPort_Undock(krpc_connection_t connection, krpc_list_object_t *returnValue, krpc_KSA_DockingPort_t instance)#

Undock the port, separating the vehicle into two. Returns once it has undocked. Throws an exception if the port is not docked.

Returns:

The new vehicles.

Note

Docking and undocking replace the vehicles involved. See krpc_KSA_Vehicle_t.

type krpc_KSA_Deployable_t#

A part that deploys and retracts, such as a landing leg, a solar panel or a service module door. Obtained from krpc_KSA_Part_Deployables().

Note

Deploying or retracting a part moves its symmetric copies with it, as the part’s menu in the game does.

krpc_error_t krpc_KSA_Deployable_Part(krpc_connection_t connection, krpc_KSA_Part_t *returnValue, krpc_KSA_Deployable_t instance)#

The part the deployable is in.

krpc_error_t krpc_KSA_Deployable_State(krpc_connection_t connection, krpc_KSA_DeployableState_t *returnValue, krpc_KSA_Deployable_t instance)#

The state of the part.

krpc_error_t krpc_KSA_Deployable_Deploy(krpc_connection_t connection, krpc_KSA_Deployable_t instance)#

Deploy the part. Returns once it has started to move.

Note

Throws an exception if the part is broken.

krpc_error_t krpc_KSA_Deployable_Retract(krpc_connection_t connection, krpc_KSA_Deployable_t instance)#

Retract the part. Returns once it has started to move.

Note

Throws an exception if the part is broken.

type krpc_KSA_DeployableState_t#

The state of a deployable part. See krpc_KSA_Deployable_State().

KRPC_KSA_DEPLOYABLESTATE_DEPLOYED#

Fully deployed.

KRPC_KSA_DEPLOYABLESTATE_RETRACTED#

Fully retracted.

KRPC_KSA_DEPLOYABLESTATE_DEPLOYING#

Moving toward deployed.

KRPC_KSA_DEPLOYABLESTATE_RETRACTING#

Moving toward retracted.

KRPC_KSA_DEPLOYABLESTATE_BROKEN#

Broken, so it can no longer move.

type krpc_KSA_MagneticScoop_t#

A magnetic scoop, which collects gas from space into the vehicle’s tanks. Obtained from krpc_KSA_Part_MagneticScoops().

krpc_error_t krpc_KSA_MagneticScoop_Part(krpc_connection_t connection, krpc_KSA_Part_t *returnValue, krpc_KSA_MagneticScoop_t instance)#

The part the scoop is in.

krpc_error_t krpc_KSA_MagneticScoop_Active(krpc_connection_t connection, bool *returnValue, krpc_KSA_MagneticScoop_t instance)#
krpc_error_t krpc_KSA_MagneticScoop_set_Active(krpc_connection_t connection, krpc_KSA_MagneticScoop_t instance, bool value)#

Whether the scoop is switched on.

krpc_error_t krpc_KSA_MagneticScoop_Substance(krpc_connection_t connection, char **returnValue, krpc_KSA_MagneticScoop_t instance)#

The name of the substance the scoop collects. See krpc_KSA_Resource_Name().

krpc_error_t krpc_KSA_MagneticScoop_CollectionRate(krpc_connection_t connection, float *returnValue, krpc_KSA_MagneticScoop_t instance)#

The rate the scoop collects gas at, in kilograms per second.