Computer#

class Computer#

The Raster Prop Monitor computer of a part, which holds the variables its props show. Obtained by calling computer() or computers().

part#

The part the computer is on.

Attribute:

Read-only, cannot be set

Return type:

SpaceCenter.Part

Game Scenes:

Flight

persistent_variable(name)#

The value of a persistent variable of the part, or else of the vessel, or None if neither is set. Props read it as PERSISTENT_name.

Parameters:

name (str) – The name of the variable, without the PERSISTENT_ prefix.

Return type:

float or None

Game Scenes:

Flight

set_persistent_variable(name, value)#

Set a persistent variable of the part. The props that show it update.

Parameters:
  • name (str) – The name of the variable, without the PERSISTENT_ prefix.

  • value (float) – The value.

Game Scenes:

Flight

remove_persistent_variable(name)#

Remove a persistent variable of the part. The props that show it update.

Parameters:

name (str) – The name of the variable, without the PERSISTENT_ prefix.

Game Scenes:

Flight

persistent_variable_changed(name)#

An event that fires when Computer.persistent_variable() changes, such as when a switch in the IVA sets it. The event lasts until it is removed.

Parameters:

name (str) – The name of the variable, without the PERSISTENT_ prefix.

Return type:

krpc.event.Event

Game Scenes:

Flight

variable_type(name)#

The type of a variable’s current value. Throws an exception if Raster Prop Monitor does not recognize the variable.

Parameters:

name (str) – The name of the variable, e.g. ALTITUDE.

Return type:

VariableType

Game Scenes:

Flight

number_variable(name)#

The value of a number variable. Raster Prop Monitor gives a boolean as 0 or 1. Throws an exception if Raster Prop Monitor does not recognize the variable, or its value is a string.

Parameters:

name (str) – The name of the variable, e.g. ALTITUDE.

Return type:

float

Game Scenes:

Flight

string_variable(name)#

The value of a variable as a string. A number gives its invariant culture string. Throws an exception if Raster Prop Monitor does not recognize the variable.

Parameters:

name (str) – The name of the variable, e.g. ALTITUDE.

Return type:

str

Game Scenes:

Flight

format_variables(text)#

Text with its variables formatted as a monitor page formats them, e.g. {0:SIP6.1}m $&$ ALTITUDE. Each line takes its own variables. Throws an exception if Raster Prop Monitor does not recognize a variable, or a format is invalid.

Parameters:

text (str) – The text, in the format of a monitor page.

Return type:

str

Game Scenes:

Flight

class VariableType#

The type of a Raster Prop Monitor variable. See Computer.variable_type().

number#

A number. Access using Computer.number_variable().

string#

A string. Access using Computer.string_variable().