Author Topic: Borg Shield Drain Torpedoes  (Read 3019 times)

Offline vonfrank

  • Posts: 447
  • Cookies: 182
Borg Shield Drain Torpedoes
« on: November 29, 2009, 04:50:26 PM »
I was wanting to make the Borg torpedoes that you see in "Q Who" that drain shields overall but do no dammage to the hull.
The torpedoes would have to drain all shield vectors evenly by a certain ammount no matter what vector they hit.
Is this possible, and how would i go about scripting it?

Offline Worf359Alpha

  • Master HardPointer, Novice Scripter!
  • Posts: 131
  • Cookies: 14
  • Peace Thru Superior Firepower
Re: Borg Shield Drain Torpedoes
« Reply #1 on: November 29, 2009, 08:14:04 PM »
Here try this one its the same one i use, and it does all that you requested, just paste it over one of your own Borg torps. I did not make it and ive forgoten who did, but props to them, cheers.


###############################################################################
#   Filename:   STFCBorgTorp.py
#   
#   Confidential and Proprietary, Copyright 2000 by Totally Games
#   
#   Script for filling in the attributes of DGPulsarTorp torpedoes.
#   
#   Created:   7/21/05 -   Sonc14
###############################################################################

import App

###############################################################################
#   Create(pTorp)
#   
#   Creates a STFCBorgTorp torpedo.
#   
#   Args:   pTorp - the torpedo, ready to be filled-in
#   
#   Return:   zero
###############################################################################
def Create(pTorp):
   kCoreColor = App.TGColorA()
   kCoreColor.SetRGBA(255.0 / 255.0, 300.0 / 255.0, 255.0 / 255.0, 1.000000)
   kGlowColor = App.TGColorA()
   kGlowColor.SetRGBA(149.0 / 255.0, 192.0 / 255.0, 76.0 / 255.0, 1.000000)
   kFlareColor = App.TGColorA()
   kFlareColor.SetRGBA(149.0 / 255.0, 192.0 / 255.0, 76.0 / 255.0, 1.000000)   

   pTorp.CreateTorpedoModel(
               "data/Textures/Tactical/TorpedoCore.tga",
               kCoreColor,
               0.100,
               1.0,   
               "data/Textures/Tactical/TorpedoGlow.tga",
               kGlowColor,
               1.0,   
               0.5,   
               0.6,   
               "data/Textures/Tactical/TorpedoFlares.tga",
               kFlareColor,                              
               60,      
               0.4,      
               0.10)

   pTorp.SetDamage( GetDamage() )
   pTorp.SetDamageRadiusFactor(0.10)
   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.PHOTON)

   return(0)

def GetLaunchSpeed():
   return(45.0)

def GetLaunchSound():
   return("Quantum Torpedo")

def GetPowerCost():
   return(5.0)

def GetName():
   return("Sheild Drainer")

def GetDamage():
   return 100.0

def GetGuidanceLifetime():
   return 14.0

def GetMaxAngularAccel():
   return 0.15

# Sets the minimum damage the torpedo will do
def GetMinDamage():
   return 20

# Sets the percentage of damage the torpedo will do
def GetPercentage():
   return 0.12

def TargetHit(pObject, pEvent):
   pTarget=App.ShipClass_Cast(pEvent.GetDestination())
   MinYield=GetMinDamage()
   Percentage=GetPercentage()
   pShields = pTarget.GetShields()
   for ShieldDir in range(App.ShieldClass.NUM_SHIELDS):
      pShieldStatus=pShields.GetCurShields(ShieldDir)
      pShieldChunk=pShields.GetMaxShields(ShieldDir)*Percentage
      if (MinYield>pShieldChunk):
         pShieldChunk=MinYield
      if (pShieldStatus<=pShieldChunk):
         pShieldStatus=0
      pShields.SetCurShields(ShieldDir,pShieldStatus-pShieldChunk)
   return

def WeaponFired(pObject, pEvent):
   return
500+ HardPointed Ships and counting! Man where do i find the time!

Offline vonfrank

  • Posts: 447
  • Cookies: 182
Re: Borg Shield Drain Torpedoes
« Reply #2 on: November 29, 2009, 10:17:42 PM »
there must be another script in your install somewhere that makes it work properly, because for me, it just acts like a regular torpedo

Offline teleguy

  • Posts: 363
  • Cookies: 53
Re: Borg Shield Drain Torpedoes
« Reply #3 on: November 30, 2009, 05:00:21 AM »

Offline X_TheUnknown_X

  • Posts: 325
  • Cookies: 328
  • (Semi) Retired
Re: Borg Shield Drain Torpedoes
« Reply #4 on: November 30, 2009, 01:31:37 PM »
For draining torpedoes, Glenflet created Realistic Technologies mod which work really well IMO. The advantage with RealTech is that to add abilities such as draining and phasing, it just takes two lines of code. Also, if you set it up right, you can control exactly how much you want the shields drained by (by % of current, damage hitpoints, etc.)

The only downsides are that it's tricky to install (Realtech 1.1 has bugs, so patch 1.1.9 must be installed), and the 1.2 version doesn't work at all. Also, not many others use Realtech, so if it's a mod you're planning - the Furture Technologies pack is probably better.

http://bridgecommander.filefront.com/file/Realistic_Technology_11;87144
and patch..
http://bridgecommander.filefront.com/file/Realistic_Technology_11_Patch_9;88203

Offline vonfrank

  • Posts: 447
  • Cookies: 182
Re: Borg Shield Drain Torpedoes
« Reply #5 on: November 30, 2009, 03:23:45 PM »
I have KM1.0 installed in my game, so do i stll need to download Future Tech? Or is it a prat of KM?

Offline vonfrank

  • Posts: 447
  • Cookies: 182
Re: Borg Shield Drain Torpedoes/Phased Torpedoes
« Reply #6 on: November 30, 2009, 08:14:01 PM »
OK. I downloaded it anyway because i noticed that one of the files in KM was purposely removed so i added it back again and that made it work.

but now i have a problem with the phased torpedo that comes with Future tech. They do an incredible ammount of dammage! they kill EVERYTHING in one hit!?!? is there some way to fix this?

Offline teleguy

  • Posts: 363
  • Cookies: 53
Re: Borg Shield Drain Torpedoes
« Reply #7 on: December 01, 2009, 06:53:05 AM »
The damage the torpedo does is determined by the number behind def GetYield():.

Offline vonfrank

  • Posts: 447
  • Cookies: 182
Re: Borg Shield Drain Torpedoes
« Reply #8 on: December 01, 2009, 12:29:03 PM »
i have tried to alter that, even to as low as 100, but it still kills anything instantly

Offline teleguy

  • Posts: 363
  • Cookies: 53
Re: Borg Shield Drain Torpedoes
« Reply #9 on: December 01, 2009, 12:46:07 PM »
Did you change the GetDamage value?

Offline Dalek

  • Posts: 1529
  • Cookies: 206
Re: Borg Shield Drain Torpedoes
« Reply #10 on: December 01, 2009, 02:46:05 PM »
Yes, it is the GetDamage that gives the actual payload of the torpedo. I didn't even know there was a GetYield part.
"To live on as we have is to leave behind joy, and love, and companionship, because we know it to be transitory, of the moment. We know it will turn to ash. Only those whose lives are brief can imagine that love is eternal. You should embrace that remarkable illusion. It may be the greatest gift your race has ever received."

 - Lorien

Offline USS Frontier

  • Posts: 176
  • Cookies: 562
Re: Borg Shield Drain Torpedoes
« Reply #11 on: December 01, 2009, 03:32:55 PM »
shameless self-advertising...

The EMP Torpedo tech from this little pack, can do that easily.

Just set up the torpedo to give a very low damage or none at all (the GetDamage part).
And besides that, the EMP options: chance set to 100%, and the % you want drained from the shields.
"Revenge is a dish best served cold"
                    -Old Klingon Proverb
GravityFX Download
Galaxy Charts Download

Offline teleguy

  • Posts: 363
  • Cookies: 53
Re: Borg Shield Drain Torpedoes
« Reply #12 on: December 01, 2009, 05:24:24 PM »
Yes, it is the GetDamage that gives the actual payload of the torpedo. I didn't even know there was a GetYield part.

In the case of  FTAs Phased Torpedo GetDamage is supposed to be very low so the shields are not affected. GetYield is the damage that gets translated through the shields.

Offline vonfrank

  • Posts: 447
  • Cookies: 182
Re: Borg Shield Drain Torpedoes
« Reply #13 on: December 01, 2009, 05:30:44 PM »
here is the exact file contents

###############################################################################
#   Filename:   PhasedTorp.py
#   By:      edtheborg
###############################################################################
# This torpedo uses my script torpedo mod...
#
# it actually passes through shields and damages the hull of any vessel
# this torpedo also demonstrates how to use the script torpedo mod
#
# please refer to the TargetHit routine at the very bottom of this file
# as this illustrates how to use a custom script for a torpedo
###############################################################################

import App

###############################################################################
#   Args:   pTorp - the torpedo, ready to be filled-in
#   
#   Return:   zero
###############################################################################
def Create(pTorp):
   kCoreColor = App.TGColorA()
   kCoreColor.SetRGBA(240.0 / 255.0, 0.0 / 255.0, 15.0 / 255.0, 1.000000)
   kGlowColor = App.TGColorA()
   kGlowColor.SetRGBA(100.0 / 255.0, 40.0 / 255.0, 40.0 / 255.0, 1.000000)
   kFlareColor = App.TGColorA()
   kFlareColor.SetRGBA(80.0 / 255.0, 60.0 / 255.0, 70.0 / 255.0, 1.000000)      

   pTorp.CreateTorpedoModel(
               "data/Textures/Tactical/TorpedoCore.tga",
               kCoreColor,
               0.2,
               1.0,   
               "data/Textures/Tactical/TorpedoGlow.tga",
               kGlowColor,
               4.0,   
               0.2,   
               0.7,   
               "data/Textures/Tactical/TorpedoFlares.tga",
               kFlareColor,                              
               6,      
               0.7,      
               0.4)

   pTorp.SetDamage( GetDamage() )
   pTorp.SetDamageRadiusFactor(0.1)
   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.PHASEDPLASMA)

   return(0)

def GetLaunchSpeed():
   return(50)

def GetLaunchSound():
   return("Antimatter Torpedo")

def GetPowerCost():
   return(40.0)

def GetName():
   return("Phased Plasma")

def GetDamage():
   return 0.00001

def GetGuidanceLifetime():
   return 6.0

def GetMaxAngularAccel():
   return 0.3

# sets the damage the torpedo does to the hull
def GetYield():
   return 100

def TargetHit(pObject, pEvent):
   pTarget=App.ShipClass_Cast(pEvent.GetDestination())
   Yield=GetYield
   pHull = pTarget.GetHull()
   if (pHull==None):
      return
   if (pHull.GetCondition()>Yield):
      pHull.SetCondition(pHull.GetCondition()-Yield)
      return
   pTarget.DestroySystem(pHull)
   return




As you can see, the "GetYield" is set to 100. The torpedo still kills anything in one hit?!?!?

Offline teleguy

  • Posts: 363
  • Cookies: 53
Re: Borg Shield Drain Torpedoes
« Reply #14 on: December 01, 2009, 05:49:52 PM »
Try

Code: [Select]
###############################################################################
#   Filename:   PhasedTorp.py
#   By:      edtheborg
###############################################################################
# This torpedo uses my script torpedo mod...
#
# it actually passes through shields and damages the hull of any vessel
# this torpedo also demonstrates how to use the script torpedo mod
#
# please refer to the TargetHit routine at the very bottom of this file
# as this illustrates how to use a custom script for a torpedo
###############################################################################

import App

###############################################################################
#   Args:   pTorp - the torpedo, ready to be filled-in
#  
#   Return:   zero
###############################################################################
def Create(pTorp):
   kCoreColor = App.TGColorA()
   kCoreColor.SetRGBA(240.0 / 255.0, 0.0 / 255.0, 15.0 / 255.0, 1.000000)
   kGlowColor = App.TGColorA()
   kGlowColor.SetRGBA(100.0 / 255.0, 40.0 / 255.0, 40.0 / 255.0, 1.000000)
   kFlareColor = App.TGColorA()
   kFlareColor.SetRGBA(80.0 / 255.0, 60.0 / 255.0, 70.0 / 255.0, 1.000000)      

   pTorp.CreateTorpedoModel(
               "data/Textures/Tactical/TorpedoCore.tga",
               kCoreColor,
               0.2,
               1.0,  
               "data/Textures/Tactical/TorpedoGlow.tga",
               kGlowColor,
               4.0,  
               0.2,  
               0.7,  
               "data/Textures/Tactical/TorpedoFlares.tga",
               kFlareColor,                              
               6,      
               0.7,      
               0.4)

   pTorp.SetDamage( GetDamage() )
   pTorp.SetDamageRadiusFactor(0.1)
   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.PHASEDPLASMA)

   return(0)

def GetLaunchSpeed():
   return(50)

def GetLaunchSound():
   return("Antimatter Torpedo")

def GetPowerCost():
   return(40.0)

def GetName():
   return("Phased Plasma")

def GetDamage():
   return 0.00001

def GetGuidanceLifetime():
   return 6.0

def GetMaxAngularAccel():
   return 0.3

# sets the damage the torpedo does to the hull
def GetYield():
   return 100

def TargetHit(pObject, pEvent):
   pTarget=App.ShipClass_Cast(pEvent.GetDestination())
   Yield=GetYield
   pHull = pTarget.GetHull()
   if (pHull==None):
      return
   elif (pHull.GetCondition()>Yield):
      pHull.SetCondition(pHull.GetCondition()-Yield)
      return
   else:
      pTarget.DestroySystem(pHull)
   return

Offline vonfrank

  • Posts: 447
  • Cookies: 182
Re: Borg Shield Drain Torpedoes
« Reply #15 on: December 01, 2009, 10:05:36 PM »
it still does an unlimited ammount of dammage  :(

Offline jayce

  • Posts: 20
  • Cookies: 2
Re: Borg Shield Drain Torpedoes
« Reply #16 on: December 09, 2009, 05:47:45 AM »
if im reading that script correctly, the getyield = 100 means that the hull will take damage equal to 100% of hull status. a single hit from that torpedo will bring any maximum intergity hull to 0%. if the ship wasn't destroyed on impact from the torpedo, the slightest breeze would be enough to finish it off.

try changing the 100 to 10 = should take 10 hits to destroy
try changing the 100 to 1 = should take 100 hits to destroy

it probably wouldn't hurt to slow the speed of the torpedo down a bit. 50 is quite fast and does have an impact on damage.

Offline vonfrank

  • Posts: 447
  • Cookies: 182
Re: Borg Shield Drain Torpedoes
« Reply #17 on: December 28, 2009, 09:55:28 PM »
It's not that, 10 and even 1 for that value still kills it in one hit

besides, i would really like a dammage value not a percentage

Offline jayce

  • Posts: 20
  • Cookies: 2
Re: Borg Shield Drain Torpedoes
« Reply #18 on: January 01, 2010, 03:54:28 PM »
Sorry, I was thinking of one of my old script tweaks with a simlar problem. But clearly, damage values are not working as you intend. The first thing you have to do is make sure your target is still standing after just one hit. You want to start out small and go from there. Pecentages does just that, ensuring that you don't overshoot your mark. Try this (included with # comment notes):

Code: [Select]
# sets the damage the torpedo does to the hull
def GetYield():
return 0.5 # Value = 50 Percent/50%

def TargetHit(pObject, pEvent):
pTarget=App.ShipClass_Cast(pEvent.GetDestination())
Yield=GetYield # Returns the same value as above as we will be using Yield from this point on in the equations and not GetYield.
pHull = pTarget.GetHull()
if (pHull==None):
return
if (pHull.GetCondition()>Yield): # Lets say Hull Condition is (3416), which is greater than>0.5 as a number in this case, not a %
pHull.SetCondition(pHull.GetCondition()*Yield) # Changes Hull Condition (Hull Condition (3416)*0.5 = 1708)
return
pTarget.DestroySystem(pHull)
return

Since the script is always looking for the hull's current condition value, any hit with this torpedo should set the hull's new condition value, decreasing it by 50 percent for each hit. This script alone should not "1 shot" the targets. If your targets are still dropping after just one hit, then we may need to change the script so that it will look to the hull's maximum condition instead of its current condition.

Offline El

  • Master Hardpointer
  • Retired Administrator
  • Posts: 653
  • Cookies: 123
  • Former Vice Admin
Re: Borg Shield Drain Torpedoes
« Reply #19 on: January 02, 2010, 11:25:51 AM »
shameless self-advertising...

The EMP Torpedo tech from this little pack, can do that easily.

Just set up the torpedo to give a very low damage or none at all (the GetDamage part).
And besides that, the EMP options: chance set to 100%, and the % you want drained from the shields.

This looks to be the solution the OP was looking for.