Author Topic: Weapon proprieties  (Read 1503 times)

Offline webxro

  • Posts: 57
  • Cookies: 0
Weapon proprieties
« on: August 23, 2010, 01:06:11 PM »
Hy i'm working on a shield upgrade , now does anyone know a way to get the proprieties of the weapon that's hitting my shield , and explain simple , i'm new to python , but i know well AS3 and PHP.

Offline teleguy

  • Posts: 363
  • Cookies: 53
Re: Weapon proprieties
« Reply #1 on: August 23, 2010, 02:24:07 PM »
I recently did this for a script. I used FTechs "OnDefense" which is called every time a ship is hit. You can get more info about it from the readme that comes with FTech.


Your script would then look like this:

Ftech stuff:
Code: [Select]
class ShieldtechDef(FoundationTech.TechDef):
        def OnDefense(self, pShip, pInstance, oYield, pEvent):

                if oYield:
                        if oYield.IsPhaseYield() or oYield.IsDrainYield():
                                return

Code to get the weapon properties:
Code: [Select]
                pWeapon = App.Weapon_Cast(pEvent.GetSource())

pWeapon.GetRechargeRate()
pWeapon.GetNormalDischargeRate()
pWeapon.GetMaxCharge()
pWeapon.GetMinFiringCharge()
pWeapon.GetFireSound()
pWeapon.GetFireStartSound()
pWeapon.GetFireLoopSound()
pWeapon.GetPowerSetting()
pWeapon.GetMaxDamage()
pWeapon.GetMaxDamageDistance()
pWeapon.GetChargeLevel()
pWeapon.GetChargePercentage()

more Ftech stuff:

Code: [Select]
        def OnBeamDefense(self, pShip, pInstance, oYield, pEvent):
                return self.OnDefense(pShip, pInstance, oYield, pEvent)

        def OnPulseDefense(self, pShip, pInstance, pTorp, oYield, pEvent):
                return self.OnDefense(pShip, pInstance, oYield, pEvent)

        def OnTorpDefense(self, pShip, pInstance, pTorp, oYield, pEvent):
                return self.OnDefense(pShip, pInstance, oYield, pEvent)

        def Attach(self, pInstance):
                pInstance.lTechs.append(self)
                pInstance.lTorpDefense.insert(0, self)
                pInstance.lPulseDefense.insert(0, self)
                pInstance.lBeamDefense.insert(0, self)


oShieldtech = ShieldtechDef('Shieldtech')







Offline webxro

  • Posts: 57
  • Cookies: 0
Re: Weapon proprieties
« Reply #2 on: August 23, 2010, 04:18:27 PM »
would it work to find out the SetOuterCoreColor for a customized  shield glow , now i am wondering why it wasn't done again

Offline teleguy

  • Posts: 363
  • Cookies: 53
Re: Weapon proprieties
« Reply #3 on: August 23, 2010, 04:29:28 PM »
For a phaser use pWeapon.GetOuterCoreColor() but I don't know if it's possible to change the shield glow color on the fly. BC treats some parts of the hardpoint pretty inflexibly I've been told.

Offline webxro

  • Posts: 57
  • Cookies: 0
Re: Weapon proprieties
« Reply #4 on: August 24, 2010, 06:34:58 AM »
Thanks i will try that , when i have time , for the torpedo i think that i found a think in Ftech to do the job .