Author Topic: Scripting Within Projectiles & FTech Issues  (Read 1441 times)

Offline vonfrank

  • Posts: 447
  • Cookies: 182
Scripting Within Projectiles & FTech Issues
« on: March 20, 2018, 11:36:47 PM »
I'm trying to add a few special event scripts to some projectiles within my install. Specifically, I want to create:
  • A torpedo that disables the Shield Generator of the target for 10 seconds. (Breen Energy Draining Torpedo)
  • A torpedo that drains all 6 vectors of a target's shields by a certain amount. (Borg Shield Inversion Pulse)
  • A torpedo that creates a unique animated explosion and sound when impacting a target. (Malon Spatial Charge)
  • A torpedo that ignores shielding and impacts directly on the hull. (Krenim Chroniton Torpedo)
  • A torpedo that ignores shielding and hull and directly damages whatever subsystem is being targeted. (Transphasic Torpedo)
  • A torpedo that fires a single shot then splits up into 9 individual projectiles. (Galaxy Class Photon Spread)

I know FTech can accomplish most (if not all) of these things, but when I add it to my install, it simply doesn't seem to work. The game doesnt crash and the mutator shows up on the config menu, but adding the script sections to a projectile doesn't do anything. It might be because I have a minimalist install with only BASIC Foundation in order to keep SP fully playable, but I'm not sure.

Any assistance with getting FTech to work or help adding these functions without FTech would be appreciated.

Offline Blackrook32

  • BC Files Admin
  • Vice Administrator
  • Posts: 561
  • Cookies: 1077
    • Blackrook32's YouTube Channel
Re: Scripting Within Projectiles & FTech Issues
« Reply #1 on: March 21, 2018, 12:40:09 AM »
I'm trying to add a few special event scripts to some projectiles within my install. Specifically, I want to create:
  • A torpedo that disables the Shield Generator of the target for 10 seconds. (Breen Energy Draining Torpedo)
  • A torpedo that drains all 6 vectors of a target's shields by a certain amount. (Borg Shield Inversion Pulse)
  • A torpedo that creates a unique animated explosion and sound when impacting a target. (Malon Spatial Charge)
  • A torpedo that ignores shielding and impacts directly on the hull. (Krenim Chroniton Torpedo)
  • A torpedo that ignores shielding and hull and directly damages whatever subsystem is being targeted. (Transphasic Torpedo)
  • A torpedo that fires a single shot then splits up into 9 individual projectiles. (Galaxy Class Photon Spread)

I know FTech can accomplish most (if not all) of these things, but when I add it to my install, it simply doesn't seem to work. The game doesnt crash and the mutator shows up on the config menu, but adding the script sections to a projectile doesn't do anything. It might be because I have a minimalist install with only BASIC Foundation in order to keep SP fully playable, but I'm not sure.

Any assistance with getting FTech to work or help adding these functions without FTech would be appreciated.

I know this may sound simplistic, but are you adding the FTech line codes to the given Custom/Ships .py in question?

I normally use FTech as an defensive add-on, in my ship packs.


" Fortune Favors the Bold "

Offline vonfrank

  • Posts: 447
  • Cookies: 182
Re: Scripting Within Projectiles & FTech Issues
« Reply #2 on: March 21, 2018, 01:23:06 AM »
I was a little confused about that to be honest. Currently, I have this layout, using an Intrepid Class as an example:

Code: [Select]
Foundation.ShipDef.Intrepid.dTechs = {"Damper Weapon": 1}

Is that even correct though? What exactly does that do within the ship file?

Offline Blackrook32

  • BC Files Admin
  • Vice Administrator
  • Posts: 561
  • Cookies: 1077
    • Blackrook32's YouTube Channel
Re: Scripting Within Projectiles & FTech Issues
« Reply #3 on: March 21, 2018, 03:24:13 AM »
I was a little confused about that to be honest. Currently, I have this layout, using an Intrepid Class as an example:

Code: [Select]
Foundation.ShipDef.Intrepid.dTechs = {"Damper Weapon": 1}

Is that even correct though? What exactly does that do within the ship file?

You have to add the FTech code in the chosen Custom/Ship.py, for it too be effective.

Here is an example I have, from my Steamrunner Mod Pack...

Code: [Select]
Foundation.ShipDef.STCMPSteamrunner.dTechs = {
   "Ablative Armour": 9000,
   "Regenerative Shields": 100,
   "Reflector Shields": 85,
   "AutoTargeting": {"Phaser": [8,1]}
}

The name of the ship MUST be the same exactly of the Custom/Ship .py; as defined in the sample code above. In your case the Intrepid. Copying and pasting the code, from a script you know that works, is probably your best shot.

Also, I would recommend using the latest Bridge Commander Universal Tool mod. It has a feature, where you can easily add FTech, to any Custom/ship script.py.


" Fortune Favors the Bold "

Offline Mark McWire

  • Posts: 83
  • Cookies: 1010
Re: Scripting Within Projectiles & FTech Issues
« Reply #4 on: March 21, 2018, 05:33:55 AM »
I'm trying to add a few special event scripts to some projectiles within my install. Specifically, I want to create:
  • A torpedo that disables the Shield Generator of the target for 10 seconds. (Breen Energy Draining Torpedo)
  • A torpedo that drains all 6 vectors of a target's shields by a certain amount. (Borg Shield Inversion Pulse)
  • A torpedo that creates a unique animated explosion and sound when impacting a target. (Malon Spatial Charge)
  • A torpedo that ignores shielding and impacts directly on the hull. (Krenim Chroniton Torpedo)
  • A torpedo that ignores shielding and hull and directly damages whatever subsystem is being targeted. (Transphasic Torpedo)
  • A torpedo that fires a single shot then splits up into 9 individual projectiles. (Galaxy Class Photon Spread)


Any assistance with getting FTech to work or help adding these functions without FTech would be appreciated.

I am working on my on Tech Framework that can do these things. Please show in http://www.bc-central.net/forums/index.php/topic,10366.0.html


Offline vonfrank

  • Posts: 447
  • Cookies: 182
Re: Scripting Within Projectiles & FTech Issues
« Reply #5 on: March 21, 2018, 05:44:58 PM »
You have to add the FTech code in the chosen Custom/Ship.py, for it too be effective.

Here is an example I have, from my Steamrunner Mod Pack...

Code: [Select]
Foundation.ShipDef.STCMPSteamrunner.dTechs = {
   "Ablative Armour": 9000,
   "Regenerative Shields": 100,
   "Reflector Shields": 85,
   "AutoTargeting": {"Phaser": [8,1]}
}

The name of the ship MUST be the same exactly of the Custom/Ship .py; as defined in the sample code above. In your case the Intrepid. Copying and pasting the code, from a script you know that works, is probably your best shot.

Also, I would recommend using the latest Bridge Commander Universal Tool mod. It has a feature, where you can easily add FTech, to any Custom/ship script.py.

But don't you add torpedo tech to the projectile py file? I don't really understand how adding any information to the custom/ships py file makes an energy drain torpedo (for example) function with a certain projectile weapon script.

Offline Blackrook32

  • BC Files Admin
  • Vice Administrator
  • Posts: 561
  • Cookies: 1077
    • Blackrook32's YouTube Channel
Re: Scripting Within Projectiles & FTech Issues
« Reply #6 on: March 21, 2018, 07:11:25 PM »
But don't you add torpedo tech to the projectile py file? I don't really understand how adding any information to the custom/ships py file makes an energy drain torpedo (for example) function with a certain projectile weapon script.

Here, let me put it another way. :s

Do you have the FTech torpedo installed correctly? ex. scripts/Custom/Techs

Your Custom/Ship script .py MUST have the FTech code line included, in order use the FTech torpedo.

I have recently released four major "working" ship packs using FTech. I was suggesting this might be a solution to your problem.

But, it's really up to you; too try solution or not.  :)


" Fortune Favors the Bold "

Offline vonfrank

  • Posts: 447
  • Cookies: 182
Re: Scripting Within Projectiles & FTech Issues
« Reply #7 on: March 22, 2018, 12:11:18 AM »
Do you have the FTech torpedo installed correctly? ex. scripts/Custom/Techs

The FTech installation included "Immunity.py" "IsoKineticTorp.py" "PhaseCloak.py" "PhasedTorp.py" and "TractorBeams.py" in the "scripts/Custom/Techs" folder. Nothing else. The "scripts/ftb/tech" folder seems to include the various torpedoes, including the "DamperWeapon.py" file. Does this seem correct? I downloaded this version of FTech from Nexus.

Also, what FTech code line needs to be in the Custom/ship script? I know I need this part:

Code: [Select]
Foundation.ShipDef.Intrepid.dTechs = {}
But what do I put in the brackets to allow the Damper Weapon to work? The Readme file doesn't give an example of that as far as i can tell. Only examples for ship techs like Ablative Armor or Drainer Immunity.

Offline Mark McWire

  • Posts: 83
  • Cookies: 1010
Re: Scripting Within Projectiles & FTech Issues
« Reply #8 on: March 22, 2018, 03:42:04 AM »
To use a special projectile tech, you have to add following lines in the projectile script in tactical/projectiles:

Code: [Select]
sYieldName = 'Damper Weapon'
sFireName = None

try:
import FoundationTech
try:
oFire = FoundationTech.oTechs[sFireName]
FoundationTech.dOnFires[__name__] = oFire
except:
pass

try:
oYield = FoundationTech.oTechs[sYieldName]
FoundationTech.dYields[__name__] = oYield
except:
pass
except:
pass

or

Code: [Select]
try:
sYieldName = 'Phased Torpedo'
import FoundationTech
try:
oYield = FoundationTech.oTechs[sYieldName]
FoundationTech.dYields[__name__] = oYield
except:
pass
except:
pass



Offline vonfrank

  • Posts: 447
  • Cookies: 182
Re: Scripting Within Projectiles & FTech Issues
« Reply #9 on: March 22, 2018, 09:08:51 AM »
To use a special projectile tech, you have to add following lines in the projectile script in tactical/projectiles:

Code: [Select]
sYieldName = 'Damper Weapon'
sFireName = None

try:
import FoundationTech
try:
oFire = FoundationTech.oTechs[sFireName]
FoundationTech.dOnFires[__name__] = oFire
except:
pass

try:
oYield = FoundationTech.oTechs[sYieldName]
FoundationTech.dYields[__name__] = oYield
except:
pass
except:
pass

or

Code: [Select]
try:
sYieldName = 'Phased Torpedo'
import FoundationTech
try:
oYield = FoundationTech.oTechs[sYieldName]
FoundationTech.dYields[__name__] = oYield
except:
pass
except:
pass

I have done so, and nothing happens when the torpedo impacts the target vessel. I've tried various torpedo techs and none of them seem to work. Is that the only thing I need to do in order for it to function?

This all leads me to believe Basic Foundation may not be enough for FTech to work properly.

Offline Mark McWire

  • Posts: 83
  • Cookies: 1010
Re: Scripting Within Projectiles & FTech Issues
« Reply #10 on: March 22, 2018, 10:27:10 AM »
Okay, I had the same problem. I only had the patch 1.1 and the Foundation installed with the FoundationTech and modified the torpedoes via BCUT. Nothing happens.
Because I did not want to go troubleshooting forever, I just installed the glenflet alternative package. It's called Realistic Technology.

It is working. It's also easier to handle, as you just need to include simple methods in the Torpedo scripts that just return numeric values.

For example my TestTorpedo:

Code: [Select]
from bcdebug import debug
import App

from Tactical.Projectiles.PhotonTorpedo import *

def GetName():
return("Test")

def Anyon():
    return 0
   
def Magneton():
    return 0
   
def Graviton():
    return 0
   
def Tachyon():
    return 0
   
def Tetryon():
    return 0
   
def Verteron():
    return 2
   

It represents actually a Verteron Charge Torpedo, because the Verteron methode returns a value of 2, the others a value of 0.

Offline vonfrank

  • Posts: 447
  • Cookies: 182
Re: Scripting Within Projectiles & FTech Issues
« Reply #11 on: May 20, 2018, 12:37:21 AM »
Still trying to figure this out really...

Right now I'm using QB Autostart to enable the ability to load scripts directly into a projectile file. Problem is, QB Autostart breaks the SinglePlayer Story.

So is there a way to add scripts to torpedoes without using QB Autostart?

Offline Lurok91

  • Posts: 1309
  • Cookies: 2062
  • SPMod Developer (Retired)
    • Lurok91 Mods
Re: Scripting Within Projectiles & FTech Issues
« Reply #12 on: May 20, 2018, 01:39:26 PM »
QBA v1.0 should work ok with SP campaign. (we used it in Maelstrom Mod)

Offline vonfrank

  • Posts: 447
  • Cookies: 182
Re: Scripting Within Projectiles & FTech Issues
« Reply #13 on: May 20, 2018, 03:14:47 PM »
QBA v1.0 should work ok with SP campaign. (we used it in Maelstrom Mod)

There's a QBA 1.0? I always thought there was only ever 0.91 released. Got a link for it by any chance?

Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Re: Scripting Within Projectiles & FTech Issues
« Reply #14 on: May 21, 2018, 09:49:14 AM »
There's a QBA 1.0? I always thought there was only ever 0.91 released. Got a link for it by any chance?
It's the version included in KM - you'd have to extract it from that.