Refactor base ModuleEngineConfigs to allow the necessary changes
Notably, introduce ConfigNode GetSetConfigurationTarget(string configName) so that subclasses can modify the config to switch to
New ModulePatchableEngineConfigs
Configs can have 'subconfigs', which are specified in SUBCONFIG nodes
Subconfig nodes are applied as 'patches' to parent configs and show up in the config selector under the parent config
Each subconfig must have a distinct name
The displayName key can be added to both configs and subconfigs to provide a custom display name
If one is not provided, configs are displayed as usual, and subconfigs get auto-generated names of the form $config [Subconfig $subconfig]
Other modules can dynamically patch configs via reflection:
public void ApplyDynamicPatch(ConfigNode patch) (note that any existing dynamic patches are removed upon patching)
public ConfigNode GetNonDynamicallyPatchedConfiguration() gives a copy of the active configuration, but without a dynamic patch applied, if there is one
The OnMPECDynamicPatchReset message is sent when a user action or game load results in the patch being reset
New ModuleBimodalEngineConfigs based on MPEC. Each config must have one subconfig, which will serve as a 'secondary mode'. Primary and secondary configs can be toggled in-flight, with an optional animation. Thrust and Isp can be lerped smoothly. Keys taken by the module itself:
primaryDescription, default 'Retracted'
secondaryDescription, default 'Extended'
toPrimaryText, default 'Retract Nozzle'
toSecondaryText, default 'Extend Nozzle'
toggleButtonHoverInfo, default empty, shown when hovering over the toggle mode button in the RF GUI
animationName, default none
switchB9PSAtAnimationTime, default -1 (immediately after toggle), for specifying at what normalized animation time the B9PS variant switch should occur. Mainly useful for plume switching.
thrustLerpTime, default -1, for specifying the time taken to lerp engine performance while switching modes. -1 indicates auto-compute from the length of the animation, or instantaneous if no animation is specified.
Caveat: Engine (max) temperature is incoherent during lerp.
Caveat: General behavior may be incoherent if the number and/or nature of propellants change.
Removed the old ModulePairedConfigsEngine and ModuleAnimatedBimodalEngine.
Works good so far, but does still explode when experiencing extreme thrust changes. XLR129 extending the nozzle at sea level drops thrust from ~900 kn to 400 kn, causing the engine to explode.
ModuleEngineConfigs
to allow the necessary changesConfigNode GetSetConfigurationTarget(string configName)
so that subclasses can modify the config to switch toModulePatchableEngineConfigs
SUBCONFIG
nodesname
displayName
key can be added to both configs and subconfigs to provide a custom display name$config [Subconfig $subconfig]
public void ApplyDynamicPatch(ConfigNode patch)
(note that any existing dynamic patches are removed upon patching)public ConfigNode GetNonDynamicallyPatchedConfiguration()
gives a copy of the active configuration, but without a dynamic patch applied, if there is oneOnMPECDynamicPatchReset
message is sent when a user action or game load results in the patch being resetModuleBimodalEngineConfigs
based on MPEC. Each config must have one subconfig, which will serve as a 'secondary mode'. Primary and secondary configs can be toggled in-flight, with an optional animation. Thrust and Isp can be lerped smoothly. Keys taken by the module itself:primaryDescription
, default 'Retracted'secondaryDescription
, default 'Extended'toPrimaryText
, default 'Retract Nozzle'toSecondaryText
, default 'Extend Nozzle'toggleButtonHoverInfo
, default empty, shown when hovering over the toggle mode button in the RF GUIanimationName
, default noneswitchB9PSAtAnimationTime
, default -1 (immediately after toggle), for specifying at what normalized animation time the B9PS variant switch should occur. Mainly useful for plume switching.thrustLerpTime
, default -1, for specifying the time taken to lerp engine performance while switching modes. -1 indicates auto-compute from the length of the animation, or instantaneous if no animation is specified.ModulePairedConfigsEngine
andModuleAnimatedBimodalEngine
.