Compared to the default KSP part switcher, B9 Part Switch is far more robust and versatile in what you can do with it—in addition to having multiple switchers, you can also adjust stats, swap textures without changing models, and so forth.
A summary of how to use B9PS is below, but more extensive documentation can be found on the mod’s GitHub page. Remember to list B9PS as a dependency if you use it!
Since I’m focused on making engines, the most obvious use of B9PS is for allowing different variants of engine mount. Here’s a simple one for the CEX Kunlun:
MODULE
{
name = ModuleB9PartSwitch
moduleID = meshSwitch // If you have multiple ModuleB9PartSwitch modules, each needs a unique moduleID.
switcherDescription = Mount // The name of the variant switcher as it appears in the right-click menu
affectDragCubes = false
// Subtypes appear in-game in the order you list them here.
SUBTYPE
{
name = 25 // This is an internal name. Each subtype in a ModuleB9PartSwitch module needs to have a unique name.
title = 2.5m // The name as it appears on the right-click menu.
descriptionSummary = 2.5m Stack Mount // The name as it appears in the pop-up hover.
descriptionDetail = A standard size mount. Includes autoshrouds. // The description in the pop-up hover.
primaryColor = #999999
secondaryColor = #53686f // The secondary colour is optional: if you only have one colour, you can omit it.
// Similar to the stock variant module, you turn on and off the transforms/meshes you want to show.
// Note that unlike the stock variant switcher, you need only list the ones to enable.
// For example, LHL_Kunlun_25_Boattail will be hidden in this subtype as well as the compact subtype.
transform = LHL_Kunlun_25_Mount
transform = LHL_Kunlun_25_MountTruss
transform = LHL_Kunlun_25_Shroud
}
SUBTYPE
{
name = 25Boat
title = 2.5m Boattail
descriptionSummary = 2.5m Boattail Mount
descriptionDetail = An aerodynamic shroud for engine protection. No autoshrouds.
primaryColor = #ffffff
secondaryColor = #53686f
transform = LHL_Kunlun_25_Boattail
transform = LHL_Kunlun_25_MountTruss
// You can use this to hide and show shrouds too.
// The other two subtypes use LHL_Kunlun_25_Shroud, so this subtype will hide it.
}
SUBTYPE
{
name = Compact
title = Compact
descriptionSummary = Compact Mount
descriptionDetail = A minimum-size mount for engine clustering. Includes autoshrouds.
primaryColor = #999999
secondaryColor = #999999
transform = LHL_Kunlun_25_Shroud
}
}
With the addition of a couple more sizes for the standard stack mount and boattail mount, it looks like this in-game:
As seen in the above example, you can use B9PS to enable or disable interstage shrouds for your engines depending on the variant; useful for disabling them for boattails, for example. Beware, though, that B9PS and ModuleJettison
do not play nice—if you want to hide or show shrouds using B9PS, you must create an empty transform in your model and parent all your shrouds to it, then set ModuleJettison
to that transform, even if you only have one shroud in your model! Otherwise, you’ll get strange results.
In the case of the Kunlun, I have the shrouds parented to a shrouds empty, which is itself parented to the main engine empty:
MODULE {
name = ModuleJettison
jettisonName = LHL_Kunlun_Shrouds // This is set to the empty, instead of the shrouds
bottomNodeName = bottom
isFairing = True
jettisonedObjectMass = 0.5
jettisonForce = 15
jettisonDirection = 0 0 1
}
This I would have to do regardless since I have two different shrouds for this model (a 2.5m and 3.75m one). I can’t have ModuleJettison
set to multiple meshes, so I have it set to the master shroud empty instead.