Programacion con KOS – Variables

 

Nombres de variables Bound «Bound Variable Names»

Existen unas variables reservadas para controlar ciertas funciones especificas, dichas variables NO DEBEN usarse para otros fines que no sea los comentados a continuacion:


SHIP

Nombre de la variable:

Solo lectura (no permite Set, solo Get) : Si.

Tipo: Vessel

Descripcion: Whichever vessel happens to be the one containing the CPU part that is running this Kerboscript code at the moment. This is the CPU Vessel.


TARGET

Nombre de la variable:

Solo lectura (no permite Set, solo Get) :

Tipo: Vessel o Body.

Descripcion: Whichever Orbitable object happens to be the one selected as the current KSP target. If set to a string, it will assume the string is the name of a vessel being targeted and set it to a vessel by that name. For best results set it to Body(“some name”) or Vessel(“some name”) explicitly. This will throw an exception if called from a vessel other than the active vessel, as limitations in how KSP sets the target vessel limit the implementation to working with only the active vessel.


HASTARGET

Nombre de la variable:

Solo lectura (no permite Set, solo Get) : Si.

Tipo: boolean. (true o false).

Descripcion: Will return true if the ship has a target selected. This will always return false when not on the active vessel, due to limitations in how KSP sets the target vessel.


Diminutivos o atajos para acceder a las variables predefinidas de SHIP:

Variable Lo mismo que:
HEADING SHIP:HEADING
PROGRADE SHIP:PROGRADE
RETROGRADE SHIP:RETROGRADE
FACING SHIP:FACING
MAXTHRUST SHIP:MAXTHRUST
VELOCITY SHIP:VELOCITY
GEOPOSITION SHIP:GEOPOSITION
LATITUDE SHIP:LATITUDE
LONGITUDE SHIP:LONGITUDE
UP SHIP:UP
NORTH SHIP:NORTH
BODY SHIP:BODY
ANGULARMOMENTUM SHIP:ANGULARMOMENTUM
ANGULARVEL SHIP:ANGULARVEL
ANGULARVELOCITY SHIP:ANGULARVEL
MASS SHIP:MASS
VERTICALSPEED SHIP:VERTICALSPEED
GROUNDSPEED SHIP:GROUNDSPEED
SURFACESPEED This has been obsoleted as of kOS 0.18.0. Replace it with GROUNDSPEED.
AIRSPEED  SHIP:AIRSPEED
ALTITUDE SHIP:ALTITUDE
APOAPSIS SHIP:APOAPSIS
PERIAPSIS SHIP:PERIAPSIS
SENSORS SHIP:SENSORS
SRFPROGRADE SHIP:SRFPROGRADE
SRFREROGRADE SHIP:SRFREROGRADE
OBT SHIP:OBT
STATUS SHIP:STATUS
SHIPNAME SHIP:NAME