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 | Protected Member Functions | Protected Attributes | Static Protected Attributes | Properties | List of all members
Expansions.Serenity.ModuleRobotArmScanner Class Reference
Inheritance diagram for Expansions.Serenity.ModuleRobotArmScanner:
ModuleDeployablePart PartModule IMultipleDragCube IScalarModule IConstruction

Public Types

enum  ArmDeployState {
  ArmDeployState.RETRACTED, ArmDeployState.UNPACKING, ArmDeployState.EXTENDING, ArmDeployState.SCANNING,
  ArmDeployState.RETRACTING, ArmDeployState.PACKING, ArmDeployState.BROKEN, ArmDeployState.PREVIEWRANGE
}
 Enum representing the different states of the scanner arm. More...
 
- Public Types inherited from ModuleDeployablePart
enum  DeployState {
  DeployState.RETRACTED, DeployState.EXTENDED, DeployState.RETRACTING, DeployState.EXTENDING,
  DeployState.BROKEN
}
 
enum  PanelAlignType { PanelAlignType.PIVOT, PanelAlignType.X, PanelAlignType.Y, PanelAlignType.Z }
 
enum  TrackingMode {
  TrackingMode.SUN, TrackingMode.HOME, TrackingMode.CURRENT, TrackingMode.VESSEL,
  TrackingMode.NONE
}
 
- Public Types inherited from PartModule
enum  PartUpgradeState { PartUpgradeState.NONE, PartUpgradeState.LOCKED, PartUpgradeState.AVAILABLE }
 
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
}
 

Public Member Functions

override void breakPanels ()
 Smash the scanner arm on impact. More...
 
void CalculateExtendedTargetRotations ()
 Calculate the target rotations of all the joints in the scanner arm when fully extended. The arm will move to these rotations after unpacking itself. More...
 
virtual void ExtendArm ()
 Moves the scanner arm from the unpacked state to the scan state. More...
 
override string GetInfo ()
 Creates the extended information for the VAB/SPH display More...
 
override string GetModuleDisplayName ()
 Returns the display name for the module. More...
 
override void OnAwake ()
 Scanner arm initialisation. Called by the Part during its Awake() method. More...
 
override void OnCollisionEnter (Collision collision)
 React to collision with another object. More...
 
void OnDestroy ()
 
override void OnInventoryModeDisable ()
 This method will be called when this modules part and itself is first disabled (when it is not attached to a vessel) when created in Inventory/Construction mode. More...
 
override void OnInventoryModeEnable ()
 This method will be called when this modules part and itself is first enabled (when it is attached to a vessel) when created in Inventory/Construction mode. More...
 
override void OnLoad (ConfigNode node)
 Load the information from a config node. More...
 
override void OnSave (ConfigNode node)
 Save the information to a config node. More...
 
override void OnStart (PartModule.StartState state)
 Scanner arm initialisation. Called by the Part during its Start() method. More...
 
virtual void OnTriggerEnter (Collider other)
 React to trigger collider touching an object. This will be with the interaction range trigger collider More...
 
virtual void OnTriggerExit (Collider other)
 React to trigger collider no longer touching an object. This will be the interaction range trigger collider More...
 
override void OnUpdate ()
 Update the scanner arm every frame. More...
 
virtual void PackArm ()
 Moves the scanner arm from the unpacked state to the packed state. We do this when retracting the arm to the original position in order to avoid clipping with the vessel. More...
 
virtual void PerformExperiment ()
 Performs the experiment. More...
 
virtual void PlayPackAnimation ()
 Play the packing animation. More...
 
virtual void PlayScanAnimation ()
 Play the scanning animation. More...
 
virtual void PlayUnpackAnimation ()
 Play the packing animation. More...
 
virtual void ReturnArmToPrePackState ()
 Moves the scanner arm from the current state to the prepack state. More...
 
override void startFSM ()
 Initialise the Finite State Machine for the scanner arm. More...
 
virtual void UnpackArm ()
 Moves the scanner arm from the packed state to the unpacked state. We do this before extending the arm to the scan position in order to avoid clipping with the vessel. More...
 
override void updateFSM ()
 Update the Finite State Machine for the scanner arm every frame. More...
 
- Public Member Functions inherited from ModuleDeployablePart
void AssumeDragCubePosition (string name)
 Used by the DragCubeSystem when it is generating drag cube entries on startup if none are found for this module. When called the module should set it's model position/setup to match the expected position/orientation when 'name' drag cube is active. More...
 
virtual void breakNotifications (string partTitle, string breakMessage)
 
virtual void CalculateTracking ()
 Checks if part is blocked (via raycast) from it's target. If trackToBody == true, then it also rotates the panels. More...
 
virtual bool CalculateTrackingLOS (Vector3 trackingDirection, ref string blocker)
 This method takes the tracking direction and calculates whether there is LOS (for parts which care about LOS, by default it only checks for aero shielding) More...
 
bool CanBeDetached ()
 calls AllowConstructionDeployState() More...
 
bool CanBeOffset ()
 calls AllowConstructionDeployState() More...
 
bool CanBeRotated ()
 calls AllowConstructionDeployState() More...
 
void CheatRepair ()
 Triggers the DoRepair method by the FixRepairableParts cheat. More...
 
void ControlPanelsWithoutUsingSymmetry (KSPActionType action)
 Deploys or retracts the part without activating symmetric parts. More...
 
void EventRepairExternal ()
 
virtual void Extend ()
 
void ExtendAction (KSPActionParam param)
 
void ExtendPanelsAction (KSPActionParam param)
 
virtual void FixedUpdate ()
 
string[] GetDragCubeNames ()
 Should return an array of strings that are the drag cube names that this module implements. More...
 
override string GetInfo ()
 Returns formatted string of additional data for use in the VAB and SPH More...
 
override string GetModuleDisplayName ()
 Override this to provide a Localized version of the PartModules Name for UI components More...
 
virtual void GetTrackingBodyTransforms ()
 
virtual bool IsMoving ()
 
virtual void LateUpdate ()
 
override void OnAwake ()
 Method fires once the module has been added to the part. Use for first time setup. Module will not have loaded fully by this point More...
 
void OnDestroy ()
 
override void OnInventoryModeDisable ()
 This method will be called when this modules part and itself is first disabled (when it is not attached to a vessel) when created in Inventory/Construction mode. More...
 
override void OnLoad (ConfigNode node)
 Use OnLoad to load any additional data from the ConfigNode provided More...
 
override void OnModuleAdjusterRemoved (AdjusterPartModuleBase adjuster)
 Perform processing specific to this part module when an adjuster is removed. More...
 
override void OnSave (ConfigNode node)
 Use OnSave to serialize additional module information into the ConfigNode provided More...
 
override void OnStart (PartModule.StartState state)
 
override void OnStoredInInventory (ModuleInventoryPart moduleInventoryPart)
 Called when the part is stored in an inventory. More...
 
virtual void PostCalculateTracking (bool trackingLOS, Vector3 trackingDirection)
 Once tracking is complete, this is called to perform any additional actions More...
 
virtual void PostFSMUpdate ()
 
virtual void recurse (Transform t)
 
virtual void Retract ()
 
void RetractAction (KSPActionParam param)
 
virtual void SetScalar (float t)
 Call to tell the module to assume the given state. Mind transition may not happen instantly. Check GetScalar for the actual state of the thing. More...
 
virtual void SetUIRead (bool state)
 Call to set whether or not the module will display its own UI. Read and Write define which kinds of information are allowed to be displayed More...
 
virtual void SetUIWrite (bool state)
 Call to set whether or not the module will display its own UI. Read and Write define which kinds of information are allowed to be displayed More...
 
virtual bool ShouldBreakFromG ()
 
virtual bool ShouldBreakFromPressure ()
 
bool UsesProceduralDragCubes ()
 Used by the DragCubeSystem when it is generating drag cube entries on startup if none are found for this module. Should return true if this module is to use procedural drag cubes and false if it is to generate drag cubes for the drag cube names returned in GetDragCubeNames method. More...
 
- Public Member Functions inherited from PartModule
void AddPartModuleAdjuster (AdjusterPartModuleBase newAdjuster)
 Call this to add an adjuster to this part module. More...
 
void AddPartModuleAdjusterList (List< AdjusterPartModuleBase > moduleAdjusters)
 Applies the appropriate module adjusters. Performs checks to make sure that the adjusters are valid too. More...
 
bool AppliedUpgrades ()
 Returns true if upgrades are applied More...
 
void ApplyAdjustersOnStart ()
 Called when a part module is loaded and applies all of the currently loaded adjusters. More...
 
virtual void ApplyUpgradeNode (List< string > appliedUps, ConfigNode node, bool doLoad)
 Applies the upgrades to a confignode. Will either copy the upgrades back to the node or (if doLoad) calls load/onload on it. More...
 
virtual bool ApplyUpgrades (StartState state)
 Will find and apply upgrades. Called during Part's ModulesOnStart, before a module's OnStart. More...
 
void Awake ()
 
delegate bool boolPMApplyUpgrades (PartModule pm, StartState state)
 
delegate bool boolPMBoolDelegate (PartModule pm, bool apply)
 
void ClearPersistentId ()
 Clear the modules persistentId More...
 
void Copy (PartModule fromModule)
 
virtual void DemoteToPhysicslessPart ()
 This method will be called from Part class DemoteToPhysicslessPart when the part is being converted from physical to physicsless part. It is called before the joints and rigidbodies are destroyed. More...
 
virtual bool FindUpgrades (bool fillApplied, ConfigNode node=null)
 Find applicable upgrades to the partmodule (isunlocked and isenabled) and add to the upgradesApplied list. Pass true if you want to add the upgrades to upgradesApplied, false if you just want to know if at least one upgrade is applicable (unlocked rather than enabled) More...
 
virtual Color GetCurrentColor ()
 Returns the current part module color. More...
 
virtual Color GetCurrentColor (string fieldName)
 Returns the current part module color for a field where usespe. More...
 
uint GetPersistenActiontId ()
 Get the modules persistentID, and create one if it doesnt already have one More...
 
uint GetPersistentId ()
 Get the modules persistentID, and create one if it doesnt already have one More...
 
virtual string GetStagingDisableText ()
 
virtual string GetStagingEnableText ()
 
virtual string GetUpgradeInfo ()
 Called by Upgrade Stats dialog More...
 
bool HasUpgrades ()
 Returns true if upgrades exist for the partmodule More...
 
virtual bool IsStageable ()
 Should this module be counted when seeing whether to have a stack icon present? Override in a module for custom behavior; otherwise returns true if the module (or something the module inherits from above PartModule itself) overrides OnActive() More...
 
bool IsValidContractObjective (string objectiveType)
 Returns if, for example, an antenna part module qualifies as an antenna for contracts. More...
 
void Load (ConfigNode node)
 
virtual void LoadUpgrades (ConfigNode node)
 Loads module-relevant upgrades from the partmodule confignode More...
 
uint NewPersistentId ()
 Reset the modules persistentId to a new number More...
 
virtual void OnActive ()
 Called when the part is set active (after unpacking etc) More...
 
virtual void OnColorChanged (Color color)
 Meant to be overwritten by part modules implementing color changes. In this case, it doesn't matter which color picker changed specifically. More...
 
virtual void OnColorChanged (Color color, string pickerID="")
 Meant to be overwritten by part modules implementing color changes More...
 
virtual void OnConstructionModeFixedUpdate ()
 This method will be called when in EVA Construction mode and this part and itself is disabled (when it is not attached to a vessel) every FixedUpdate(). More...
 
virtual void OnConstructionModeUpdate ()
 This method will be called when in EVA Construction mode and this part and itself is disabled (when it is not attached to a vessel) every Update(). More...
 
virtual void OnCopy (PartModule fromModule)
 Use OnCopy to copy any additional data from the PartModule provided More...
 
virtual void OnFixedUpdate ()
 Called every physics/fixed frame that the part is active More...
 
virtual void OnIconCreate ()
 Method fires just before components are stripped from the gameobject to make it an icon. (The part is instantiated and then various components like Part, PartModule, EffectBehaviour, Colliders, Particles, etc are stripped and then it's set as the icon prefab. This lets PartModules do stuff to the model right before that happens. More...
 
virtual void OnInactive ()
 Called before the part goes inactive (after packing etc) More...
 
virtual void OnInitialize ()
 Called on all modules after all parts are loaded but before they give the ship to the game More...
 
void OnModuleAdjusterAddedWrapper (AdjusterPartModuleBase adjuster)
 Wrapper to check the mission expansion availability before performing processing specific to this part module when an adjuster is added. More...
 
virtual void OnPartCreatedFomInventory (ModuleInventoryPart moduleInventoryPart)
 This method is called when a part is being taken out from a slot while being in EVAConstruction mode. More...
 
virtual void OnStart (StartState state)
 Called when the part starts. The StartState gives an indication of where in flight you are. All values may not be plugged in! More...
 
virtual void OnStartBeforePartAttachJoint (StartState state)
 Called in flight scene in Part.Start just before the Part attachnode joints are created. More...
 
virtual void OnStartFinished (StartState state)
 Called when the part finishes starting. The StartState gives an indication of where in flight you are. All values may not be plugged in! More...
 
virtual void OnWasCopied (PartModule copyPartModule, bool asSymCounterpart)
 Called when the PartModule was copied, through Alt+Copy or symmetry More...
 
virtual void OnWillBeCopied (bool asSymCounterpart)
 Called when the PartModule is about to be copied, through Alt+Copy or symmetry More...
 
virtual bool OnWillBeMirrored (ref Quaternion rotation, AttachNode selPartNode, Part partParent)
 This is called in the Editor scene when a symmetry copy of a part is being positioned. Only called on the symmetry parts and only when symmetry mode is set to Mirror. It allows the mirror rotation to be changed and returned before being applied to the symmetry copy part.

Parameters
rotationThe current calculated rotation. Will be updated if method returns true.
selPartNodeThe attachnode.
partParentThe part that will become this part's parent.
Returns
True if the rotation was changed. Otherwise will return false.
More...
 
virtual List< Color > PresetColors ()
 Preset colors received for any part module. By default, returns only black, override to make your own selection. More...
 
virtual string PrintUpgrades ()
 
virtual void PromoteToPhysicalPart ()
 This method will be called from Part class PromoteToPhysicalPart when the part is being converted from physicsless to physical part. More...
 
void RemovePartModuleAdjuster (AdjusterPartModuleBase oldAdjuster)
 Call this to remove an adjuster from this part module. More...
 
void RemovePartModuleAdjusterList (List< AdjusterPartModuleBase > moduleAdjusters)
 Removes the appropriate module adjusters. Performs checks to make sure that the adjusters are valid too. More...
 
void Save (ConfigNode node)
 
virtual void SetStaging (bool newValue)
 Run by the part's staging toggle handler, sets staging on modules on symmetry counterparts. More...
 
void SetStagingState (bool newState)
 Set the staging enabled bool for this module. More...
 
virtual bool StagingEnabled ()
 Gets current staging status (is staging enabled for this module) Override me! More...
 
virtual bool StagingToggleEnabledEditor ()
 
virtual bool StagingToggleEnabledFlight ()
 
void ToggleStaging ()
 
virtual void UpdateStagingToggle ()
 Updates the staging toggle More...
 
delegate void voidPMApplyNodeDelegate (PartModule pm, List< string > appliedUps, ConfigNode node, bool doLoad)
 
delegate void voidPMDelegate (PartModule pm)
 
delegate void voidPMNodeDelegate (PartModule pm, ConfigNode node)
 

Static Public Member Functions

static bool RayCastToROC (Vector3 origin, Vector3 traceDirection, float traceDistance, ref RaycastHit hit, bool performSphereCast, float radiusForSphereCast=0.35f)
 Raycast or sphereCast towards a point and find out whether there is a ROC in the way and where the intersection is. More...
 
- Static Public Member Functions inherited from PartModule
static ReflectedAttributes GetReflectedAttributes (Type partModuleType)
 
static PartUpgradeState UpgradesAvailable (Part part)
 Returns true if at least one module on the part has at least one upgrade available (isUnlocked) More...
 
static PartUpgradeState UpgradesAvailable (Part part, ConfigNode node)
 Returns true if at least one module on the part has at least one upgrade available (isUnlocked) More...
 

Public Attributes

Quaternion baseExtTargetRot
 Target local rotation of the base. More...
 
float cancelScanDistance
 How much the vessel has to move from its original scan position for the scan to be cancelled. More...
 
float distanceFromSurface = 1.0f
 How far to position the Scanner from the surface of the ROC. More...
 
string editorReachAnimationName
 Animation name for animation where we preview the reach of the scanner arm in the editor. More...
 
float emergencyStopDistanceFromSurface = 0.35f
 How far the surface of the ROC has to be to force an emergency stop of the arm movement. More...
 
string extendEffectName = "extending"
 Name of the looping sound effect for the arm extension More...
 
float firstJointAlignOffset
 Alignment offset for setting the rotation of the first joint. More...
 
Quaternion firstJointExtTargetRot
 Target local rotation of the first joint. More...
 
float firstJointRotationLimit = 90.0f
 How far the first arm can rotate before it would start clipping through the base of the scanner arm. More...
 
float firstJointRotStartAngleModifier
 Modifier for how much the angle difference has to be between the first joint and the second joint for the first joint to start rotating. More...
 
string firstJointTransformName = "LowerArm"
 Name of the transform of the first joint. More...
 
float gimbalAlignOffset
 Alignment offset for setting the rotation of the instrument gimbal. More...
 
Quaternion gimbalExtTargetRot
 Target local rotation of the scanning instrument. More...
 
string gimbalTransformName = "Gimbal"
 Name of the transform of the instrument gimbal. More...
 
float instAlignOffset
 Alignment offset for setting the rotation of the instrument. More...
 
string instCentreTransformName = "InstrumentHousing"
 Name of the transform of the instrument. More...
 
Quaternion instExtTargetRot
 Target local rotation of the scanning instrument. More...
 
string instTransformName = "InstrumentMount"
 Name of the transform of the instrument. More...
 
string packEffectName = "packing"
 Name of the sound effect for the packing animation More...
 
string rangeTriggerColliderTransformName = "rangeTrigger"
 Name of the transform of the range trigger collider. More...
 
string rangeTriggerParentTransformName = "ROCArm_01"
 Name of the parent transform of the range trigger collider. More...
 
float rangeTriggerRadius = 4.0f
 Radius of the range trigger. More...
 
string retractEffectName = "retracting"
 Name of the looping sound effect for the arm retraction More...
 
List< Vector2 > safeRetractPeriods = new List<Vector2>()
 List of all the periods during which it is safe to start returning the scanner instrument to its original rotation. More...
 
string scanEffectName = "scanning"
 Name of the sound effect for the scanning animation More...
 
List< RobotArmScannerFXscannerEffectList
 List of all the custom effects that will be played when scanning More...
 
string scanStatus = string.Empty
 Status warning used for reasons that the scanner can't operate. More...
 
float secondJointAlignOffset
 Alignment offset for setting the rotation of the second joint. More...
 
Quaternion secondJointExtTargetRot
 Target local rotation of the second joint. More...
 
string secondJointTransformName = "UpperArm"
 Name of the transform of the second joint. More...
 
float sphereCastRadius = 0.35f
 Radius of the spherecast performed when checking for a ROC. More...
 
string unpackAnimationName
 Animation name for the unpacking animation. More...
 
string unpackEffectName = "unpacking"
 Name of the sound effect for the unpacking animation More...
 
- Public Attributes inherited from ModuleDeployablePart
PanelAlignType alignType = PanelAlignType.PIVOT
 
string animationName
 Set to the animation clip name the part is to use. If blank will use the first animation clip found on the part. More...
 
bool applyShielding = true
 Apply shielding to part tracking/function. More...
 
bool applyShieldingExtend = true
 Apply shielding to part being able to extend. More...
 
string breakName = string.Empty
 Used to specific a break transform for when the part breaks if a different transform is required from the pivotName. More...
 
string brokenStatusWarning = ""
 Display that warns about a broken wheel when not on EVA. More...
 
Quaternion currentRotation
 
DeployState deployState = DeployState.RETRACTED
 
List< string > destroyOnBreakObjects
 List of child game objects which won't be turned into physical objects and will instead be destroyed when the deployable part breaks. More...
 
float editorAnimationSpeedMult = 10f
 
bool eventsInSymmwtryAlways = false
 
bool eventsInSymmwtryEditor = true
 
string extendActionName = "#autoLOC_6001801"
 
string extendpanelsActionName = "#autoLOC_6001800"
 
double gResistance = double.PositiveInfinity
 
bool hasPivot
 
float impactResistance = 2f
 
float impactResistanceRetracted = 5f
 
bool isBreakable = true
 If the part is breakable. More...
 
bool isTracking = true
 True if part tracks a vessel or CB More...
 
string moduleID = "deployablePart"
 
Quaternion originalRotation
 Original - default starting rotation More...
 
Transform panelBreakTransform
 
float panelDrag = 0.4f
 
Transform panelRotationTransform
 
string partType = "#autoLOC_235329"
 
string pivotName = "sunPivot"
 The tracking pivot transform name in the model. Is also used for break transform if the breakName is not specified. More...
 
bool retractable = true
 If the part can be retracted once extended. More...
 
string retractActionName = "#autoLOC_6001802"
 
bool runOnce = true
 
string secondaryTransformName = string.Empty
 
bool showStatus = true
 Show the status string in the PAW More...
 
string status = Localizer.Format("#autoLOC_234861")
 
float storedAnimationSpeed
 
float storedAnimationTime
 
float subPartMass = 0.01f
 
string subPartName = "#autoLOC_235328"
 
float TrackingAlignmentOffset = 0f
 
CelestialBody trackingBody = null
 
TrackingMode trackingMode = TrackingMode.SUN
 Internals of one sort or another. More...
 
float trackingSpeed = 0.25f
 
Transform trackingTransformLocal
 
Transform trackingTransformScaled
 
Vessel trackingVessel = null
 
bool useAnimation = true
 Set to true to use the animation via the PAW. More...
 
bool useCurve = false
 
string vesselID
 
float windResistance = 3f
 this is now in kPa (times sin(AoA)) More...
 
- Public Attributes inherited from PartModule
bool isEnabled = true
 
bool moduleIsEnabled = true
 
string moduleName
 
bool overrideStagingIconIfBlank = true
 
ModuleResourceHandler resHandler = new ModuleResourceHandler()
 
bool showUpgradesInModuleInfo = false
 
ProtoPartModuleSnapshot snapshot
 
string stagingDisableText = ""
 
bool stagingEnabled = true
 
string stagingEnableText = ""
 
bool stagingToggleEnabledEditor = false
 
bool stagingToggleEnabledFlight = false
 
List< ConfigNodeupgrades
 
List< string > upgradesApplied = new List<string>()
 
bool upgradesApply = true
 
bool upgradesAsk = true
 

Protected Member Functions

virtual bool CanScan ()
 Check whether the vessel is moving at an acceptable speed for a scan. More...
 
override void DoExtend ()
 Start extending the arm so that we can scan a ROC. More...
 
override bool DoRepair ()
 Performs part repair. More...
 
override void DoRetract ()
 Start retracting the arm to its original position. More...
 
void OnCurrentMousePartChanged (Part p)
 
virtual void OnPartActionUICreate (Part actionPart)
 
virtual void OnPause ()
 Called when the game pauses More...
 
virtual void OnTimeWarpRateChanged ()
 
virtual void OnUnpause ()
 Called when the game unpauses More...
 
virtual void PerformScanROCNullCheck ()
 Check to see if the scan ROC has been destroyed and retract the arm if it has. More...
 
virtual ROC SelectROCToScan (out Vector3 closestScanPoint, bool useRaycast)
 Pick the best ROC to scan out of all of those available. More...
 
virtual void UpdateAnimationTime (string playingAnimationName)
 Update the animation time to keep it matched to the frame rate. More...
 
virtual void UpdatePartActionUI ()
 
- Protected Member Functions inherited from ModuleDeployablePart
virtual bool AllowConstructionDeployState ()
 Checks the values of deployState and returns a bool if construction is allowed. More...
 
bool IsDeployablePartStuck ()
 
override void OnModuleAdjusterAdded (AdjusterPartModuleBase adjuster)
 Perform processing specific to this part module when an adjuster is added. More...
 
- Protected Member Functions inherited from PartModule
ConfigNode GetUpgrade (string name)
 
virtual void LoadUpgradesApplied (List< string > applieds, ConfigNode node)
 Load the applied upgrade names More...
 
virtual void SaveUpgradesApplied (ConfigNode node)
 Save the applied upgrades. More...
 
IEnumerator UpgradeWaitForScenarioModules ()
 

Protected Attributes

float animationStartTime
 Time that the animation started playing at. More...
 
string cacheAutoLOC_8004426
 
Vector3 closestScanPoint
 Set to the closest Point to scan on the closest ROC More...
 
bool emergencyRetractScanner = false
 Something happened in the middle of a scan and we need to return the scanner instrument to its original rotation. More...
 
float firstArmLength
 Length of the first arm. More...
 
Quaternion firstJointOrigRot
 Resting rotation of the first joint. This will be used to return the first joint to its original rotation after a scan. More...
 
Transform firstJointTransform
 Transform of the first joint. This will be used to control the rotation of the first arm connected to the base rotator. More...
 
Quaternion gimbalOrigRot
 Resting rotation of the instrument gimbal. This will be used to return the instrument gimbal to its original rotation after a scan. More...
 
Transform gimbalTransform
 Transform of the instrument gimbal. This will be used to control the instrument gimbal. More...
 
Quaternion instCentreOrigRot
 Resting rotation of the instrument housing. This will be used to return the instrument to its original rotation after a scan. More...
 
Transform instCentreTransform
 Transform of the instrument. This will be used to control the instrument. More...
 
Quaternion instOrigRot
 Resting rotation of the instrument. This will be used to return the instrument to its original rotation after a scan. More...
 
Vector3 instTargetPos
 Position that will be targeted by the scanning instrument. More...
 
Transform instTransform
 Transform of the instrument. This will be used to control the instrument. More...
 
float maxArmLength
 Length of the first and second arms. This is the maximum interaction reach of the scanner. More...
 
ModuleScienceExperiment moduleScienceExperiment
 Science experiment which we use to handle the experiment. More...
 
AudioFX packAudioFX
 AudioFX used to play the packing sound More...
 
float pauseStartTime
 Time that the pause menu was opened at. More...
 
Material rangeTriggerMaterial
 Material applied to the mesh renderer of the range trigger for displaying the range in the VAB/SPH. More...
 
MeshRenderer rangeTriggerRenderer
 Mesh renderer of the range trigger for displaying the range in the VAB/SPH. More...
 
Transform rangeTriggerTransform
 Transform of the range trigger collider. More...
 
List< GameObject > rocsInRange = new List<GameObject>()
 List of all the ROCs that we're touching at the moment. More...
 
Vector3 scanPosition
 Target position of the scanning instrument. More...
 
ROC scanROC
 ROC to be scanned. More...
 
string scanROCDisplayName
 Display name of the ROC to be scanned. More...
 
float secondArmLength
 Length of the second arm. More...
 
Quaternion secondJointOrigRot
 Resting rotation of the second joint. This will be used to return the second joint to its original rotation after a scan. More...
 
Transform secondJointTransform
 Transform of the second joint. This will be used to control the rotation of the second arm. More...
 
- Protected Attributes inherited from ModuleDeployablePart
Animation anim
 
string blockingObject
 
EventData< float, float > onMove
 
EventData< float > onStop
 
bool overrideUIWriteState = true
 
Transform secondaryTransform
 
bool stopAnimation = false
 
bool trackingLOS
 

Static Protected Attributes

static string cacheAutoLOC_8004274
 
static string cacheAutoLOC_8004427
 
static string cacheAutoLOC_8004432
 
- Static Protected Attributes inherited from ModuleDeployablePart
static string cacheAutoLOC_234828
 
static string cacheAutoLOC_234841
 
static string cacheAutoLOC_234856
 
static string cacheAutoLOC_234861
 
static string cacheAutoLOC_234868
 
static string cacheAutoLOC_6001017
 
static string cacheAutoLOC_6001415
 
static string cacheAutoLOC_6005093
 
- Static Protected Attributes inherited from PartModule
static Dictionary< string,
ConfigNode
exclusives = new Dictionary<string, ConfigNode>()
 
static Dictionary< Type,
ReflectedAttributes
reflectedAttributeCache = new Dictionary<Type, ReflectedAttributes>()
 

Properties

new ArmDeployState deployState [get, set]
 Current deployment state of the scanner arm More...
 
- Properties inherited from ModuleDeployablePart
virtual bool CanMove [get]
 
virtual float GetScalar [get]
 
bool IsMultipleCubesActive [get]
 
virtual float MinAoAForQCheck [get]
 
EventData< float, float > OnMoving [get]
 
EventData< float > OnStop [get]
 
string ScalarModuleID [get]
 
- Properties inherited from PartModule
BaseActionList Actions [get]
 
int ClassID [get]
 
string ClassName [get]
 
List< AdjusterPartModuleBaseCurrentModuleAdjusterList [get]
 List of all the module adjusters that are currently active on this part module. More...
 
BaseEventList Events [get]
 
BaseFieldList Fields [get]
 
string GUIName [get]
 
bool HasAdjusters [get]
 Has this part module been adjusted? More...
 
ReflectedAttributes ModuleAttributes [get, set]
 
Part part [get, set]
 
uint PersistentActionsId [get, set]
 A unique identifier for each vessel including from when it was Shipconstruct More...
 
uint PersistentId [get]
 A unique identifier for each vessel including from when it was Shipconstruct More...
 
Vessel vessel [get]
 
- Properties inherited from IMultipleDragCube
bool IsMultipleCubesActive [get]
 Used by the DragCubeSystem when it is generating drag cube entries on startup if none are found for this module. Should return true if multiple drag cubes are expected to be generated for the part this module is a part of or false if not. More...
 
- Properties inherited from IScalarModule
bool CanMove [get]
 A flag stating whether or not the module is able to change state at all. More...
 
float GetScalar [get]
 
EventData< float, float > OnMoving [get]
 
EventData< float > OnStop [get]
 
string ScalarModuleID [get]
 

Additional Inherited Members

- Static Public Attributes inherited from PartModule
static voidPMApplyNodeDelegate ApplyUpgradeNodeDel
 
static boolPMApplyUpgrades ApplyUpgradesDel
 
static bool ApplyUpgradesEditorAuto = true
 
static boolPMBoolDelegate FindUpgradesDel
 
static voidPMNodeDelegate LoadExpansionNodes
 Hook for loading extra nodes common to all part modules. More...
 
static voidPMNodeDelegate LoadUpgradesDel
 
static voidPMNodeDelegate SaveExpansionNodes
 Hook for saving extra nodes common to all part modules. More...
 
static voidPMDelegate SetupExpansion
 Hook for performing extra setup common to all part modules. More...
 
static string UpgradesAvailableString = "#autoLOC_6002273"
 
static string UpgradesLockedString = "#autoLOC_6002274"
 

Member Enumeration Documentation

Enum representing the different states of the scanner arm.

Enumerator
RETRACTED 
UNPACKING 
EXTENDING 
SCANNING 
RETRACTING 
PACKING 
BROKEN 
PREVIEWRANGE 

Member Function Documentation

override void Expansions.Serenity.ModuleRobotArmScanner.breakPanels ( )
inlinevirtual

Smash the scanner arm on impact.

Reimplemented from ModuleDeployablePart.

void Expansions.Serenity.ModuleRobotArmScanner.CalculateExtendedTargetRotations ( )
inline

Calculate the target rotations of all the joints in the scanner arm when fully extended. The arm will move to these rotations after unpacking itself.

virtual bool Expansions.Serenity.ModuleRobotArmScanner.CanScan ( )
inlineprotectedvirtual

Check whether the vessel is moving at an acceptable speed for a scan.

Returns
True if vessel is moving at an acceptable speed for a scan, false otherwise.
override void Expansions.Serenity.ModuleRobotArmScanner.DoExtend ( )
inlineprotectedvirtual

Start extending the arm so that we can scan a ROC.

Reimplemented from ModuleDeployablePart.

override bool Expansions.Serenity.ModuleRobotArmScanner.DoRepair ( )
inlineprotectedvirtual

Performs part repair.

Returns
if the repair was successful or not.

< Store the original Quaternion

< set current to original

Reimplemented from ModuleDeployablePart.

override void Expansions.Serenity.ModuleRobotArmScanner.DoRetract ( )
inlineprotectedvirtual

Start retracting the arm to its original position.

Reimplemented from ModuleDeployablePart.

virtual void Expansions.Serenity.ModuleRobotArmScanner.ExtendArm ( )
inlinevirtual

Moves the scanner arm from the unpacked state to the scan state.

< Get world directional vector to the tracked object

override string Expansions.Serenity.ModuleRobotArmScanner.GetInfo ( )
inlinevirtual

Creates the extended information for the VAB/SPH display

Reimplemented from PartModule.

override string Expansions.Serenity.ModuleRobotArmScanner.GetModuleDisplayName ( )
inlinevirtual

Returns the display name for the module.

Returns
The display name for the module.

Reimplemented from PartModule.

override void Expansions.Serenity.ModuleRobotArmScanner.OnAwake ( )
inlinevirtual

Scanner arm initialisation. Called by the Part during its Awake() method.

Reimplemented from PartModule.

override void Expansions.Serenity.ModuleRobotArmScanner.OnCollisionEnter ( Collision  collision)
inlinevirtual

React to collision with another object.

Parameters
collisionDetails of the collision passed on by the physics system.

Reimplemented from ModuleDeployablePart.

void Expansions.Serenity.ModuleRobotArmScanner.OnCurrentMousePartChanged ( Part  p)
inlineprotected
void Expansions.Serenity.ModuleRobotArmScanner.OnDestroy ( )
inline
override void Expansions.Serenity.ModuleRobotArmScanner.OnInventoryModeDisable ( )
inlinevirtual

This method will be called when this modules part and itself is first disabled (when it is not attached to a vessel) when created in Inventory/Construction mode.

Reimplemented from PartModule.

override void Expansions.Serenity.ModuleRobotArmScanner.OnInventoryModeEnable ( )
inlinevirtual

This method will be called when this modules part and itself is first enabled (when it is attached to a vessel) when created in Inventory/Construction mode.

Reimplemented from PartModule.

override void Expansions.Serenity.ModuleRobotArmScanner.OnLoad ( ConfigNode  node)
inlinevirtual

Load the information from a config node.

Parameters
nodeConfig node to load the information from.

Reimplemented from PartModule.

virtual void Expansions.Serenity.ModuleRobotArmScanner.OnPartActionUICreate ( Part  actionPart)
inlineprotectedvirtual
virtual void Expansions.Serenity.ModuleRobotArmScanner.OnPause ( )
inlineprotectedvirtual

Called when the game pauses

override void Expansions.Serenity.ModuleRobotArmScanner.OnSave ( ConfigNode  node)
inlinevirtual

Save the information to a config node.

Parameters
nodeConfig node to load the information to.

Reimplemented from PartModule.

override void Expansions.Serenity.ModuleRobotArmScanner.OnStart ( PartModule.StartState  state)
inline

Scanner arm initialisation. Called by the Part during its Start() method.

virtual void Expansions.Serenity.ModuleRobotArmScanner.OnTimeWarpRateChanged ( )
inlineprotectedvirtual
virtual void Expansions.Serenity.ModuleRobotArmScanner.OnTriggerEnter ( Collider  other)
inlinevirtual

React to trigger collider touching an object. This will be with the interaction range trigger collider

Parameters
otherCollider of the object that we just overlapped
virtual void Expansions.Serenity.ModuleRobotArmScanner.OnTriggerExit ( Collider  other)
inlinevirtual

React to trigger collider no longer touching an object. This will be the interaction range trigger collider

Parameters
otherCollider of the object that we just stopped overlapping
virtual void Expansions.Serenity.ModuleRobotArmScanner.OnUnpause ( )
inlineprotectedvirtual

Called when the game unpauses

override void Expansions.Serenity.ModuleRobotArmScanner.OnUpdate ( )
inlinevirtual

Update the scanner arm every frame.

Reimplemented from PartModule.

virtual void Expansions.Serenity.ModuleRobotArmScanner.PackArm ( )
inlinevirtual

Moves the scanner arm from the unpacked state to the packed state. We do this when retracting the arm to the original position in order to avoid clipping with the vessel.

virtual void Expansions.Serenity.ModuleRobotArmScanner.PerformExperiment ( )
inlinevirtual

Performs the experiment.

virtual void Expansions.Serenity.ModuleRobotArmScanner.PerformScanROCNullCheck ( )
inlineprotectedvirtual

Check to see if the scan ROC has been destroyed and retract the arm if it has.

virtual void Expansions.Serenity.ModuleRobotArmScanner.PlayPackAnimation ( )
inlinevirtual

Play the packing animation.

virtual void Expansions.Serenity.ModuleRobotArmScanner.PlayScanAnimation ( )
inlinevirtual

Play the scanning animation.

virtual void Expansions.Serenity.ModuleRobotArmScanner.PlayUnpackAnimation ( )
inlinevirtual

Play the packing animation.

static bool Expansions.Serenity.ModuleRobotArmScanner.RayCastToROC ( Vector3  origin,
Vector3  traceDirection,
float  traceDistance,
ref RaycastHit  hit,
bool  performSphereCast,
float  radiusForSphereCast = 0.35f 
)
inlinestatic

Raycast or sphereCast towards a point and find out whether there is a ROC in the way and where the intersection is.

Parameters
originStart location of the spherecast.
traceDirectionDirection of the spherecast.
traceDistanceHow far to trace for the spherecast.
hitThis will have the location of the closest intersection point inserted into it. If false is returned, the value will not be valid.
performSphereCastPerform a spherecast if this is set to true. Perform a raycast otherwise.
radiusForSphereCastRadius of the spherecast. Value is ignored if it's a raycast.
Returns
True if we found an intersection with a ROC, false otherwise.
virtual void Expansions.Serenity.ModuleRobotArmScanner.ReturnArmToPrePackState ( )
inlinevirtual

Moves the scanner arm from the current state to the prepack state.

virtual ROC Expansions.Serenity.ModuleRobotArmScanner.SelectROCToScan ( out Vector3  closestScanPoint,
bool  useRaycast 
)
inlineprotectedvirtual

Pick the best ROC to scan out of all of those available.

Parameters
closestScanPointThis will have the location of the closest scan point inserted into it.
useRaycastUse raycasts to make sure that no scenery is between scanner arm and ROC scan point. Expensive if set to true!
Returns
The ROC that the arm is going to scan.
override void Expansions.Serenity.ModuleRobotArmScanner.startFSM ( )
inlinevirtual

Initialise the Finite State Machine for the scanner arm.

Reimplemented from ModuleDeployablePart.

virtual void Expansions.Serenity.ModuleRobotArmScanner.UnpackArm ( )
inlinevirtual

Moves the scanner arm from the packed state to the unpacked state. We do this before extending the arm to the scan position in order to avoid clipping with the vessel.

virtual void Expansions.Serenity.ModuleRobotArmScanner.UpdateAnimationTime ( string  playingAnimationName)
inlineprotectedvirtual

Update the animation time to keep it matched to the frame rate.

Parameters
playingAnimationNameName of the animation to update.
override void Expansions.Serenity.ModuleRobotArmScanner.updateFSM ( )
inlinevirtual

Update the Finite State Machine for the scanner arm every frame.

Reimplemented from ModuleDeployablePart.

virtual void Expansions.Serenity.ModuleRobotArmScanner.UpdatePartActionUI ( )
inlineprotectedvirtual

Member Data Documentation

float Expansions.Serenity.ModuleRobotArmScanner.animationStartTime
protected

Time that the animation started playing at.

Quaternion Expansions.Serenity.ModuleRobotArmScanner.baseExtTargetRot

Target local rotation of the base.

string Expansions.Serenity.ModuleRobotArmScanner.cacheAutoLOC_8004274
staticprotected
string Expansions.Serenity.ModuleRobotArmScanner.cacheAutoLOC_8004426
protected
string Expansions.Serenity.ModuleRobotArmScanner.cacheAutoLOC_8004427
staticprotected
string Expansions.Serenity.ModuleRobotArmScanner.cacheAutoLOC_8004432
staticprotected
float Expansions.Serenity.ModuleRobotArmScanner.cancelScanDistance

How much the vessel has to move from its original scan position for the scan to be cancelled.

Vector3 Expansions.Serenity.ModuleRobotArmScanner.closestScanPoint
protected

Set to the closest Point to scan on the closest ROC

float Expansions.Serenity.ModuleRobotArmScanner.distanceFromSurface = 1.0f

How far to position the Scanner from the surface of the ROC.

string Expansions.Serenity.ModuleRobotArmScanner.editorReachAnimationName

Animation name for animation where we preview the reach of the scanner arm in the editor.

bool Expansions.Serenity.ModuleRobotArmScanner.emergencyRetractScanner = false
protected

Something happened in the middle of a scan and we need to return the scanner instrument to its original rotation.

float Expansions.Serenity.ModuleRobotArmScanner.emergencyStopDistanceFromSurface = 0.35f

How far the surface of the ROC has to be to force an emergency stop of the arm movement.

string Expansions.Serenity.ModuleRobotArmScanner.extendEffectName = "extending"

Name of the looping sound effect for the arm extension

float Expansions.Serenity.ModuleRobotArmScanner.firstArmLength
protected

Length of the first arm.

float Expansions.Serenity.ModuleRobotArmScanner.firstJointAlignOffset

Alignment offset for setting the rotation of the first joint.

Quaternion Expansions.Serenity.ModuleRobotArmScanner.firstJointExtTargetRot

Target local rotation of the first joint.

Quaternion Expansions.Serenity.ModuleRobotArmScanner.firstJointOrigRot
protected

Resting rotation of the first joint. This will be used to return the first joint to its original rotation after a scan.

float Expansions.Serenity.ModuleRobotArmScanner.firstJointRotationLimit = 90.0f

How far the first arm can rotate before it would start clipping through the base of the scanner arm.

float Expansions.Serenity.ModuleRobotArmScanner.firstJointRotStartAngleModifier

Modifier for how much the angle difference has to be between the first joint and the second joint for the first joint to start rotating.

Transform Expansions.Serenity.ModuleRobotArmScanner.firstJointTransform
protected

Transform of the first joint. This will be used to control the rotation of the first arm connected to the base rotator.

string Expansions.Serenity.ModuleRobotArmScanner.firstJointTransformName = "LowerArm"

Name of the transform of the first joint.

float Expansions.Serenity.ModuleRobotArmScanner.gimbalAlignOffset

Alignment offset for setting the rotation of the instrument gimbal.

Quaternion Expansions.Serenity.ModuleRobotArmScanner.gimbalExtTargetRot

Target local rotation of the scanning instrument.

Quaternion Expansions.Serenity.ModuleRobotArmScanner.gimbalOrigRot
protected

Resting rotation of the instrument gimbal. This will be used to return the instrument gimbal to its original rotation after a scan.

Transform Expansions.Serenity.ModuleRobotArmScanner.gimbalTransform
protected

Transform of the instrument gimbal. This will be used to control the instrument gimbal.

string Expansions.Serenity.ModuleRobotArmScanner.gimbalTransformName = "Gimbal"

Name of the transform of the instrument gimbal.

float Expansions.Serenity.ModuleRobotArmScanner.instAlignOffset

Alignment offset for setting the rotation of the instrument.

Quaternion Expansions.Serenity.ModuleRobotArmScanner.instCentreOrigRot
protected

Resting rotation of the instrument housing. This will be used to return the instrument to its original rotation after a scan.

Transform Expansions.Serenity.ModuleRobotArmScanner.instCentreTransform
protected

Transform of the instrument. This will be used to control the instrument.

string Expansions.Serenity.ModuleRobotArmScanner.instCentreTransformName = "InstrumentHousing"

Name of the transform of the instrument.

Quaternion Expansions.Serenity.ModuleRobotArmScanner.instExtTargetRot

Target local rotation of the scanning instrument.

Quaternion Expansions.Serenity.ModuleRobotArmScanner.instOrigRot
protected

Resting rotation of the instrument. This will be used to return the instrument to its original rotation after a scan.

Vector3 Expansions.Serenity.ModuleRobotArmScanner.instTargetPos
protected

Position that will be targeted by the scanning instrument.

Transform Expansions.Serenity.ModuleRobotArmScanner.instTransform
protected

Transform of the instrument. This will be used to control the instrument.

string Expansions.Serenity.ModuleRobotArmScanner.instTransformName = "InstrumentMount"

Name of the transform of the instrument.

float Expansions.Serenity.ModuleRobotArmScanner.maxArmLength
protected

Length of the first and second arms. This is the maximum interaction reach of the scanner.

ModuleScienceExperiment Expansions.Serenity.ModuleRobotArmScanner.moduleScienceExperiment
protected

Science experiment which we use to handle the experiment.

AudioFX Expansions.Serenity.ModuleRobotArmScanner.packAudioFX
protected

AudioFX used to play the packing sound

string Expansions.Serenity.ModuleRobotArmScanner.packEffectName = "packing"

Name of the sound effect for the packing animation

float Expansions.Serenity.ModuleRobotArmScanner.pauseStartTime
protected

Time that the pause menu was opened at.

string Expansions.Serenity.ModuleRobotArmScanner.rangeTriggerColliderTransformName = "rangeTrigger"

Name of the transform of the range trigger collider.

Material Expansions.Serenity.ModuleRobotArmScanner.rangeTriggerMaterial
protected

Material applied to the mesh renderer of the range trigger for displaying the range in the VAB/SPH.

string Expansions.Serenity.ModuleRobotArmScanner.rangeTriggerParentTransformName = "ROCArm_01"

Name of the parent transform of the range trigger collider.

float Expansions.Serenity.ModuleRobotArmScanner.rangeTriggerRadius = 4.0f

Radius of the range trigger.

MeshRenderer Expansions.Serenity.ModuleRobotArmScanner.rangeTriggerRenderer
protected

Mesh renderer of the range trigger for displaying the range in the VAB/SPH.

Transform Expansions.Serenity.ModuleRobotArmScanner.rangeTriggerTransform
protected

Transform of the range trigger collider.

string Expansions.Serenity.ModuleRobotArmScanner.retractEffectName = "retracting"

Name of the looping sound effect for the arm retraction

List<GameObject> Expansions.Serenity.ModuleRobotArmScanner.rocsInRange = new List<GameObject>()
protected

List of all the ROCs that we're touching at the moment.

List<Vector2> Expansions.Serenity.ModuleRobotArmScanner.safeRetractPeriods = new List<Vector2>()

List of all the periods during which it is safe to start returning the scanner instrument to its original rotation.

string Expansions.Serenity.ModuleRobotArmScanner.scanEffectName = "scanning"

Name of the sound effect for the scanning animation

List<RobotArmScannerFX> Expansions.Serenity.ModuleRobotArmScanner.scannerEffectList

List of all the custom effects that will be played when scanning

Vector3 Expansions.Serenity.ModuleRobotArmScanner.scanPosition
protected

Target position of the scanning instrument.

ROC Expansions.Serenity.ModuleRobotArmScanner.scanROC
protected

ROC to be scanned.

string Expansions.Serenity.ModuleRobotArmScanner.scanROCDisplayName
protected

Display name of the ROC to be scanned.

string Expansions.Serenity.ModuleRobotArmScanner.scanStatus = string.Empty

Status warning used for reasons that the scanner can't operate.

float Expansions.Serenity.ModuleRobotArmScanner.secondArmLength
protected

Length of the second arm.

float Expansions.Serenity.ModuleRobotArmScanner.secondJointAlignOffset

Alignment offset for setting the rotation of the second joint.

Quaternion Expansions.Serenity.ModuleRobotArmScanner.secondJointExtTargetRot

Target local rotation of the second joint.

Quaternion Expansions.Serenity.ModuleRobotArmScanner.secondJointOrigRot
protected

Resting rotation of the second joint. This will be used to return the second joint to its original rotation after a scan.

Transform Expansions.Serenity.ModuleRobotArmScanner.secondJointTransform
protected

Transform of the second joint. This will be used to control the rotation of the second arm.

string Expansions.Serenity.ModuleRobotArmScanner.secondJointTransformName = "UpperArm"

Name of the transform of the second joint.

float Expansions.Serenity.ModuleRobotArmScanner.sphereCastRadius = 0.35f

Radius of the spherecast performed when checking for a ROC.

string Expansions.Serenity.ModuleRobotArmScanner.unpackAnimationName

Animation name for the unpacking animation.

string Expansions.Serenity.ModuleRobotArmScanner.unpackEffectName = "unpacking"

Name of the sound effect for the unpacking animation

Property Documentation

new ArmDeployState Expansions.Serenity.ModuleRobotArmScanner.deployState
getset

Current deployment state of the scanner arm


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