KSP API
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties
Public Member Functions | Public Attributes | List of all members
ModuleScienceExperiment Class Reference

Part module for initiating and describing science experiments. More...

Inheritance diagram for ModuleScienceExperiment:
PartModule IScienceDataContainer

Public Member Functions

 ModuleScienceExperiment ()
 
void CollectDataExternalEvent ()
 Transfers data from the part to an EVA Kerbal. More...
 
void DeployAction (KSPActionParam actParams)
 Initiates the experiment from an action group. More...
 
void DeployExperiment ()
 Initiates the experiment from a right-click button. More...
 
void DumpData (ScienceData data)
 Removes science data from the part, called after transmission. Implements IScienceDataContainer. More...
 
ScienceData[] GetData ()
 Returns all Science Data stored in the module. Implements IScienceDataContainer. More...
 
int GetScienceCount ()
 A count of how many Science Data reports are stored in the module. Implements IScienceDataContainer. More...
 
bool IsRerunnable ()
 Is the experiment rerunnable? Refers to rerunnable field. Implements IScienceDataContainer. More...
 
override void OnActive ()
 This function is called once when the part gets activated. More...
 
override void OnAwake ()
 This function gets called only once, during the KSP loading screen. See the Unity documentation on Awake for more information. More...
 
void OnDestroy ()
 
override void OnLoad (ConfigNode node)
 Stores any Science Data in the persistent file. More...
 
override void OnSave (ConfigNode node)
 Loads any Science Data stored in the persistent file. More...
 
override void OnStart (PartModule.StartState state)
 Called when the flight starts, or when the part is created in the editor. OnStart will be called before OnUpdate or OnFixedUpdate are ever called. More...
 
void OnVesselSituationChange (GameEvents.HostedFromToAction< Vessel, Vessel.Situations > vcs)
 
void ResetAction (KSPActionParam actParams)
 Resets the experiment from an action group. Science Data is lost. Experiment can be re-run. More...
 
void ResetExperiment ()
 Resets the experiment from a right-click button. Science Data is lost. Experiment can be re-run. More...
 
void ResetExperimentExternal ()
 Resets the experiment from an EVA right-click button. Science Data is lost. Experiment can be re-run. More...
 
void ReviewData ()
 Opens experimental results dialog. Implements IScienceDataContainer. More...
 
void ReviewDataEvent ()
 Review stored Science Data from a right-click button. More...
 
void ReviewDataItem (ScienceData data)
 Review individual Science Data reports? Implements IScienceDataContainer. More...
 
void SetInoperable ()
 Sets the Inoperable bool, determines whether experiment can be performed again. More...
 
- Public Member Functions inherited from PartModule
 PartModule ()
 
virtual string GetInfo ()
 The return value of this function appears in the part's description in the editor. More...
 
void Load (ConfigNode node)
 
virtual void OnFixedUpdate ()
 This function gets called once every Unity FixedUpdate cycle (once per physics frame) once the part has been activated. If you want to be called even if the part has not been activated, define a function called void FixedUpdate() instead of overriding OnFixedUpdate More...
 
virtual void OnInactive ()
 When does this get called? More...
 
virtual void OnUpdate ()
 Called once per Unity Update cycle once the part has been activated. If you want to be called even if the part has not been activated, define a function called void Update() instead of overriding OnFixedUpdate. More...
 
void Save (ConfigNode node)
 

Public Attributes

string collectActionName
 Name for the right-click option to collect science data from the part while on EVA. More...
 
string collectWarningText
 Text for warning pop-up while collecting science data from a non-repeatable experiment while on EVA. More...
 
bool dataIsCollectable
 Is EVA science data collection available? More...
 
bool Deployed
 
ScienceExperiment experiment
 The relevant experiment based on experimentID and info from ScienceDefs file. More...
 
string experimentActionName
 Right-click and action group name for initiating experiment. More...
 
string experimentID
 Must match applicable ID field in the ScienceDefs.cfg file. More...
 
int[] fxModuleIndices
 Set to 1 to trigger animation in ModuleAnimateGeneric on activation. More...
 
bool hideUIwhenUnavailable
 Hide right-click experiment button when experiment cannot be performed. More...
 
bool Inoperable
 Can the experiment be performed? Only relevant for non-rerunnable experiments. More...
 
float interactionRange
 EVA interaction range for data collection or experiment reset. More...
 
bool rerunnable
 Can the experiment be run more than once before requiring Science Lab reset? More...
 
string resetActionName
 Right-click, action group, and EVA button name to reset the experiment, science data will be lost. More...
 
bool resettable
 
bool resettableOnEVA
 Can the experiment be reset on EVA? Science data will be lost. More...
 
float resourceResetCost
 Cost for cleaning the experiment at the science lab. Units * dataScale * baseValue? More...
 
string resourceToReset
 Resource to be used for cleaning the experiment at the science lab. More...
 
string reviewActionName
 Right-click and action group name for reviewing collected science data. More...
 
string transmitWarningText
 Warning displayed before transmitting data from a non-rerunnable experiment. More...
 
bool useActionGroups
 Allow action groups to be set for the experiment, rather than right-click buttons only. More...
 
bool useStaging
 
float xmitDataScalar
 Percentage of data allowed to be transmitted, 1 equals the amount gained from returning the sample to Kerbin. More...
 
- Public Attributes inherited from PartModule
bool isEnabled
 
string moduleName
 
ProtoPartModuleSnapshot snapshot
 

Additional Inherited Members

- Public Types inherited from PartModule
enum  StartState {
  StartState.None = 0, StartState.Editor = 1, StartState.PreLaunch = 2, StartState.Landed = 4,
  StartState.Docked = 8, StartState.Flying = 16, StartState.Splashed = 32, StartState.SubOrbital = 64,
  StartState.Orbital = 128
}
 A StartState is passed on OnStart in order to provide the PartModule with some information about where it is starting up. More...
 
- Properties inherited from PartModule
BaseActionList Actions [get]
 A list of KSPActions which can be added to action groups. More...
 
int ClassID [get]
 A hash of ClassName? More...
 
string ClassName [get]
 In any subclass of PartModule, ClassName will be the name of the subclass. It gets set by the PartModule loading process. More...
 
BaseEventList Events [get]
 A list of KSPEvents, which can be triggered by code or by the user through the part's right-click menu. More...
 
BaseFieldList Fields [get]
 A list of the KSPFields which the module loads from the part.cfg file. More...
 
string GUIName [get]
 
Part part [get, set]
 The Part to which this PartModule is attached. Use this to reference the part from your module code. More...
 
Vessel vessel [get]
 The Vessel of the Part to which this PartModule is attached. More...
 

Detailed Description

Part module for initiating and describing science experiments.

Constructor & Destructor Documentation

ModuleScienceExperiment.ModuleScienceExperiment ( )

Member Function Documentation

void ModuleScienceExperiment.CollectDataExternalEvent ( )

Transfers data from the part to an EVA Kerbal.

void ModuleScienceExperiment.DeployAction ( KSPActionParam  actParams)

Initiates the experiment from an action group.

Parameters
actParams
void ModuleScienceExperiment.DeployExperiment ( )

Initiates the experiment from a right-click button.

void ModuleScienceExperiment.DumpData ( ScienceData  data)

Removes science data from the part, called after transmission. Implements IScienceDataContainer.

Parameters
dataThe Science Data to be removed

Implements IScienceDataContainer.

ScienceData [] ModuleScienceExperiment.GetData ( )

Returns all Science Data stored in the module. Implements IScienceDataContainer.

Returns

Implements IScienceDataContainer.

int ModuleScienceExperiment.GetScienceCount ( )

A count of how many Science Data reports are stored in the module. Implements IScienceDataContainer.

Returns

Implements IScienceDataContainer.

bool ModuleScienceExperiment.IsRerunnable ( )

Is the experiment rerunnable? Refers to rerunnable field. Implements IScienceDataContainer.

Returns

Implements IScienceDataContainer.

override void ModuleScienceExperiment.OnActive ( )
virtual

This function is called once when the part gets activated.

Reimplemented from PartModule.

override void ModuleScienceExperiment.OnAwake ( )
virtual

This function gets called only once, during the KSP loading screen. See the Unity documentation on Awake for more information.

Reimplemented from PartModule.

void ModuleScienceExperiment.OnDestroy ( )
override void ModuleScienceExperiment.OnLoad ( ConfigNode  node)
virtual

Stores any Science Data in the persistent file.

Parameters
node

Reimplemented from PartModule.

override void ModuleScienceExperiment.OnSave ( ConfigNode  node)
virtual

Loads any Science Data stored in the persistent file.

Parameters
node

Reimplemented from PartModule.

override void ModuleScienceExperiment.OnStart ( PartModule.StartState  state)
virtual

Called when the flight starts, or when the part is created in the editor. OnStart will be called before OnUpdate or OnFixedUpdate are ever called.

Parameters
stateSome information about what situation the vessel is starting in.

Reimplemented from PartModule.

void ModuleScienceExperiment.OnVesselSituationChange ( GameEvents.HostedFromToAction< Vessel, Vessel.Situations vcs)
void ModuleScienceExperiment.ResetAction ( KSPActionParam  actParams)

Resets the experiment from an action group. Science Data is lost. Experiment can be re-run.

Parameters
actParams
void ModuleScienceExperiment.ResetExperiment ( )

Resets the experiment from a right-click button. Science Data is lost. Experiment can be re-run.

void ModuleScienceExperiment.ResetExperimentExternal ( )

Resets the experiment from an EVA right-click button. Science Data is lost. Experiment can be re-run.

void ModuleScienceExperiment.ReviewData ( )

Opens experimental results dialog. Implements IScienceDataContainer.

Implements IScienceDataContainer.

void ModuleScienceExperiment.ReviewDataEvent ( )

Review stored Science Data from a right-click button.

void ModuleScienceExperiment.ReviewDataItem ( ScienceData  data)

Review individual Science Data reports? Implements IScienceDataContainer.

Parameters
data

Implements IScienceDataContainer.

void ModuleScienceExperiment.SetInoperable ( )

Sets the Inoperable bool, determines whether experiment can be performed again.

Member Data Documentation

string ModuleScienceExperiment.collectActionName

Name for the right-click option to collect science data from the part while on EVA.

string ModuleScienceExperiment.collectWarningText

Text for warning pop-up while collecting science data from a non-repeatable experiment while on EVA.

bool ModuleScienceExperiment.dataIsCollectable

Is EVA science data collection available?

bool ModuleScienceExperiment.Deployed
ScienceExperiment ModuleScienceExperiment.experiment

The relevant experiment based on experimentID and info from ScienceDefs file.

string ModuleScienceExperiment.experimentActionName

Right-click and action group name for initiating experiment.

string ModuleScienceExperiment.experimentID

Must match applicable ID field in the ScienceDefs.cfg file.

int [] ModuleScienceExperiment.fxModuleIndices

Set to 1 to trigger animation in ModuleAnimateGeneric on activation.

bool ModuleScienceExperiment.hideUIwhenUnavailable

Hide right-click experiment button when experiment cannot be performed.

bool ModuleScienceExperiment.Inoperable

Can the experiment be performed? Only relevant for non-rerunnable experiments.

float ModuleScienceExperiment.interactionRange

EVA interaction range for data collection or experiment reset.

bool ModuleScienceExperiment.rerunnable

Can the experiment be run more than once before requiring Science Lab reset?

string ModuleScienceExperiment.resetActionName

Right-click, action group, and EVA button name to reset the experiment, science data will be lost.

bool ModuleScienceExperiment.resettable
bool ModuleScienceExperiment.resettableOnEVA

Can the experiment be reset on EVA? Science data will be lost.

float ModuleScienceExperiment.resourceResetCost

Cost for cleaning the experiment at the science lab. Units * dataScale * baseValue?

string ModuleScienceExperiment.resourceToReset

Resource to be used for cleaning the experiment at the science lab.

string ModuleScienceExperiment.reviewActionName

Right-click and action group name for reviewing collected science data.

string ModuleScienceExperiment.transmitWarningText

Warning displayed before transmitting data from a non-rerunnable experiment.

bool ModuleScienceExperiment.useActionGroups

Allow action groups to be set for the experiment, rather than right-click buttons only.

bool ModuleScienceExperiment.useStaging
float ModuleScienceExperiment.xmitDataScalar

Percentage of data allowed to be transmitted, 1 equals the amount gained from returning the sample to Kerbin.


The documentation for this class was generated from the following file: