Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | Properties | List of all members
ProtoCrewMember Class Reference

Crew member prototype More...

Public Types

enum  Gender { Gender.Male, Gender.Female }
 
enum  KerbalSuit { KerbalSuit.Default, KerbalSuit.Vintage, KerbalSuit.Future, KerbalSuit.Slim }
 
enum  KerbalType { KerbalType.Crew, KerbalType.Applicant, KerbalType.Unowned, KerbalType.Tourist }
 
enum  RosterStatus { RosterStatus.Available, RosterStatus.Assigned, RosterStatus.Dead, RosterStatus.Missing }
 

Public Member Functions

void ActiveFixedUpdate (Part p)
 Run for PCMs on an active part in flight (packed or unpacked). Called by part.FixedUpdate Does G checking (if enabled). Then calls the callbacks. More...
 
void ActiveUpdate (Part p)
 Run for PCMs on an active part in flight (packed or unpacked). Called by part.Update Calls the callbacks. More...
 
void ArchiveFlightLog ()
 
float CalculateExperiencePoints (Game game)
 
float CalculateExperiencePoints (GameParameters parameters, Game.Modes mode)
 
bool ChangeName (string newName)
 
bool CheckActive (double ut)
 
void CheckRespawnTimer (double UT, GameParameters gameParameters)
 
void Die ()
 Sets this crewmember as dead More...
 
delegate double doubleDelegatePCM (ProtoCrewMember pcm)
 
override bool Equals (object obj)
 
ExperienceEffect GetEffect (string effect)
 
GetEffect< T > ()
 
override int GetHashCode ()
 
string GetKerbalEVAPartName ()
 Get the name of the kerbal EVA part More...
 
string GetKerbalIconSuitPath ()
 Get the kerbal icon path for the suit variant More...
 
string GetKerbalIconSuitSuffix ()
 Get the kerbal icon name sufix for the suit variant More...
 
string GetKerbalIVAName ()
 Get the name of the IVA kerbal prefab More...
 
string GetLocalizedStatus ()
 
string GetLocalizedTrait ()
 
string GetLocalizedType ()
 
bool HasEffect (string effect)
 
bool HasEffect< T > ()
 
float InventoryCosts ()
 Get the cost of the ProtoCrewMember Inventory More...
 
float InventoryMass ()
 Get the mass of the ProtoCrewMember Inventory More...
 
void OnPartPack (Part p)
 
void OnPartUnpack (Part p)
 
 ProtoCrewMember (KerbalType type)
 Create a ProtoCrewMember manually More...
 
 ProtoCrewMember (KerbalType type, string newName)
 
 ProtoCrewMember (ProtoCrewMember copyOf)
 Creates a ProtoCrewMember as a clone of another one (used for resetting the roster back to startup conditions) More...
 
 ProtoCrewMember (Game.Modes mode, ConfigNode node, KerbalType crewType=KerbalType.Crew)
 Create a ProtoCrewMember from the loaded save string More...
 
void RegisterExperienceTraits (Part part)
 
float ResourceMass ()
 Get the mass of the ProtoCrewMember resources More...
 
void Save (ConfigNode node)
 Save this PCM to a given confignode More...
 
void SaveEVAChute (ModuleEvaChute chute)
 Save the ModuleEvaChute to a config node. More...
 
void SaveInventory (ModuleInventoryPart inventory)
 Save the ModuleInventoryPart to a config node. More...
 
void SetDefaultInventory ()
 Will set the Inventory on this kerbal to the Default loadout. Doing this in flight scene is cheating, but not restricted. More...
 
bool SetInactive (double time, bool additive=true)
 Sets kerbal inactive for given time More...
 
void SetTimeForRespawn (double UTforRespawn)
 Starts the respawn cycle for this crewmember to either respawn or be declared dead (based on game parameters) at the given UT (will set him as 'Missing'). (Use this if Planetarium.GetUniversalTime isn't available) More...
 
delegate Kerbal SpawnKerbalDelegate (ProtoCrewMember pcm)
 
void StartRespawnPeriod (double timeToRespawn=-1d)
 Starts the respawn cycle for this crewmember (will set him as 'Missing'). At the end of this period, he will either be dead or be made available again, depending on game parameters. More...
 
override string ToString ()
 
void UnregisterExperienceTraits (Part part)
 
void Update (double UT)
 Run for all PCMs via KerbalRoster, itself run from Planetarium (so early in the frame) Sets any PCMs active that should be set active. Then calls the callbacks More...
 
void UpdateExperience ()
 
delegate void voidDelegate_PCM (ProtoCrewMember pcm)
 
delegate void voidDelegate_PCM_Part (ProtoCrewMember pcm, Part p)
 
delegate void voidDelegate_PCM_UT (ProtoCrewMember pcm, double UT)
 

Static Public Member Functions

static double _GToleranceMult (ProtoCrewMember pcm)
 
static double _MaxSustainedG (ProtoCrewMember pcm)
 
static Kerbal _Spawn (ProtoCrewMember pcm)
 

Public Attributes

FlightLog careerLog = new FlightLog()
 Entire career flight log of this crew member More...
 
bool completedFirstEVA
 Stores true once the kerbal has been on EVA once so we know when to use teh default helmet settings More...
 
float courage
 Courage of crew member More...
 
float experience = 0
 Experience of kerbal More...
 
int experienceLevel = 0
 Experience level of kerbal More...
 
ExperienceTrait experienceTrait = null
 The experience trait that this kerbal has More...
 
FlightLog flightLog = new FlightLog()
 Flight log of this crew member More...
 
double geeForce = 0d
 Current g force from the vessel. Note: by default ignores angular velocity. More...
 
double gExperienced = 0d
 
double gIncrement = 0d
 Set this yourself in ApplyGCallback and then apply it to gExperienced. More...
 
bool hasHelmetOn
 Stores state of Helmet preference for each kerbal More...
 
bool hasNeckRingOn
 Stores state of Neck Ring preference for each kerbal More...
 
bool hasToured
 Flag for tourists set to disappear on next recovery. More...
 
bool hasVisorDown = false
 Stores state of Helmet preference for each kerbal More...
 
double inactiveTimeEnd
 When the kerbal was set inactive More...
 
bool isBadass
 Is this crew member bad ass? More...
 
Kerbal KerbalRef
 In-game reference of this protocrewmember More...
 
float lightB = 0f
 
float lightG = 0.5176f
 
float lightR = 1f
 
bool outDueToG = false
 Are we inactive due to Gs? More...
 
uint persistentID
 Used only when a kerbal is IVA and should only be used for UI purposes. More...
 
InternalSeat seat = null
 
int seatIdx = -1
 
float stupidity
 Stupidity of crew member More...
 
string trait
 The name of the experience trait More...
 
double UTaR
 UT at respawn (means time at which we can respawn this guy) More...
 
bool veteran
 Is this crew member a veteran? More...
 

Static Public Attributes

static voidDelegate_PCM_Part ApplyGCallback
 Do your own G processing here and change gExperienced and set gIncrement. To enable, set doStockGCalcs true. More...
 
static voidDelegate_PCM_Part CallbackActiveFixedUpdate
 
static voidDelegate_PCM_Part CallbackActiveUpdate
 
static voidDelegate_PCM_Part CallbackOnPartPack
 
static voidDelegate_PCM_Part CallbackOnPartUnpack
 
static voidDelegate_PCM_UT CallbackUpdate
 
static bool doStockGCalcs = true
 Set true if you want to use ApplyGCallback instead of stock. More...
 
static doubleDelegatePCM GToleranceMult = _GToleranceMult
 Multiplier to this kerbals' G tolerance, based on stats/level More...
 
static doubleDelegatePCM MaxSustainedG = _MaxSustainedG
 
static SpawnKerbalDelegate Spawn = _Spawn
 

Protected Attributes

bool _inactive
 

Properties

ConfigNode ChuteNode [get, set]
 Saved information for the ModuleEvaChute in a config node so that we can store it in the kerbal roster. This allows the parachute information to persist when the kerbal boards a vessel or is recovered to the space centre. More...
 
string ComboId [get, set]
 Stock suit identifier. More...
 
string displayName [get]
 Display name of crew member More...
 
float ExperienceLevelDelta [get]
 
float ExtraExperience [get, set]
 
Gender gender [get, set]
 
double GExperiencedNormalized [get]
 
bool inactive [get, set]
 Is crew member capable of activity? More...
 
ConfigNode InventoryNode [get, set]
 Saved information for the ModuleInventoryPart in a config node so that we can store it in the kerbal roster. This allows the Inventory information to persist when the kerbal boards a vessel or is recovered to the space centre. More...
 
bool isHero [get, set]
 Does this kerbal is a hero kerbal only a few selected kerbals can have this status More...
 
ModuleInventoryPart KerbalInventoryModule [get]
 Get the ProtoCrewMember's ModuleInventoryPart Instance. You should Null check what is returned to be safe. More...
 
string name [get]
 Name of crew member (primary key into roster) More...
 
string nameWithGender [get]
 Name of the kerbal, with the gender suffix added for lingoona More...
 
string NormalTexturePath [get, set]
 Reference to the extra suit normal texture. More...
 
RosterStatus rosterStatus [get, set]
 Roster status of this crew member More...
 
string SpritePath [get, set]
 Reference to the extra suit icon. More...
 
KerbalSuit suit [get, set]
 Suit type used by this kerbal More...
 
string SuitTexturePath [get, set]
 Reference to the extra body texture. More...
 
KerbalType type [get, set]
 Type of this kerbal More...
 
bool UseStockTexture [get, set]
 Indicates if the selected suit is from stock. More...
 

Detailed Description

Crew member prototype

Member Enumeration Documentation

Enumerator
Male 
Female 
Enumerator
Default 
Vintage 
Future 
Slim 
Enumerator
Crew 
Applicant 
Unowned 
Tourist 
Enumerator
Available 
Assigned 
Dead 
Missing 

Constructor & Destructor Documentation

ProtoCrewMember.ProtoCrewMember ( KerbalType  type)
inline

Create a ProtoCrewMember manually

ProtoCrewMember.ProtoCrewMember ( KerbalType  type,
string  newName 
)
inline
ProtoCrewMember.ProtoCrewMember ( ProtoCrewMember  copyOf)
inline

Creates a ProtoCrewMember as a clone of another one (used for resetting the roster back to startup conditions)

Parameters
copyOf
ProtoCrewMember.ProtoCrewMember ( Game.Modes  mode,
ConfigNode  node,
KerbalType  crewType = KerbalType.Crew 
)
inline

Create a ProtoCrewMember from the loaded save string

Parameters
crewData
protoPart

Member Function Documentation

static double ProtoCrewMember._GToleranceMult ( ProtoCrewMember  pcm)
inlinestatic
static double ProtoCrewMember._MaxSustainedG ( ProtoCrewMember  pcm)
inlinestatic
static Kerbal ProtoCrewMember._Spawn ( ProtoCrewMember  pcm)
inlinestatic
void ProtoCrewMember.ActiveFixedUpdate ( Part  p)
inline

Run for PCMs on an active part in flight (packed or unpacked). Called by part.FixedUpdate Does G checking (if enabled). Then calls the callbacks.

Parameters
p
void ProtoCrewMember.ActiveUpdate ( Part  p)
inline

Run for PCMs on an active part in flight (packed or unpacked). Called by part.Update Calls the callbacks.

Parameters
p
void ProtoCrewMember.ArchiveFlightLog ( )
inline
float ProtoCrewMember.CalculateExperiencePoints ( Game  game)
inline
float ProtoCrewMember.CalculateExperiencePoints ( GameParameters  parameters,
Game.Modes  mode 
)
inline
bool ProtoCrewMember.ChangeName ( string  newName)
inline
bool ProtoCrewMember.CheckActive ( double  ut)
inline
void ProtoCrewMember.CheckRespawnTimer ( double  UT,
GameParameters  gameParameters 
)
inline
void ProtoCrewMember.Die ( )
inline

Sets this crewmember as dead

< don't change the vessel index yet, we still might be drawing the KIA screen

delegate double ProtoCrewMember.doubleDelegatePCM ( ProtoCrewMember  pcm)
override bool ProtoCrewMember.Equals ( object  obj)
inline
ExperienceEffect ProtoCrewMember.GetEffect ( string  effect)
inline
T ProtoCrewMember.GetEffect< T > ( )
inline
Type Constraints
T :ExperienceEffect 
override int ProtoCrewMember.GetHashCode ( )
inline
string ProtoCrewMember.GetKerbalEVAPartName ( )
inline

Get the name of the kerbal EVA part

Returns
string ProtoCrewMember.GetKerbalIconSuitPath ( )
inline

Get the kerbal icon path for the suit variant

Returns
string ProtoCrewMember.GetKerbalIconSuitSuffix ( )
inline

Get the kerbal icon name sufix for the suit variant

Returns
string ProtoCrewMember.GetKerbalIVAName ( )
inline

Get the name of the IVA kerbal prefab

Returns
string ProtoCrewMember.GetLocalizedStatus ( )
inline
string ProtoCrewMember.GetLocalizedTrait ( )
inline
string ProtoCrewMember.GetLocalizedType ( )
inline
bool ProtoCrewMember.HasEffect ( string  effect)
inline
bool ProtoCrewMember.HasEffect< T > ( )
inline
Type Constraints
T :ExperienceEffect 
float ProtoCrewMember.InventoryCosts ( )
inline

Get the cost of the ProtoCrewMember Inventory

Returns
float ProtoCrewMember.InventoryMass ( )
inline

Get the mass of the ProtoCrewMember Inventory

Returns
void ProtoCrewMember.OnPartPack ( Part  p)
inline
void ProtoCrewMember.OnPartUnpack ( Part  p)
inline
void ProtoCrewMember.RegisterExperienceTraits ( Part  part)
inline
float ProtoCrewMember.ResourceMass ( )
inline

Get the mass of the ProtoCrewMember resources

ie the resources in the KerbalEVA part

Returns
mass in ton
void ProtoCrewMember.Save ( ConfigNode  node)
inline

Save this PCM to a given confignode

Parameters
node
void ProtoCrewMember.SaveEVAChute ( ModuleEvaChute  chute)
inline

Save the ModuleEvaChute to a config node.

Parameters
chuteModuleEvaChute to be saved.
void ProtoCrewMember.SaveInventory ( ModuleInventoryPart  inventory)
inline

Save the ModuleInventoryPart to a config node.

Parameters
inventoryModuleInventoryPart to be saved.
void ProtoCrewMember.SetDefaultInventory ( )
inline

Will set the Inventory on this kerbal to the Default loadout. Doing this in flight scene is cheating, but not restricted.

bool ProtoCrewMember.SetInactive ( double  time,
bool  additive = true 
)
inline

Sets kerbal inactive for given time

Parameters
time
additive
Returns
void ProtoCrewMember.SetTimeForRespawn ( double  UTforRespawn)
inline

Starts the respawn cycle for this crewmember to either respawn or be declared dead (based on game parameters) at the given UT (will set him as 'Missing'). (Use this if Planetarium.GetUniversalTime isn't available)

delegate Kerbal ProtoCrewMember.SpawnKerbalDelegate ( ProtoCrewMember  pcm)
void ProtoCrewMember.StartRespawnPeriod ( double  timeToRespawn = -1d)
inline

Starts the respawn cycle for this crewmember (will set him as 'Missing'). At the end of this period, he will either be dead or be made available again, depending on game parameters.

override string ProtoCrewMember.ToString ( )
inline
void ProtoCrewMember.UnregisterExperienceTraits ( Part  part)
inline
void ProtoCrewMember.Update ( double  UT)
inline

Run for all PCMs via KerbalRoster, itself run from Planetarium (so early in the frame) Sets any PCMs active that should be set active. Then calls the callbacks

Parameters
UT
void ProtoCrewMember.UpdateExperience ( )
inline
delegate void ProtoCrewMember.voidDelegate_PCM ( ProtoCrewMember  pcm)
delegate void ProtoCrewMember.voidDelegate_PCM_Part ( ProtoCrewMember  pcm,
Part  p 
)
delegate void ProtoCrewMember.voidDelegate_PCM_UT ( ProtoCrewMember  pcm,
double  UT 
)

Member Data Documentation

bool ProtoCrewMember._inactive
protected
voidDelegate_PCM_Part ProtoCrewMember.ApplyGCallback
static

Do your own G processing here and change gExperienced and set gIncrement. To enable, set doStockGCalcs true.

voidDelegate_PCM_Part ProtoCrewMember.CallbackActiveFixedUpdate
static
voidDelegate_PCM_Part ProtoCrewMember.CallbackActiveUpdate
static
voidDelegate_PCM_Part ProtoCrewMember.CallbackOnPartPack
static
voidDelegate_PCM_Part ProtoCrewMember.CallbackOnPartUnpack
static
voidDelegate_PCM_UT ProtoCrewMember.CallbackUpdate
static
FlightLog ProtoCrewMember.careerLog = new FlightLog()

Entire career flight log of this crew member

bool ProtoCrewMember.completedFirstEVA

Stores true once the kerbal has been on EVA once so we know when to use teh default helmet settings

float ProtoCrewMember.courage

Courage of crew member

bool ProtoCrewMember.doStockGCalcs = true
static

Set true if you want to use ApplyGCallback instead of stock.

float ProtoCrewMember.experience = 0

Experience of kerbal

int ProtoCrewMember.experienceLevel = 0

Experience level of kerbal

ExperienceTrait ProtoCrewMember.experienceTrait = null

The experience trait that this kerbal has

FlightLog ProtoCrewMember.flightLog = new FlightLog()

Flight log of this crew member

double ProtoCrewMember.geeForce = 0d

Current g force from the vessel. Note: by default ignores angular velocity.

double ProtoCrewMember.gExperienced = 0d
double ProtoCrewMember.gIncrement = 0d

Set this yourself in ApplyGCallback and then apply it to gExperienced.

doubleDelegatePCM ProtoCrewMember.GToleranceMult = _GToleranceMult
static

Multiplier to this kerbals' G tolerance, based on stats/level

bool ProtoCrewMember.hasHelmetOn

Stores state of Helmet preference for each kerbal

bool ProtoCrewMember.hasNeckRingOn

Stores state of Neck Ring preference for each kerbal

bool ProtoCrewMember.hasToured

Flag for tourists set to disappear on next recovery.

bool ProtoCrewMember.hasVisorDown = false

Stores state of Helmet preference for each kerbal

double ProtoCrewMember.inactiveTimeEnd

When the kerbal was set inactive

bool ProtoCrewMember.isBadass

Is this crew member bad ass?

Kerbal ProtoCrewMember.KerbalRef

In-game reference of this protocrewmember

float ProtoCrewMember.lightB = 0f
float ProtoCrewMember.lightG = 0.5176f
float ProtoCrewMember.lightR = 1f
doubleDelegatePCM ProtoCrewMember.MaxSustainedG = _MaxSustainedG
static
bool ProtoCrewMember.outDueToG = false

Are we inactive due to Gs?

uint ProtoCrewMember.persistentID

Used only when a kerbal is IVA and should only be used for UI purposes.

InternalSeat ProtoCrewMember.seat = null
int ProtoCrewMember.seatIdx = -1
SpawnKerbalDelegate ProtoCrewMember.Spawn = _Spawn
static
float ProtoCrewMember.stupidity

Stupidity of crew member

string ProtoCrewMember.trait

The name of the experience trait

double ProtoCrewMember.UTaR

UT at respawn (means time at which we can respawn this guy)

bool ProtoCrewMember.veteran

Is this crew member a veteran?

Property Documentation

ConfigNode ProtoCrewMember.ChuteNode
getset

Saved information for the ModuleEvaChute in a config node so that we can store it in the kerbal roster. This allows the parachute information to persist when the kerbal boards a vessel or is recovered to the space centre.

string ProtoCrewMember.ComboId
getset

Stock suit identifier.

string ProtoCrewMember.displayName
get

Display name of crew member

This checks the 4 hero kerbal names are returning their localized versions

float ProtoCrewMember.ExperienceLevelDelta
get
float ProtoCrewMember.ExtraExperience
getset
Gender ProtoCrewMember.gender
getset
double ProtoCrewMember.GExperiencedNormalized
get
bool ProtoCrewMember.inactive
getset

Is crew member capable of activity?

ConfigNode ProtoCrewMember.InventoryNode
getset

Saved information for the ModuleInventoryPart in a config node so that we can store it in the kerbal roster. This allows the Inventory information to persist when the kerbal boards a vessel or is recovered to the space centre.

bool ProtoCrewMember.isHero
getset

Does this kerbal is a hero kerbal only a few selected kerbals can have this status

ModuleInventoryPart ProtoCrewMember.KerbalInventoryModule
get

Get the ProtoCrewMember's ModuleInventoryPart Instance. You should Null check what is returned to be safe.

string ProtoCrewMember.name
get

Name of crew member (primary key into roster)

string ProtoCrewMember.nameWithGender
get

Name of the kerbal, with the gender suffix added for lingoona

string ProtoCrewMember.NormalTexturePath
getset

Reference to the extra suit normal texture.

RosterStatus ProtoCrewMember.rosterStatus
getset

Roster status of this crew member

string ProtoCrewMember.SpritePath
getset

Reference to the extra suit icon.

KerbalSuit ProtoCrewMember.suit
getset

Suit type used by this kerbal

string ProtoCrewMember.SuitTexturePath
getset

Reference to the extra body texture.

KerbalType ProtoCrewMember.type
getset

Type of this kerbal

bool ProtoCrewMember.UseStockTexture
getset

Indicates if the selected suit is from stock.


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