EngineModeSwapper
EngineModeSwapper replaces one or more stock engine-mode entries with variant-specific EngineMode definitions.
Purpose
Use this transformer when a variant changes how an engine behaves, such as swapping propellants, thrust curves, or localized engine-mode labels. It is the main V-SwiFT bridge between variant authoring and the stock Data_Engine / EngineMode structures.
Type
Source-backed runtime type: VSwift.Modules.Transformers.EngineModeSwapper
Fields
Modes:List<Data_Engine.EngineMode>Name:stringReplacement is keyed by
engineID, so each provided mode should target an existing stock engine-mode entry
Behavior
ApplyCommon: no effectApplyInOab: clones the currentData_Engine, replaces anyengineModeswhoseengineIDmatches a provided entry, rebuilds the data context, and reinitializesModule_EngineApplyInFlight: no effect
State handling
Reverter: yes, via
EngineModesReverter.InstanceSaves information: yes, through
EngineModeSwapLoaderVisualizes information: yes
Visualization
When shown in the part-actions manager popup, this transformer builds stat blocks for:
propellant
sea-level and vacuum thrust
sea-level and vacuum ISP
Example
This fragment is intentionally abbreviated. The Modes entries use the same shape as the stock EngineMode data documented in the engine reference.
@use "VSwift:*"
@parts {
#my_engine_part {
@include part-switch() {
VariantSets +: [{
VariantSetId: "propellant",
VariantSetLocalizationKey: "MyMod/VSwift/Propellant",
Variants: [{
VariantId: "vacuum",
VariantLocalizationKey: "MyMod/VSwift/Vacuum",
Transformers: [{
Name: "EngineModeSwapper",
Modes: [{
engineID: "main",
EngineDisplayName: "MyMod/VSwift/EngineMode/Vacuum"
}]
}]
}]
}];
}
}
}Caveats
The swap is keyed by
engineID. If the target ID does not exist on the base part, nothing will be replaced.The page-level snippet above is not a complete engine-mode definition; for a production patch, provide the full
EngineModepayload.Runtime support is OAB-focused. The current transformer does not implement an in-flight mode swap path.