Variant
This page documents one concrete variant entry inside a VariantSet.
Purpose
A Variant is one selectable option in a variant set. Its transformer list is where the authored behavior actually lives.
Source-backed type
C# type:
VSwift.Modules.Variants.Variant
Key fields
VariantId: stringVariantLocalizationKey: stringTransformers: list[ITransformer]
Runtime role
VariantIdis the internal identifier and the stored active-selection value.VariantLocalizationKeysupplies the display name. If it is empty, V-SwiFT falls back toVariantId.Transformersis the ordered list of actions and visualizers attached to the variant.
Tech gating
A tech tree node unlocks a variant. The node names the variant in its UnlockedVariants list, by part name, variant set ID and variant ID. A variant that no node names is always selectable. If two nodes name the same variant, the first node that loads unlocks it. Parts work the same way.
Gating applies only when parts are unlocked by science. In Sandbox, or with the Unlock All Parts cheat, every variant is selectable. In the OAB, the dropdown leaves out a locked variant. The popout shows it, with the node that unlocks it. Science shows how a patch adds a variant to a node.
Example
+Hydrogen {
VariantLocalizationKey: "MyMod/Tank/Hydrogen";
+ResourceContainerAdder {
Containers: [ /* container definitions */ ];
}
+MassModifier {
Modifier: 0.15;
}
}Notes
The order of transformers inside a variant matters when V-SwiFT later stores saved-information entries, because those saved entries are indexed by transformer position.