.. default-domain:: cs .. highlight:: csharp .. namespace:: KRPC.Client.Services.SpaceCenter Control ======= .. class:: Control Used to manipulate the controls of a vessel. This includes adjusting the throttle, enabling/disabling systems such as SAS and RCS, or altering the direction in which the vessel is pointing. Obtained by calling :prop:`Vessel.Control`. .. note:: Control inputs (pitch, yaw, roll, translation, wheel throttle, wheel steering and the custom axes) are zeroed when all clients that have set one or more of these inputs are no longer connected. The throttle is an exception: it keeps its value when clients disconnect. A kerbal on EVA is a vessel, and is driven by these same controls. The translation inputs move it: :prop:`Control.Forward` and :prop:`Control.Right` walk it about, relative to the direction it is facing, and all three translate its jetpack once that is deployed. Walking is not throttled by the size of the input, only started by it. The rotation inputs turn it, at a rate proportional to the input: :prop:`Control.Yaw` steers it as it walks, and all three turn its jetpack. Turning the jetpack releases the kerbal from the orientation it was holding; it stops and holds its new orientation once the input returns to zero. :prop:`Control.RCS` deploys and stows the jetpack and :prop:`Control.Lights` switches the helmet lamp. The remaining controls do nothing for a kerbal. A kerbal is also sent out and brought back in from here: with :meth:`CrewMember.EVA` and :meth:`Control.Board`, and :meth:`Control.GrabLadder` and :meth:`Control.ReleaseLadder` for the ladders it passes on the way. .. property:: ControlSource Source { get; } The source of the vessels control, for example by a kerbal or a probe core. :Game Scenes: Flight .. property:: ControlState State { get; } The control state of the vessel. :Game Scenes: Flight .. property:: bool SAS { get; set; } The state of SAS. :Game Scenes: Flight .. note:: Equivalent to :prop:`AutoPilot.SAS`. Throws an exception if set to ``true`` while the auto-pilot is engaged, as the auto-pilot holds SAS off for as long as it is flying the vessel. .. property:: SASMode SASMode { get; set; } The current :prop:`Control.SASMode`. These modes are equivalent to the mode buttons to the left of the navball that appear when SAS is enabled. :Game Scenes: Flight .. note:: Equivalent to :prop:`AutoPilot.SASMode` .. property:: SpeedMode SpeedMode { get; set; } The current :prop:`Control.SpeedMode` of the navball. This is the mode displayed next to the speed at the top of the navball. :Game Scenes: Flight .. property:: bool EngineGimbals { get; set; } Returns whether all gimballed engines on the vessel have gimbal enabled, and sets the gimbal enabled state of all gimballed engines. See :prop:`Engine.GimbalLocked`. :Game Scenes: Flight .. property:: bool ThrustReversers { get; set; } Returns whether all engines with a thrust reverser on the vessel have their thrust reverser engaged, and sets the thrust reverser state of all such engines. See :prop:`Engine.ThrustReversed`. :Game Scenes: Flight .. property:: bool AeroSurfaces { get; set; } Returns whether all control surfaces on the vessel have pitch, yaw and roll enabled, and sets the pitch, yaw and roll enabled state of all control surfaces. See :prop:`ControlSurface.PitchEnabled`, :prop:`ControlSurface.YawEnabled` and :prop:`ControlSurface.RollEnabled`. :Game Scenes: Flight .. property:: bool RCS { get; set; } The state of RCS. :Game Scenes: Flight .. note:: For a kerbal on EVA this is whether its jetpack is deployed. Deploying it requires the kerbal to have one and to be the active vessel; otherwise setting this does nothing. .. property:: bool ReactionWheels { get; set; } Returns whether all reactive wheels on the vessel are active, and sets the active state of all reaction wheels. See :prop:`ReactionWheel.Active`. :Game Scenes: Flight .. property:: bool Gear { get; set; } The state of the landing gear/legs. :Game Scenes: Flight .. property:: bool Legs { get; set; } Returns whether all landing legs on the vessel are deployed, and sets the deployment state of all landing legs. Does not include wheels (for example landing gear). See :prop:`Leg.Deployed`. :Game Scenes: Flight .. property:: bool Wheels { get; set; } Returns whether all wheels on the vessel are deployed, and sets the deployment state of all wheels. Does not include landing legs. See :prop:`Wheel.Deployed`. :Game Scenes: Flight .. property:: bool Lights { get; set; } The state of the lights. :Game Scenes: Flight .. note:: For a kerbal on EVA this is its helmet lamp. Switching it requires the kerbal to be the active vessel; otherwise setting this does nothing. .. property:: bool Brakes { get; set; } The state of the wheel brakes. :Game Scenes: Flight .. property:: bool Antennas { get; set; } Returns whether all antennas on the vessel are deployed, and sets the deployment state of all antennas. See :prop:`Antenna.Deployed`. :Game Scenes: Flight .. property:: bool CargoBays { get; set; } Returns whether any of the cargo bays on the vessel are open, and sets the open state of all cargo bays. See :prop:`CargoBay.Open`. :Game Scenes: Flight .. property:: bool Intakes { get; set; } Returns whether all of the air intakes on the vessel are open, and sets the open state of all air intakes. See :prop:`Intake.Open`. :Game Scenes: Flight .. property:: bool Parachutes { get; set; } Returns whether all parachutes on the vessel are deployed, and sets the deployment state of all parachutes. Cannot be set to ``false``. See :prop:`Parachute.Deployed`. :Game Scenes: Flight .. property:: bool Radiators { get; set; } Returns whether all radiators on the vessel are deployed, and sets the deployment state of all radiators. See :prop:`Radiator.Deployed`. :Game Scenes: Flight .. property:: bool ResourceHarvesters { get; set; } Returns whether all of the resource harvesters on the vessel are deployed, and sets the deployment state of all resource harvesters. See :prop:`ResourceHarvester.Deployed`. :Game Scenes: Flight .. property:: bool ResourceHarvestersActive { get; set; } Returns whether any of the resource harvesters on the vessel are active, and sets the active state of all resource harvesters. See :prop:`ResourceHarvester.Active`. :Game Scenes: Flight .. property:: bool SolarPanels { get; set; } Returns whether all solar panels on the vessel are deployed, and sets the deployment state of all solar panels. See :prop:`SolarPanel.Deployed`. :Game Scenes: Flight .. property:: bool Abort { get; set; } The state of the abort action group. :Game Scenes: Flight .. property:: float Throttle { get; set; } The state of the throttle. A value between 0 and 1. Unlike the other control inputs, the throttle is not zeroed when the clients that set it disconnect. :Game Scenes: Flight .. note:: The getter returns the input currently applied to the vessel, which combines the input set by kRPC with any keyboard, SAS and trim input. It refreshes one physics tick after a set, so a read immediately after a set returns the previously applied value rather than the value just set. .. property:: ControlInputMode InputMode { get; set; } Sets the behavior of the pitch, yaw, roll and translation control inputs. When set to additive, these inputs are added to the vessels current inputs. This mode is the default. When set to override, these inputs (if non-zero) override the vessels inputs. This mode prevents keyboard control, or SAS, from interfering with the controls when they are set. :Game Scenes: Flight .. property:: float Pitch { get; set; } The state of the pitch control. A value between -1 and 1. Equivalent to the w and s keys. :Game Scenes: Flight .. note:: The getter returns the input currently applied to the vessel, which combines the input set by kRPC with any keyboard, SAS and trim input. It refreshes one physics tick after a set, so a read immediately after a set returns the previously applied value rather than the value just set. .. property:: float Yaw { get; set; } The state of the yaw control. A value between -1 and 1. Equivalent to the a and d keys. :Game Scenes: Flight .. note:: The getter returns the input currently applied to the vessel, which combines the input set by kRPC with any keyboard, SAS and trim input. It refreshes one physics tick after a set, so a read immediately after a set returns the previously applied value rather than the value just set. .. property:: float Roll { get; set; } The state of the roll control. A value between -1 and 1. Equivalent to the q and e keys. :Game Scenes: Flight .. note:: The getter returns the input currently applied to the vessel, which combines the input set by kRPC with any keyboard, SAS and trim input. It refreshes one physics tick after a set, so a read immediately after a set returns the previously applied value rather than the value just set. .. property:: float PitchTrim { get; set; } The state of the pitch trim. A value between -1 and 1. Equivalent to the Alt+W and Alt+S keys. This is a persistent trim that remains latched until changed or reset, and can only be accessed for the active vessel. Unlike the pitch, yaw and roll control inputs, the trim is not cleared when clients disconnect. :Game Scenes: Flight .. property:: float YawTrim { get; set; } The state of the yaw trim. A value between -1 and 1. Equivalent to the Alt+A and Alt+D keys. This is a persistent trim that remains latched until changed or reset, and can only be accessed for the active vessel. Unlike the pitch, yaw and roll control inputs, the trim is not cleared when clients disconnect. :Game Scenes: Flight .. property:: float RollTrim { get; set; } The state of the roll trim. A value between -1 and 1. Equivalent to the Alt+Q and Alt+E keys. This is a persistent trim that remains latched until changed or reset, and can only be accessed for the active vessel. Unlike the pitch, yaw and roll control inputs, the trim is not cleared when clients disconnect. :Game Scenes: Flight .. property:: bool PrecisionMode { get; set; } Whether precision control mode is enabled. Equivalent to the Caps Lock key. This is a game setting rather than a vessel setting, and can only be accessed for the active vessel. Unlike the pitch, yaw and roll control inputs, precision mode is not cleared when clients disconnect. :Game Scenes: Flight .. note:: Precision mode weakens the RCS thrust that the control inputs produce. A block driven by :prop:`RCS.InputOverride` is exempt. .. property:: float Forward { get; set; } The state of the forward translational control. A value between -1 and 1. Equivalent to the h and n keys. :Game Scenes: Flight .. note:: The getter returns the input currently applied to the vessel, which combines the input set by kRPC with any keyboard, SAS and trim input. It refreshes one physics tick after a set, so a read immediately after a set returns the previously applied value rather than the value just set. .. property:: float Up { get; set; } The state of the up translational control. A value between -1 and 1. Equivalent to the i and k keys. :Game Scenes: Flight .. note:: The getter returns the input currently applied to the vessel, which combines the input set by kRPC with any keyboard, SAS and trim input. It refreshes one physics tick after a set, so a read immediately after a set returns the previously applied value rather than the value just set. .. property:: float Right { get; set; } The state of the right translational control. A value between -1 and 1. Equivalent to the j and l keys. :Game Scenes: Flight .. note:: The getter returns the input currently applied to the vessel, which combines the input set by kRPC with any keyboard, SAS and trim input. It refreshes one physics tick after a set, so a read immediately after a set returns the previously applied value rather than the value just set. .. property:: float WheelThrottle { get; set; } The state of the wheel throttle. A value between -1 and 1. A value of 1 rotates the wheels forwards, a value of -1 rotates the wheels backwards. :Game Scenes: Flight .. note:: The getter returns the input currently applied to the vessel, which combines the input set by kRPC with any keyboard, SAS and trim input. It refreshes one physics tick after a set, so a read immediately after a set returns the previously applied value rather than the value just set. .. property:: float WheelSteering { get; set; } The state of the wheel steering. A value between -1 and 1. A value of 1 steers to the left, and a value of -1 steers to the right. :Game Scenes: Flight .. note:: The getter returns the input currently applied to the vessel, which combines the input set by kRPC with any keyboard, SAS and trim input. It refreshes one physics tick after a set, so a read immediately after a set returns the previously applied value rather than the value just set. .. property:: float CustomAxis01 { get; set; } The state of CustomAxis01. A value between -1 and 1. :Game Scenes: Flight .. property:: float CustomAxis02 { get; set; } The state of CustomAxis02. A value between -1 and 1. :Game Scenes: Flight .. property:: float CustomAxis03 { get; set; } The state of CustomAxis03. A value between -1 and 1. :Game Scenes: Flight .. property:: float CustomAxis04 { get; set; } The state of CustomAxis04. A value between -1 and 1. :Game Scenes: Flight .. property:: int CurrentStage { get; } The current stage of the vessel. Corresponds to the stage number in the in-game UI. :Game Scenes: Flight .. function:: System.Collections.Generic.IList ActivateNextStage() Activates the next stage. Equivalent to pressing the space bar in-game. :returns: A list of vessel objects that are jettisoned from the active vessel. :Game Scenes: Flight .. note:: When called, the active vessel may change. It is therefore possible that, after calling this function, the object(s) returned by previous call(s) to :prop:`SpaceCenter.ActiveVessel ` no longer refer to the active vessel. Throws an exception if staging is locked. .. property:: bool StageLock { get; set; } Whether staging is locked on the vessel. :Game Scenes: Flight .. note:: This is equivalent to locking the staging using Alt+L .. function:: bool GetActionGroup(uint group) Returns ``true`` if the given action group is enabled. :parameters: * **group** -- A number between 0 and 9 inclusive, or between 0 and 250 inclusive when the `Extended Action Groups mod `_ is installed. :Game Scenes: Flight .. function:: void SetActionGroup(uint group, bool state) Sets the state of the given action group. :parameters: * **group** -- A number between 0 and 9 inclusive, or between 0 and 250 inclusive when the `Extended Action Groups mod `_ is installed. :Game Scenes: Flight .. function:: void ToggleActionGroup(uint group) Toggles the state of the given action group. :parameters: * **group** -- A number between 0 and 9 inclusive, or between 0 and 250 inclusive when the `Extended Action Groups mod `_ is installed. :Game Scenes: Flight .. function:: System.Collections.Generic.IList GetActionGroupActions(uint group) Returns a list of all the part actions that are assigned to the given action group. Each entry identifies the part, the part module, and the action's name and identifier. Returns an empty list if no actions are assigned to the group. :parameters: * **group** -- A number between 0 and 9 inclusive, or between 0 and 250 inclusive when the `Extended Action Groups mod `_ is installed. :Game Scenes: Flight .. note:: For stock action groups, the assignments are read from each part action directly. When the Extended Action Groups mod is installed, the assignments are queried from the mod instead, so that actions assigned to its additional groups are included. .. function:: Node AddNode(double ut, float prograde = 0.0f, float normal = 0.0f, float radial = 0.0f) Creates a maneuver node at the given universal time, and returns a :type:`Node` object that can be used to modify it. Optionally sets the magnitude of the delta-v for the maneuver node in the prograde, normal and radial directions. :parameters: * **ut** -- Universal time of the maneuver node. * **prograde** -- Delta-v in the prograde direction. * **normal** -- Delta-v in the normal direction. * **radial** -- Delta-v in the radial direction. :Game Scenes: Flight .. property:: System.Collections.Generic.IList Nodes { get; } Returns a list of all existing maneuver nodes, ordered by time from first to last. :Game Scenes: Flight .. function:: void RemoveNodes() Remove all maneuver nodes. :Game Scenes: Flight .. property:: Part Airlock { get; } The part whose hatch the kerbal is standing at, and so the one :meth:`Control.Board` would put it in. ``null`` if it is not at a hatch or the vessel is not a kerbal on EVA. :Game Scenes: Flight .. function:: void Board() Climb into the part whose hatch the kerbal is standing at, ending the EVA. The kerbal takes a seat in that part and its own vessel ceases to exist. If the kerbal was the active vessel, the game switches to the vessel it boarded. :Game Scenes: Flight .. note:: A kerbal can only board through a hatch it is already at, which :prop:`Control.Airlock` reports; it does not walk to one. Throws an exception if the vessel is not a kerbal on EVA, if the kerbal is not at a hatch, if boarding is disabled for the game, if the part has no free seat, or if the kerbal is carrying science data that the part cannot store, as the game asks what to do with it in that case. .. property:: Part Ladder { get; } The ladder the kerbal is holding on to, or ``null`` if it is not holding one or the vessel is not a kerbal on EVA. :Game Scenes: Flight .. function:: void GrabLadder() Take hold of the ladder the kerbal is standing at, as pressing the grab key in-game does. A kerbal can only take hold of a ladder it is already alongside; it does not walk to one. :prop:`Control.Ladder` reports the one it ends up holding. Does nothing if the kerbal is already holding a ladder. :Game Scenes: Flight .. note:: Throws an exception if the vessel is not a kerbal on EVA, if there is no ladder within reach, or if the kerbal is doing something it cannot grab a ladder from. .. function:: void ReleaseLadder() Let go of the ladder the kerbal is holding, as pressing the jump key in-game does. Does nothing if it is not holding one. :Game Scenes: Flight .. note:: Throws an exception if the vessel is not a kerbal on EVA. .. struct:: ActionGroupAction An action, belonging to a part module, that is assigned to an action group. Obtained by calling :meth:`Control.GetActionGroupActions`. .. function:: ActionGroupAction(Part part, Module module, string name, string id) Construct a ActionGroupAction from the values of its fields. .. property:: Part Part { get; } The part that the action acts on. .. property:: Module Module { get; } The part module that the action belongs to. Returns ``null`` for a part-level action that is not associated with a module. This only occurs when the Extended Action Groups mod is installed, as it can assign actions defined directly on a part, rather than on one of its modules, to an action group. .. property:: string Name { get; } The human-readable name of the action, as shown in the action group editor. .. property:: string Id { get; } The non-localized identifier for the action. .. enum:: ControlState The control state of a vessel. See :prop:`Control.State`. .. enumerator:: Full Full controllable. .. enumerator:: Partial Partially controllable. .. enumerator:: None Not controllable. .. enum:: ControlSource The control source of a vessel. See :prop:`Control.Source`. .. enumerator:: Kerbal Vessel is controlled by a Kerbal. .. enumerator:: Probe Vessel is controlled by a probe core. .. enumerator:: None Vessel is not controlled. .. enum:: SASMode The behavior of the SAS auto-pilot. See :prop:`AutoPilot.SASMode`. .. enumerator:: StabilityAssist Stability assist mode. Dampen out any rotation. .. enumerator:: Maneuver Point in the burn direction of the next maneuver node. .. enumerator:: Prograde Point in the prograde direction. .. enumerator:: Retrograde Point in the retrograde direction. .. enumerator:: Normal Point in the orbit normal direction. .. enumerator:: AntiNormal Point in the orbit anti-normal direction. .. enumerator:: Radial Point in the orbit radial direction. .. enumerator:: AntiRadial Point in the orbit anti-radial direction. .. enumerator:: Target Point in the direction of the current target. .. enumerator:: AntiTarget Point away from the current target. .. enum:: SpeedMode The mode of the speed reported in the navball. See :prop:`Control.SpeedMode`. .. enumerator:: Orbit Speed is relative to the vessel's orbit. .. enumerator:: Surface Speed is relative to the surface of the body being orbited. .. enumerator:: Target Speed is relative to the current target. .. enum:: ControlInputMode See :prop:`Control.InputMode`. .. enumerator:: Additive Control inputs are added to the vessels current control inputs. .. enumerator:: Override Control inputs (when they are non-zero) override the vessels current control inputs.