The Torpedo Yield mod installs an example torpedo that consists of the files
PhotonTorpedo_YieldHigh.py
PhotonTorpedo_YieldMed.py
PhotonTorpedo_YieldLow.py
in scripts/Tactical/Projectiles.
To use this torpedo you just have to add one of these files to the hardpoint of a ship with MPE like you would normally install a torpedo.
If you want other torpedoes to have the yield option you have to create them yourself.
Lets say you want to modify the quantum torpedo.
1. Go to \scripts\Tactical\Projectiles and open QuantumTorpedo.py with notepad.
2a. Find
def GetName():
return ("Quantum Torpedo")
and replace 'Quantum Torpedo' with 'Quantum High Yield'. You can change how much damage this torpedo does by editing the number behind
def GetDamage():
return
Save the file as QuantumTorpedo_YieldHigh.py but keep it open in notepad.
2b. Now replace 'Quantum High Yield' with 'Quantum Med Yield', modify the damage and save the file as QuantumTorpedo_YieldMed.py but don't close it yet.
2c. Same drill as 2a and 2b only with 'Low' now.
3. Go to scripts\Custom\qbautostart and open TorpYield.py. (It would be prudent to make a backup now.)
a Search for
pYieldMain = App.STMenu_CreateW(App.TGString("Photon Yields"))
and
if (pTacticalMenu != None):
pButton = pTacticalMenu.GetSubmenu("Photon Yields")
if (pButton != None):
pTacticalMenu.DeleteChild(pButton)
and replace 'Photon Yields' with 'Torpedo Yields' respectively.
b Now go to '# do a torpedo name check '
and add
elif (pTorpedoType.GetAmmoName() == "Quantum High Yield"):
MenuSetup()
elif (pTorpedoType.GetAmmoName() == "Quantum Med Yield"):
MenuSetup()
elif (pTorpedoType.GetAmmoName() == "Quantum Low Yield"):
MenuSetup()
so that it looks like this
if (TorpedoSystem):
iNumTypes = TorpedoSystem.GetNumAmmoTypes()
for iType in range(iNumTypes):
pTorpedoType = TorpedoSystem.GetAmmoType(iType)
if (pTorpedoType.GetAmmoName() == "Photon High Yield"):
MenuSetup()
elif (pTorpedoType.GetAmmoName() == "Photon Med Yield"):
MenuSetup()
elif (pTorpedoType.GetAmmoName() == "Photon Low Yield"):
MenuSetup()
elif (pTorpedoType.GetAmmoName() == "Quantum High Yield"):
MenuSetup()
elif (pTorpedoType.GetAmmoName() == "Quantum Med Yield"):
MenuSetup()
elif (pTorpedoType.GetAmmoName() == "Quantum Low Yield"):
MenuSetup()
3c. Go to 'def LowYield(pObject, pEvent):'
and between
the last FelixLine(None, None) line
and # med yield damage definition
add
elif (pTorpedoType.GetAmmoName() == "Quantum
High Yield"):
iTorpType =
pTorpedoType.SetTorpedoScript("Tactical.Projectiles.QuantumTorpedo_Yiel
dLow")
pLowButton.SetDisabled()
pMedButton.SetEnabled()
pHighButton.SetEnabled()
FelixLine(None, None)
elif (pTorpedoType.GetAmmoName() == "Quantum
Med Yield"):
iTorpType =
pTorpedoType.SetTorpedoScript("Tactical.Projectiles.QuantumTorpedo_Yiel
dLow")
pLowButton.SetDisabled()
pMedButton.SetEnabled()
pHighButton.SetEnabled()
FelixLine(None, None)
elif (pTorpedoType.GetAmmoName() == "Quantum
Low Yield"):
iTorpType =
pTorpedoType.SetTorpedoScript("Tactical.Projectiles.QuantumTorpedo_Yiel
dLow")
pLowButton.SetDisabled()
pMedButton.SetEnabled()
pHighButton.SetEnabled()
FelixLine(None, None)
3d. Scroll down to # high yield damage definition,
and between
FelixLine(None, None)
and
# high yield damage definition
add
elif (pTorpedoType.GetAmmoName() == "Quantum
High Yield"):
iTorpType =
pTorpedoType.SetTorpedoScript("Tactical.Projectiles.QuantumTorpedo_Yiel
dMed")
pLowButton.SetEnabled()
pMedButton.SetDisabled()
pHighButton.SetEnabled()
FelixLine(None, None)
elif (pTorpedoType.GetAmmoName() == "Quantum
Med Yield"):
iTorpType =
pTorpedoType.SetTorpedoScript("Tactical.Projectiles.QuantumTorpedo_Yiel
dMed")
pLowButton.SetEnabled()
pMedButton.SetDisabled()
pHighButton.SetEnabled()
FelixLine(None, None)
elif (pTorpedoType.GetAmmoName() == "Quantum
Low Yield"):
iTorpType =
pTorpedoType.SetTorpedoScript("Tactical.Projectiles.QuantumTorpedo_Yiel
dMed")
pLowButton.SetEnabled()
pMedButton.SetDisabled()
pHighButton.SetEnabled()
FelixLine(None, None)
3e. Do the same as 3c and 3d with
def HighYield(pObject, pEvent):
only this time it's
Tactical.Projectiles.QuantumTorpedo_YieldHigh .
4. Save the file.
I've also included the modified file in case I forgot something.
I've not tested if that also works if you equip a ship with more than one variable yield torpedo.