Control#
- public 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
Vessel.getControl().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.
- ControlSource getSource()#
The source of the vessels control, for example by a kerbal or a probe core.
- Game Scenes:
Flight
- ControlState getState()#
The control state of the vessel.
- Game Scenes:
Flight
- boolean getSAS()#
- void setSAS(boolean value)#
The state of SAS.
- Game Scenes:
Flight
Note
Equivalent to
AutoPilot.getSAS(). Throws an exception if set totruewhile the auto-pilot is engaged, as the auto-pilot holds SAS off for as long as it is flying the vessel.
- void setSASMode(SASMode value)#
The current
Control.getSASMode(). 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
AutoPilot.getSASMode()
- void setSpeedMode(SpeedMode value)#
The current
Control.getSpeedMode()of the navball. This is the mode displayed next to the speed at the top of the navball.- Game Scenes:
Flight
- boolean getEngineGimbals()#
- void setEngineGimbals(boolean value)#
Returns whether all gimballed engines on the vessel have gimbal enabled, and sets the gimbal enabled state of all gimballed engines. See
Engine.getGimbalLocked().- Game Scenes:
Flight
- boolean getThrustReversers()#
- void setThrustReversers(boolean value)#
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
Engine.getThrustReversed().- Game Scenes:
Flight
- boolean getAeroSurfaces()#
- void setAeroSurfaces(boolean value)#
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
ControlSurface.getPitchEnabled(),ControlSurface.getYawEnabled()andControlSurface.getRollEnabled().- Game Scenes:
Flight
- boolean getRCS()#
- void setRCS(boolean value)#
The state of RCS.
- Game Scenes:
Flight
- boolean getReactionWheels()#
- void setReactionWheels(boolean value)#
Returns whether all reactive wheels on the vessel are active, and sets the active state of all reaction wheels. See
ReactionWheel.getActive().- Game Scenes:
Flight
- boolean getGear()#
- void setGear(boolean value)#
The state of the landing gear/legs.
- Game Scenes:
Flight
- boolean getLegs()#
- void setLegs(boolean value)#
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
Leg.getDeployed().- Game Scenes:
Flight
- boolean getWheels()#
- void setWheels(boolean value)#
Returns whether all wheels on the vessel are deployed, and sets the deployment state of all wheels. Does not include landing legs. See
Wheel.getDeployed().- Game Scenes:
Flight
- boolean getLights()#
- void setLights(boolean value)#
The state of the lights.
- Game Scenes:
Flight
- boolean getBrakes()#
- void setBrakes(boolean value)#
The state of the wheel brakes.
- Game Scenes:
Flight
- boolean getAntennas()#
- void setAntennas(boolean value)#
Returns whether all antennas on the vessel are deployed, and sets the deployment state of all antennas. See
Antenna.getDeployed().- Game Scenes:
Flight
- boolean getCargoBays()#
- void setCargoBays(boolean value)#
Returns whether any of the cargo bays on the vessel are open, and sets the open state of all cargo bays. See
CargoBay.getOpen().- Game Scenes:
Flight
- boolean getIntakes()#
- void setIntakes(boolean value)#
Returns whether all of the air intakes on the vessel are open, and sets the open state of all air intakes. See
Intake.getOpen().- Game Scenes:
Flight
- boolean getParachutes()#
- void setParachutes(boolean value)#
Returns whether all parachutes on the vessel are deployed, and sets the deployment state of all parachutes. Cannot be set to
false. SeeParachute.getDeployed().- Game Scenes:
Flight
- boolean getRadiators()#
- void setRadiators(boolean value)#
Returns whether all radiators on the vessel are deployed, and sets the deployment state of all radiators. See
Radiator.getDeployed().- Game Scenes:
Flight
- boolean getResourceHarvesters()#
- void setResourceHarvesters(boolean value)#
Returns whether all of the resource harvesters on the vessel are deployed, and sets the deployment state of all resource harvesters. See
ResourceHarvester.getDeployed().- Game Scenes:
Flight
- boolean getResourceHarvestersActive()#
- void setResourceHarvestersActive(boolean value)#
Returns whether any of the resource harvesters on the vessel are active, and sets the active state of all resource harvesters. See
ResourceHarvester.getActive().- Game Scenes:
Flight
- boolean getSolarPanels()#
- void setSolarPanels(boolean value)#
Returns whether all solar panels on the vessel are deployed, and sets the deployment state of all solar panels. See
SolarPanel.getDeployed().- Game Scenes:
Flight
- boolean getAbort()#
- void setAbort(boolean value)#
The state of the abort action group.
- Game Scenes:
Flight
- float getThrottle()#
- void setThrottle(float value)#
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.
- ControlInputMode getInputMode()#
- void setInputMode(ControlInputMode value)#
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
- float getPitch()#
- void setPitch(float value)#
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.
- float getYaw()#
- void setYaw(float value)#
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.
- float getRoll()#
- void setRoll(float value)#
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.
- float getPitchTrim()#
- void setPitchTrim(float value)#
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
- float getYawTrim()#
- void setYawTrim(float value)#
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
- float getRollTrim()#
- void setRollTrim(float value)#
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
- float getForward()#
- void setForward(float value)#
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.
- float getUp()#
- void setUp(float value)#
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.
- float getRight()#
- void setRight(float value)#
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.
- float getWheelThrottle()#
- void setWheelThrottle(float value)#
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.
- float getWheelSteering()#
- void setWheelSteering(float value)#
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.
- float getCustomAxis01()#
- void setCustomAxis01(float value)#
The state of CustomAxis01. A value between -1 and 1.
- Game Scenes:
Flight
- float getCustomAxis02()#
- void setCustomAxis02(float value)#
The state of CustomAxis02. A value between -1 and 1.
- Game Scenes:
Flight
- float getCustomAxis03()#
- void setCustomAxis03(float value)#
The state of CustomAxis03. A value between -1 and 1.
- Game Scenes:
Flight
- float getCustomAxis04()#
- void setCustomAxis04(float value)#
The state of CustomAxis04. A value between -1 and 1.
- Game Scenes:
Flight
- int getCurrentStage()#
The current stage of the vessel. Corresponds to the stage number in the in-game UI.
- Game Scenes:
Flight
- java.util.List<Vessel> 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
getActiveVessel()no longer refer to the active vessel. Throws an exception if staging is locked.
- boolean getStageLock()#
- void setStageLock(boolean value)#
Whether staging is locked on the vessel.
- Game Scenes:
Flight
Note
This is equivalent to locking the staging using Alt+L
- boolean getActionGroup(int group)#
Returns
trueif the given action group is enabled.- Parameters:
group (
int) – A number between 0 and 9 inclusive, or between 0 and 250 inclusive when the Extended Action Groups mod is installed.
- Game Scenes:
Flight
- void setActionGroup(int group, boolean state)#
Sets the state of the given action group.
- Parameters:
group (
int) –A number between 0 and 9 inclusive, or between 0 and 250 inclusive when the Extended Action Groups mod is installed.
state (
boolean)
- Game Scenes:
Flight
- void toggleActionGroup(int group)#
Toggles the state of the given action group.
- Parameters:
group (
int) –A number between 0 and 9 inclusive, or between 0 and 250 inclusive when the Extended Action Groups mod is installed.
- Game Scenes:
Flight
- java.util.List<ActionGroupAction> getActionGroupActions(int 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 (
int) –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.
- Node addNode(double ut, float prograde, float normal, float radial)#
Creates a maneuver node at the given universal time, and returns a
Nodeobject 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 (
double) – Universal time of the maneuver node.prograde (
float) – Delta-v in the prograde direction.normal (
float) – Delta-v in the normal direction.radial (
float) – Delta-v in the radial direction.
- Game Scenes:
Flight
- java.util.List<Node> getNodes()#
Returns a list of all existing maneuver nodes, ordered by time from first to last.
- Game Scenes:
Flight
- void removeNodes()#
Remove all maneuver nodes.
- Game Scenes:
Flight
- public class ActionGroupAction#
An action, belonging to a part module, that is assigned to an action group. Obtained by calling
Control.getActionGroupActions(int).- Module getModule()#
The part module that the action belongs to. Returns
nullfor 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.
- public enum ControlState#
The control state of a vessel. See
Control.getState().- public ControlState FULL#
Full controllable.
- public ControlState PARTIAL#
Partially controllable.
- public ControlState NONE#
Not controllable.
- public enum ControlSource#
The control source of a vessel. See
Control.getSource().- public ControlSource KERBAL#
Vessel is controlled by a Kerbal.
- public ControlSource PROBE#
Vessel is controlled by a probe core.
- public ControlSource NONE#
Vessel is not controlled.
- public enum SASMode#
The behavior of the SAS auto-pilot. See
AutoPilot.getSASMode().
- public enum SpeedMode#
The mode of the speed reported in the navball. See
Control.getSpeedMode().
- public enum ControlInputMode#
-
- public ControlInputMode ADDITIVE#
Control inputs are added to the vessels current control inputs.
- public ControlInputMode OVERRIDE#
Control inputs (when they are non-zero) override the vessels current control inputs.