Alarms#
- class AlarmManager#
Alarm manager. Obtained by calling
SpaceCenter.AlarmManager.- IList<Alarm> AlarmsWithType (AlarmType type)#
A list of all alarms of the given type.
- Parameters:
type – The type of alarm to return.
- Game Scenes:
All
- Alarm AlarmWithName (String 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:
name – The title of the alarm to return.
- Game Scenes:
All
- static Alarm AddAlarm (IConnection connection, Double time, String title = "Alarm", String description = "")#
Create an alarm.
- Parameters:
time – Number of seconds from now that the alarm should trigger.
title – Title for the alarm.
description – Description for the alarm.
- Game Scenes:
All
- static Alarm AddVesselAlarm (IConnection connection, Double time, Vessel vessel, String title = "Vessel Alarm", String description = "")#
Create an alarm linked to a vessel.
- Parameters:
time – Number of seconds from now that the alarm should trigger.
vessel – Vessel to link the alarm to.
title – Title for the alarm.
description – Description for the alarm.
- Game Scenes:
All
- static Alarm AddApoapsisAlarm (IConnection connection, Vessel vessel, Double offset = 60.0, String title = "Apoapsis Alarm", String description = "")#
Create an alarm for the given vessel’s next apoapsis.
- Parameters:
vessel – The vessel.
offset – Time in seconds to offset the alarm by.
title – Title for the alarm.
description – Description for the alarm.
- Game Scenes:
All
- static Alarm AddPeriapsisAlarm (IConnection connection, Vessel vessel, Double offset = 60.0, String title = "Periapsis Alarm", String description = "")#
Create an alarm for the given vessel’s next periapsis.
- Parameters:
vessel – The vessel.
offset – Time in seconds to offset the alarm by.
title – Title for the alarm.
description – Description for the alarm.
- Game Scenes:
All
- static Alarm AddManeuverNodeAlarm (IConnection connection, Vessel vessel, Node node, Double offset = 60.0, Boolean addBurnTime = true, String title = "Maneuver Node Alarm", String description = "")#
Create an alarm for the given vessel and maneuver node.
- Parameters:
vessel – The vessel.
node – The maneuver node.
offset – Time in seconds to offset the alarm by.
addBurnTime – Whether the node’s burn time should be included in the alarm.
title – Title for the alarm.
description – Description for the alarm.
- Game Scenes:
All
- static Alarm AddSOIAlarm (IConnection connection, Vessel vessel, Double offset = 60.0, String title = "SOI Change Alarm", String description = "")#
Create an alarm for the given vessel’s next sphere of influence change.
- Parameters:
vessel – The vessel.
offset – Time in seconds to offset the alarm by.
title – Title for the alarm.
description – Description for the alarm.
- Game Scenes:
All
- static Alarm AddTransferWindowAlarm (IConnection connection, Vessel vessel, CelestialBody target, String title = "Transfer Window Alarm", String description = "")#
Create an alarm for the next planetary transfer window from the vessel’s current parent body to the target body.
- Parameters:
vessel – The vessel.
target – The target body.
title – Title for the alarm.
description – Description for the alarm.
- Game Scenes:
All
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.
- class Alarm#
An alarm. Can be accessed using
SpaceCenter.AlarmManager.- UInt32 ID { get; }#
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.
- Game Scenes:
All
- Double EventOffset { get; set; }#
Seconds between the alarm going off and the event it references.
- Game Scenes:
All
- Vessel Vessel { get; }#
Vessel the alarm references.
nullif it does not reference a vessel.- Game Scenes:
All
- Node Node { get; set; }#
Maneuver node the alarm references. Only valid for alarms of type
AlarmType.Maneuver.- Game Scenes:
All
Note
Throws an exception if the alarm is not of type
AlarmType.Maneuver.
- CelestialBody OriginBody { get; set; }#
Origin body for the transfer window. Only valid for alarms of type
AlarmType.TransferWindow.- Game Scenes:
All
Note
Throws an exception if the alarm is not of type
AlarmType.TransferWindow.
- CelestialBody DestinationBody { get; set; }#
Destination body for the transfer window. Only valid for alarms of type
AlarmType.TransferWindow.- Game Scenes:
All
Note
Throws an exception if the alarm is not of type
AlarmType.TransferWindow.
- AlarmWarpAction WarpAction { get; set; }#
The action taken on time warp when the alarm fires.
- Game Scenes:
All
- AlarmMessageAction MessageAction { get; set; }#
The on-screen message behavior when the alarm fires.
- Game Scenes:
All
- Boolean DeleteOnDismiss { get; set; }#
Whether the alarm is deleted automatically once the player has dismissed the triggered message.
- Game Scenes:
All
- Boolean Triggered { get; }#
Whether the time of the alarm has passed and its actions have been triggered.
- Game Scenes:
All
- Boolean Actioned { get; }#
Whether the alarm’s actions were triggered and then completed or closed.
- Game Scenes:
All
- void Remove ()#
Removes the alarm.
- Game Scenes:
All
- enum AlarmType#
The type of an alarm. See
Alarm.Type.- 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.
- SOIChange#
An alarm for the next sphere of influence change on the vessel’s flight path.
- TransferWindow#
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.
- enum AlarmWarpAction#
The warp action taken when an alarm fires. See
Alarm.WarpAction.- NoChange#
Do not change time warp when the alarm fires.
- StopWarp#
Drop out of time warp when the alarm fires.
- PauseGame#
Pause the game when the alarm fires.
- enum AlarmMessageAction#
The on-screen message action taken when an alarm fires. See
Alarm.MessageAction.- NoMessage#
Do not display a message when the alarm fires.
- Message#
Display a message when the alarm fires.
- MessageIfNotActiveVessel#
Display a message only if the alarm’s vessel is not the currently active vessel.