Waypoints#

class SpaceCenter.WaypointManager()#

Waypoints are the location markers you can see on the map view showing you where contracts are targeted for. With this structure, you can obtain coordinate data for the locations of these waypoints. Obtained by calling SpaceCenter.getWaypointManager().

WaypointManager.getWaypoints()#

A list of all existing waypoints.

Property:

Read-only, cannot be set

Return type:

Array of SpaceCenter.Waypoint

WaypointManager.addWaypoint(latitude, longitude, body, name)#

Creates a waypoint at the given position at ground level, and returns a SpaceCenter.Waypoint object that can be used to modify it.

Arguments:
  • latitude (number) – Latitude of the waypoint.

  • longitude (number) – Longitude of the waypoint.

  • body (SpaceCenter.CelestialBody) – Celestial body the waypoint is attached to.

  • name (string) – Name of the waypoint.

Return type:

SpaceCenter.Waypoint

WaypointManager.addWaypointAtAltitude(latitude, longitude, altitude, body, name)#

Creates a waypoint at the given position and altitude, and returns a SpaceCenter.Waypoint object that can be used to modify it.

Arguments:
  • latitude (number) – Latitude of the waypoint.

  • longitude (number) – Longitude of the waypoint.

  • altitude (number) – Altitude (above sea level) of the waypoint.

  • body (SpaceCenter.CelestialBody) – Celestial body the waypoint is attached to.

  • name (string) – Name of the waypoint.

Return type:

SpaceCenter.Waypoint

WaypointManager.getColors()#

An example map of known color - seed pairs. Any other integers may be used as seed.

Property:

Read-only, cannot be set

Return type:

Map from string to number

WaypointManager.getIcons()#

Returns all available icons (from “GameData/Squad/Contracts/Icons/”).

Property:

Read-only, cannot be set

Return type:

Array of string

class SpaceCenter.Waypoint()#

Represents a waypoint. Can be created using SpaceCenter.WaypointManager.addWaypoint().

Waypoint.getBody()#
Waypoint.setBody(value)#

The celestial body the waypoint is attached to.

Property:

Can be read or written

Return type:

SpaceCenter.CelestialBody

Game Scenes:

Flight

Waypoint.getName()#
Waypoint.setName(value)#

The name of the waypoint as it appears on the map and the contract.

Property:

Can be read or written

Return type:

string

Game Scenes:

Flight

Waypoint.getColor()#
Waypoint.setColor(value)#

The seed of the icon color. See SpaceCenter.WaypointManager.getColors() for example colors.

Property:

Can be read or written

Return type:

number

Game Scenes:

Flight

Waypoint.getIcon()#
Waypoint.setIcon(value)#

The icon of the waypoint.

Property:

Can be read or written

Return type:

string

Game Scenes:

Flight

Waypoint.getLatitude()#
Waypoint.setLatitude(value)#

The latitude of the waypoint.

Property:

Can be read or written

Return type:

number

Game Scenes:

Flight

Waypoint.getLongitude()#
Waypoint.setLongitude(value)#

The longitude of the waypoint.

Property:

Can be read or written

Return type:

number

Game Scenes:

Flight

Waypoint.getMeanAltitude()#
Waypoint.setMeanAltitude(value)#

The altitude of the waypoint above sea level, in meters.

Property:

Can be read or written

Return type:

number

Game Scenes:

Flight

Waypoint.getSurfaceAltitude()#
Waypoint.setSurfaceAltitude(value)#

The altitude of the waypoint above the surface of the body or sea level, whichever is closer, in meters.

Property:

Can be read or written

Return type:

number

Game Scenes:

Flight

Waypoint.getBedrockAltitude()#
Waypoint.setBedrockAltitude(value)#

The altitude of the waypoint above the surface of the body, in meters. When over water, this is the altitude above the sea floor.

Property:

Can be read or written

Return type:

number

Game Scenes:

Flight

Waypoint.getNearSurface()#

true if the waypoint is near to the surface of a body.

Property:

Read-only, cannot be set

Return type:

boolean

Game Scenes:

Flight

Waypoint.getGrounded()#

true if the waypoint is attached to the ground.

Property:

Read-only, cannot be set

Return type:

boolean

Game Scenes:

Flight

Waypoint.getIndex()#

The integer index of this waypoint within its cluster of sibling waypoints. In other words, when you have a cluster of waypoints called “Somewhere Alpha”, “Somewhere Beta” and “Somewhere Gamma”, the alpha site has index 0, the beta site has index 1 and the gamma site has index 2. When SpaceCenter.Waypoint.getClustered() is false, this is zero.

Property:

Read-only, cannot be set

Return type:

number

Game Scenes:

Flight

Waypoint.getClustered()#

true if this waypoint is part of a set of clustered waypoints with greek letter names appended (Alpha, Beta, Gamma, etc). If true, there is a one-to-one correspondence with the greek letter name and the SpaceCenter.Waypoint.getIndex().

Property:

Read-only, cannot be set

Return type:

boolean

Game Scenes:

Flight

Waypoint.getHasContract()#

Whether the waypoint belongs to a contract.

Property:

Read-only, cannot be set

Return type:

boolean

Game Scenes:

Flight

Waypoint.getContract()#

The associated contract.

Property:

Read-only, cannot be set

Return type:

SpaceCenter.Contract

Game Scenes:

Flight

Waypoint.remove()#

Removes the waypoint.

Game Scenes:

Flight

Note

Any further use of this object throws an exception.