Alarms#
AlarmManager
Alarm manager.
Obtained by calling GET /space-center/alarm-manager.
A AlarmManager object is passed and returned as its identifier, a number. A path that acts on
an object takes it as (id).
- GET /space-center/alarm-manager/(id)/alarms#
A list of all alarms.
- Parameters:
id – The identifier of the AlarmManager object.
- Response JSON Object:
value (list<SpaceCenter.Alarm>)
- POST /space-center/alarm-manager/(id)/alarms-with-type#
A list of all alarms of the given type.
- Parameters:
id – The identifier of the AlarmManager object.
- Request JSON Object:
type (SpaceCenter.AlarmType) – The type of alarm to return.
- Response JSON Object:
value (list<SpaceCenter.Alarm>)
- POST /space-center/alarm-manager/(id)/alarm-with-name#
Returns the first alarm with the given title, or
nullif no such alarm exists. Alarm titles are not guaranteed to be unique; if more than one alarm shares the given title, the first one found is returned.- Parameters:
id – The identifier of the AlarmManager object.
- Request JSON Object:
name (string) – The title of the alarm to return.
- Response JSON Object:
value (SpaceCenter.Alarm?)
- POST /space-center/alarm-manager/add-alarm#
Create an alarm.
- Request JSON Object:
time (double) – Number of seconds from now that the alarm should trigger.
title (string) – Title for the alarm. Optional, defaults to
"Alarm".description (string) – Description for the alarm. Optional, defaults to
"".
- Response JSON Object:
value (SpaceCenter.Alarm)
- POST /space-center/alarm-manager/add-vessel-alarm#
Create an alarm linked to a vessel.
- Request JSON Object:
time (double) – Number of seconds from now that the alarm should trigger.
vessel (SpaceCenter.Vessel) – Vessel to link the alarm to.
title (string) – Title for the alarm. Optional, defaults to
"Vessel Alarm".description (string) – Description for the alarm. Optional, defaults to
"".
- Response JSON Object:
value (SpaceCenter.Alarm)
- POST /space-center/alarm-manager/add-apoapsis-alarm#
Create an alarm for the given vessel’s next apoapsis.
- Request JSON Object:
vessel (SpaceCenter.Vessel) – The vessel.
offset (double) – Time in seconds to offset the alarm by. Optional, defaults to
60.0.title (string) – Title for the alarm. Optional, defaults to
"Apoapsis Alarm".description (string) – Description for the alarm. Optional, defaults to
"".
- Response JSON Object:
value (SpaceCenter.Alarm)
- POST /space-center/alarm-manager/add-periapsis-alarm#
Create an alarm for the given vessel’s next periapsis.
- Request JSON Object:
vessel (SpaceCenter.Vessel) – The vessel.
offset (double) – Time in seconds to offset the alarm by. Optional, defaults to
60.0.title (string) – Title for the alarm. Optional, defaults to
"Periapsis Alarm".description (string) – Description for the alarm. Optional, defaults to
"".
- Response JSON Object:
value (SpaceCenter.Alarm)
- POST /space-center/alarm-manager/add-maneuver-node-alarm#
Create an alarm for the given vessel and maneuver node.
- Request JSON Object:
vessel (SpaceCenter.Vessel) – The vessel.
node (SpaceCenter.Node) – The maneuver node.
offset (double) – Time in seconds to offset the alarm by. Optional, defaults to
60.0.add_burn_time (bool) – Whether the node’s burn time should be included in the alarm. Optional, defaults to
true.title (string) – Title for the alarm. Optional, defaults to
"Maneuver Node Alarm".description (string) – Description for the alarm. Optional, defaults to
"".
- Response JSON Object:
value (SpaceCenter.Alarm)
- POST /space-center/alarm-manager/add-soi-alarm#
Create an alarm for the given vessel’s next sphere of influence change.
- Request JSON Object:
vessel (SpaceCenter.Vessel) – The vessel.
offset (double) – Time in seconds to offset the alarm by. Optional, defaults to
60.0.title (string) – Title for the alarm. Optional, defaults to
"SOI Change Alarm".description (string) – Description for the alarm. Optional, defaults to
"".
- Response JSON Object:
value (SpaceCenter.Alarm)
- POST /space-center/alarm-manager/add-transfer-window-alarm#
Create an alarm for the next planetary transfer window from the vessel’s current parent body to the target body.
Note
This relies on KSP’s stock transfer-window alarm logic. If KSP cannot compute a transfer from the vessel’s current parent body to the target, the resulting alarm may not fire at a useful time; in that case the properties on the returned alarm can still be used to inspect or adjust it.
- Request JSON Object:
vessel (SpaceCenter.Vessel) – The vessel.
target (SpaceCenter.CelestialBody) – The target body.
title (string) – Title for the alarm. Optional, defaults to
"Transfer Window Alarm".description (string) – Description for the alarm. Optional, defaults to
"".
- Response JSON Object:
value (SpaceCenter.Alarm)
Alarm
An alarm. Can be accessed using GET /space-center/alarm-manager.
A Alarm object is passed and returned as its identifier, a number. A path that acts on
an object takes it as (id).
- GET /space-center/alarm/(id)/id#
Unique identifier of the alarm. KSP destroys and recreates an alarm when it is edited. This id will remain constant between the old and new alarms.
- Parameters:
id – The identifier of the Alarm object.
- Response JSON Object:
value (uint32)
- GET /space-center/alarm/(id)/type#
Type of alarm.
- Parameters:
id – The identifier of the Alarm object.
- Response JSON Object:
value (SpaceCenter.AlarmType)
- GET /space-center/alarm/(id)/title#
Title of the alarm.
- Parameters:
id – The identifier of the Alarm object.
- Response JSON Object:
value (string)
- PUT /space-center/alarm/(id)/title#
Title of the alarm.
- Parameters:
id – The identifier of the Alarm object.
- Request JSON Object:
value (string) – The new value.
- GET /space-center/alarm/(id)/description#
Description of the alarm.
- Parameters:
id – The identifier of the Alarm object.
- Response JSON Object:
value (string)
- PUT /space-center/alarm/(id)/description#
Description of the alarm.
- Parameters:
id – The identifier of the Alarm object.
- Request JSON Object:
value (string) – The new value.
- GET /space-center/alarm/(id)/time#
Time the alarm will trigger, in seconds since epoch.
- Parameters:
id – The identifier of the Alarm object.
- Response JSON Object:
value (double)
- PUT /space-center/alarm/(id)/time#
Time the alarm will trigger, in seconds since epoch.
- Parameters:
id – The identifier of the Alarm object.
- Request JSON Object:
value (double) – The new value.
- GET /space-center/alarm/(id)/time-until#
Time until the alarm triggers, in seconds.
- Parameters:
id – The identifier of the Alarm object.
- Response JSON Object:
value (double)
- GET /space-center/alarm/(id)/event-offset#
Seconds between the alarm going off and the event it references.
Note
For a maneuver alarm that includes the burn time, setting this sets the margin before the start of the burn, and the value read back includes half the burn time.
- Parameters:
id – The identifier of the Alarm object.
- Response JSON Object:
value (double)
- PUT /space-center/alarm/(id)/event-offset#
Seconds between the alarm going off and the event it references.
Note
For a maneuver alarm that includes the burn time, setting this sets the margin before the start of the burn, and the value read back includes half the burn time.
- Parameters:
id – The identifier of the Alarm object.
- Request JSON Object:
value (double) – The new value.
- GET /space-center/alarm/(id)/vessel#
Vessel the alarm references.
nullif it does not reference a vessel.- Parameters:
id – The identifier of the Alarm object.
- Response JSON Object:
value (SpaceCenter.Vessel?)
- GET /space-center/alarm/(id)/node#
Maneuver node the alarm references. Only valid for alarms of type
"maneuver".Note
Throws an exception if the alarm is not of type
"maneuver".- Parameters:
id – The identifier of the Alarm object.
- Response JSON Object:
value (SpaceCenter.Node)
- PUT /space-center/alarm/(id)/node#
Maneuver node the alarm references. Only valid for alarms of type
"maneuver".Note
Throws an exception if the alarm is not of type
"maneuver".- Parameters:
id – The identifier of the Alarm object.
- Request JSON Object:
value (SpaceCenter.Node) – The new value.
- GET /space-center/alarm/(id)/origin-body#
Origin body for the transfer window. Only valid for alarms of type
"transfer_window".Note
Throws an exception if the alarm is not of type
"transfer_window".- Parameters:
id – The identifier of the Alarm object.
- Response JSON Object:
value (SpaceCenter.CelestialBody)
- PUT /space-center/alarm/(id)/origin-body#
Origin body for the transfer window. Only valid for alarms of type
"transfer_window".Note
Throws an exception if the alarm is not of type
"transfer_window".- Parameters:
id – The identifier of the Alarm object.
- Request JSON Object:
value (SpaceCenter.CelestialBody) – The new value.
- GET /space-center/alarm/(id)/destination-body#
Destination body for the transfer window. Only valid for alarms of type
"transfer_window".Note
Throws an exception if the alarm is not of type
"transfer_window".- Parameters:
id – The identifier of the Alarm object.
- Response JSON Object:
value (SpaceCenter.CelestialBody)
- PUT /space-center/alarm/(id)/destination-body#
Destination body for the transfer window. Only valid for alarms of type
"transfer_window".Note
Throws an exception if the alarm is not of type
"transfer_window".- Parameters:
id – The identifier of the Alarm object.
- Request JSON Object:
value (SpaceCenter.CelestialBody) – The new value.
- GET /space-center/alarm/(id)/warp-action#
The action taken on time warp when the alarm fires.
- Parameters:
id – The identifier of the Alarm object.
- Response JSON Object:
value (SpaceCenter.AlarmWarpAction)
- PUT /space-center/alarm/(id)/warp-action#
The action taken on time warp when the alarm fires.
- Parameters:
id – The identifier of the Alarm object.
- Request JSON Object:
value (SpaceCenter.AlarmWarpAction) – The new value.
- GET /space-center/alarm/(id)/message-action#
The on-screen message behavior when the alarm fires.
- Parameters:
id – The identifier of the Alarm object.
- Response JSON Object:
value (SpaceCenter.AlarmMessageAction)
- PUT /space-center/alarm/(id)/message-action#
The on-screen message behavior when the alarm fires.
- Parameters:
id – The identifier of the Alarm object.
- Request JSON Object:
value (SpaceCenter.AlarmMessageAction) – The new value.
- GET /space-center/alarm/(id)/play-sound#
Whether the alarm plays a sound when it fires.
- Parameters:
id – The identifier of the Alarm object.
- Response JSON Object:
value (bool)
- PUT /space-center/alarm/(id)/play-sound#
Whether the alarm plays a sound when it fires.
- Parameters:
id – The identifier of the Alarm object.
- Request JSON Object:
value (bool) – The new value.
- GET /space-center/alarm/(id)/delete-on-dismiss#
Whether the alarm is deleted automatically once the player has dismissed the triggered message.
- Parameters:
id – The identifier of the Alarm object.
- Response JSON Object:
value (bool)
- PUT /space-center/alarm/(id)/delete-on-dismiss#
Whether the alarm is deleted automatically once the player has dismissed the triggered message.
- Parameters:
id – The identifier of the Alarm object.
- Request JSON Object:
value (bool) – The new value.
- GET /space-center/alarm/(id)/triggered#
Whether the time of the alarm has passed and its actions have been triggered.
- Parameters:
id – The identifier of the Alarm object.
- Response JSON Object:
value (bool)
- GET /space-center/alarm/(id)/actioned#
Whether the alarm’s actions were triggered and then completed or closed.
- Parameters:
id – The identifier of the Alarm object.
- Response JSON Object:
value (bool)
- POST /space-center/alarm/(id)/remove#
Removes the alarm.
Note
Any further use of this object throws an exception.
- Parameters:
id – The identifier of the Alarm object.
AlarmType
The type of an alarm. See GET /space-center/alarm/(id)/type.
Passed and returned as the name of one of its values:
"raw"An alarm for a specific date/time or a specific period in the future.
"apoapsis"An alarm for the next apoapsis of a vessel.
"periapsis"An alarm for the next periapsis of a vessel.
"maneuver"An alarm based on a maneuver node on the vessel’s flight path.
"soi_change"An alarm for the next sphere of influence change on the vessel’s flight path.
"transfer_window"An alarm for the next planetary transfer window from the vessel’s current orbit to a target body.
"unknown"The alarm is of a type not recognized by kRPC. Typically this is a type introduced by a mod.
AlarmWarpAction
The warp action taken when an alarm fires.
See GET /space-center/alarm/(id)/warp-action.
Passed and returned as the name of one of its values:
"no_change"Do not change time warp when the alarm fires.
"stop_warp"Drop out of time warp when the alarm fires.
"pause_game"Pause the game when the alarm fires.
AlarmMessageAction
The on-screen message action taken when an alarm fires.
See GET /space-center/alarm/(id)/message-action.
Passed and returned as the name of one of its values:
"no_message"Do not display a message when the alarm fires.
"message"Display a message when the alarm fires.
"message_if_not_active_vessel"Display a message only if the alarm’s vessel is not the currently active vessel.