Bridge Commander Central
BC Forums => BC Scripting => Topic started by: Kingly on August 14, 2010, 10:32:01 PM
-
im trying to add ftech to a torpedo so that it splits into multiple torpedoes after launch.
this is what the ftech user guide says:
There are 2 types of splitting projectiles, single target and multi target.
Single target splitting projectiles split and converge at the same target.
Multi target splitting projectiles split and pick their own (enemy) targets. And both do this after 100 game units distance from the parent ship.
With splitting torpedoes it?s important that you have 2 projectiles.
1 is the ?shell? and the other the ?warhead?. The shell is what gets fired from the ship. The warhead is what comes out of the shell. So it?s important that the warhead and the shell aren?t the same, or you would get infinite (well until BC can?t handle it anymore) torpedoes on the screen. This is something you don?t want to be happening. It is of course all right to have multiple stage cluster projectiles, just try and prevent a loop of any sort with these.
And here is the example for a Single Target Splitting Projectile:
sYieldName = ??
try:
import FoundationTech
import ftb.Tech.TimedTorpedoes
oFire = ftb.Tech.TimedTorpedoes.MIRVSingleTargetTorpedo(
?Name for tech?, {
?spreadNumber?: 3,
?spreadDensity?: 6.5,
?warheadModule?: ?PathToModule?,
?shellLive?: 0,
})
FoundationTech.dOnFires[__name__] = oFire
oYield = FoundationTech.oTechs[sYieldName]
FoundationTech.dYields[__name__] = oYield
except:
passAnd here is a quick rundown. Name for Tech is the name you give to this configuration.
spreadNumber is the amount of warheads the projectile will fire.
spreadDensity is the distance between 2 warheads when they spread out from the shell (after which they will converge on their target). It?s defined in degree.
warheadModule is the path to the new projectile that is to be spawned (same structure of path as
however i cant seem to get it to work, this is what i have: (yes i know its an odd choice of torpedoes, but i just want it to work first)
###############################################################################
# Filename: GodDefiantQuantum.py
#
# Confidential and Proprietary, Copyright 2000 by Totally Games
#
# Script for filling in the attributes of quantum torpedoes.
#
# Created: 11/3/00 - Erik Novales
###############################################################################
import App
###############################################################################
# Create(pTorp)
#
# Creates a quantum torpedo.
#
# Args: pTorp - the torpedo, ready to be filled-in
#
# Return: zero
###############################################################################
def Create(pTorp):
kCoreColor = App.TGColorA()
kCoreColor.SetRGBA(222.0 / 255.0, 222.0 / 255.0, 253.0 / 255.0, 1.000000)
kGlowColor = App.TGColorA()
kGlowColor.SetRGBA(61.0 / 255.0, 98.0 / 255.0, 239.0 / 255.0, 1.000000)
pTorp.CreateTorpedoModel(
"data/Textures/Tactical/Quantum01.tga",
kCoreColor,
0.1,
0.0,
"data/Textures/Tactical/Quantum01Glow.tga",
kGlowColor,
2.0,
0.2,
0.17,
"data/Textures/Tactical/TorpedoFlares.tga",
kGlowColor,
62,
0.12,
0.5)
pTorp.SetDamage( GetDamage() )
pTorp.SetDamageRadiusFactor(0.14)
pTorp.SetGuidanceLifetime( GetGuidanceLifetime() )
pTorp.SetMaxAngularAccel( GetMaxAngularAccel() )
# Multiplayer specific stuff. Please, if you create a new torp
# type. modify the SpeciesToTorp.py file to add the new type.
import Multiplayer.SpeciesToTorp
pTorp.SetNetType (Multiplayer.SpeciesToTorp.QUANTUM)
return(0)
def GetLaunchSpeed():
return(65.0)
def GetLaunchSound():
return("Quantum Torpedo")
def GetPowerCost():
return(30.0)
def GetName():
return("Quantum")
def GetDamage():
return 20000.0
def GetGuidanceLifetime():
return 25.0
def GetMaxAngularAccel():
return 0.2
sYieldName = ?Single Target Splitting Projectile?
try:
import FoundationTech
import ftb.Tech.TimedTorpedoes
oFire = ftb.Tech.TimedTorpedoes.MIRVSingleTargetTorpedo(
?Cluster missle?, {
?spreadNumber?: 10,
?spreadDensity?: 6.5,
?warheadModule?: ?Tactical.Projectiles.Mark9Tactical?,
?shellLive?: 0,
})
FoundationTech.dOnFires[__name__] = oFire
oYield = FoundationTech.oTechs[sYieldName]
FoundationTech.dYields[__name__] = oYield
except:
pass
-
Because you've got so many syntax errors, I don't know where to start lol
sYieldName = 'Single Target Splitting Projectile'
try:
import FoundationTech
import ftb.Tech.TimedTorpedoes
oFire = ftb.Tech.TimedTorpedoes.MIRVSingleTargetTorpedo('Cluster missle', {'spreadNumber': 10, 'spreadDensity': 6.5, 'warheadModule': 'Tactical.Projectiles.Mark9Tactical', 'shellLive': 0,})
FoundationTech.dOnFires[__name__] = oFire
oYield = FoundationTech.oTechs[sYieldName]
FoundationTech.dYields[__name__] = oYield
except:
print 'There seems to be a problem with this torpedo tech.'
-
well thats why im asking, iv never really tried to do anything fancy with torpedoes, im just looking to get a working example
-
Umm, did you read the answer I gave you at forums.filefront.com?
-
it diddnt work, BCUT lets you add all the torpedo tech except splitting torpedoes
-
I believe I posted a corrected code. Have you tried that?
-
yes, thank you, it works :yay:
-
maybe this is on bcfiles or if not you should add it...
-
it's part of FTech already...
the code is given in the manual...
-
well ill look into adding that to my install later