Add Cloak to any Ship in Star Trek Bridge Commander

Find the ship’s hardpoints.py and .pyc files in your STBC install folder. Usually C:\Program Files (x86)\Star Trek Bridge Commander\scripts\ships\Hardpoints. Open <shipname>.py with an IDE. The reason not to use a text editor is because Python in sensitive to indentation. In this example, I’m using Visual Studio Code. Add this block of text to the first section of the file.

#################################################
CloakingDevice = App.CloakingSubsystemProperty_Create("Cloaking Device")

CloakingDevice.SetMaxCondition(1500.000000)
CloakingDevice.SetCritical(0)
CloakingDevice.SetTargetable(1)
CloakingDevice.SetPrimary(1)
CloakingDevice.SetPosition(0.001862, -0.339031, 0.633926)
CloakingDevice.SetPosition2D(64.000000, 76.000000)
CloakingDevice.SetRepairComplexity(3.000000)
CloakingDevice.SetDisabledPercentage(0.500000)
CloakingDevice.SetRadius(0.100000)
CloakingDevice.SetNormalPowerPerSecond(1200.000000)
CloakingDevice.SetCloakStrength(45.000000)
App.g_kModelPropertyManager.RegisterLocalTemplate(CloakingDevice)
#################################################

You may or may not need to include the ‘#’ separator characters depending on whether you placed it under or over an existing entry. The file should now look like the below.

Next, scroll down until you find the property sets. These are at the end of the file. The start of the section looks like the below.

Add the section anywhere in the list keeping the indentation consistant with the rest of the file.

prop = App.g_kModelPropertyManager.FindByName("Cloaking Device", App.TGModelPropertyManager.LOCAL_TEMPLATES)
	if (prop != None):
		pObj.AddToSet("Scene Root", prop)

Save and close the file. The next part assumes you have Python installed. Navigate to where the <shipname>.py file you just edited is saved and open a terminal there. Type this python command to compile the .py file. Replacing the <shipname> with the actual file name.

 python -m compileall <shipname>.py

You should now find the .pyc file in a _pycache_ folder in the same folder as your .py file. Copy the .pyc file to the same folder as the .py file used to create it. Delete the _pycache_ folder.

If you did everything correctly, when you load your ship in Bridge Commander you will have a fully functioning Cloaking Device!