Author Topic: Sabre Class that comes with KM doesnt have Torpedoes  (Read 5055 times)

Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #40 on: September 19, 2017, 01:59:44 PM »
ok, I've replace the HP with the stock and it still won't load in game here is a picture of the Console report:

https://imgur.com/a/xq7oW
Try changing it from "sabre.py" to "Sabre.py" - capitalize the "S".  BC can get picky about things like that.

Offline AdmiralWhite

  • Posts: 94
  • Cookies: 0
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #41 on: September 19, 2017, 02:16:02 PM »
Morgan you are a Genius!!!! thank you LOL please forgive my ignorance as I am a novice at modding LOL that did the trick. now I can add the modifications I want to add. I also would like to increase the shield strength and add ablative armor as well can I do that or would that be more complicated?.

Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #42 on: September 19, 2017, 02:54:14 PM »
Morgan you are a Genius!!!! thank you LOL please forgive my ignorance as I am a novice at modding LOL that did the trick. now I can add the modifications I want to add. I also would like to increase the shield strength and add ablative armor as well can I do that or would that be more complicated?.
Happy to be of help!  I started off playing with hardpoints about 15 years ago doing little tweaks to ships like what you're doing, so I've been there.  Just keep reading through the hardpoints - staring at them long enough gives you an idea of how they work and you'll gradually, through lots of trial and error, learn what can be modified and how to do it.   :)

Shield strength is easy, you'll see the shield generator property and see the following:

Code: [Select]
ShieldGenerator.SetMaxShields(ShieldGenerator.FRONT_SHIELDS, 9500.000000)
ShieldGenerator.SetMaxShields(ShieldGenerator.REAR_SHIELDS, 9500.000000)
ShieldGenerator.SetMaxShields(ShieldGenerator.TOP_SHIELDS, 9500.000000)
ShieldGenerator.SetMaxShields(ShieldGenerator.BOTTOM_SHIELDS, 9500.000000)
ShieldGenerator.SetMaxShields(ShieldGenerator.LEFT_SHIELDS, 9500.000000)
ShieldGenerator.SetMaxShields(ShieldGenerator.RIGHT_SHIELDS, 9500.000000)
ShieldGenerator.SetShieldChargePerSecond(ShieldGenerator.FRONT_SHIELDS, 12.000000)
ShieldGenerator.SetShieldChargePerSecond(ShieldGenerator.REAR_SHIELDS, 12.000000)
ShieldGenerator.SetShieldChargePerSecond(ShieldGenerator.TOP_SHIELDS, 12.000000)
ShieldGenerator.SetShieldChargePerSecond(ShieldGenerator.BOTTOM_SHIELDS, 12.000000)
ShieldGenerator.SetShieldChargePerSecond(ShieldGenerator.LEFT_SHIELDS, 12.000000)
ShieldGenerator.SetShieldChargePerSecond(ShieldGenerator.RIGHT_SHIELDS, 12.000000)
The values of 9500 are the shield hit points, so increasing that will increase your shield strength for that vector and vice versa.  The recharge rate is just that - how many hit points the shields replenish per second, so same story - higher values yield higher recharge rates.

Adding ablative armor is a similar process to adding the cloak and torpedo launchers I described earlier, but has the added step of needing to modify the ship plugin.  You'll need a hull property labeled as such in the hardpoint, and you also need to make sure that it's not set as your primary hull and non-critical (that way your ship doesn't blow up when the ablative armor fails).  I added ablative armor to my Defiant hardpoint, it looks like this:

Code: [Select]
AblativeArmor = App.HullProperty_Create("Ablative Armor")

AblativeArmor.SetMaxCondition(6000.000000)
AblativeArmor.SetCritical(0)
AblativeArmor.SetTargetable(1)
AblativeArmor.SetPrimary(0)
AblativeArmor.SetPosition(0.000000, 0.000000, 0.000000)
AblativeArmor.SetPosition2D(4.000000, 5.000000)
AblativeArmor.SetRepairComplexity(3.000000)
AblativeArmor.SetDisabledPercentage(0.000000)
AblativeArmor.SetRadius(0.650000)
App.g_kModelPropertyManager.RegisterLocalTemplate(AblativeArmor)
#################################################
Don't forget to add the property code to the bottom of the hardpoint as well:

Code: [Select]
prop = App.g_kModelPropertyManager.FindByName("Ablative Armor", App.TGModelPropertyManager.LOCAL_TEMPLATES)
if (prop != None):
pObj.AddToSet("Scene Root", prop)
What I recommend doing is just copying that above code and pasting it below your "Hull" property.  The "SetMaxCondition" is how many hit points your armor has, so feel free to change that to your liking.

Now the next step requires that you have BCUT installed - you can find the latest version (1.8.1) in the download section.  You'll be using this to modify the ship plugin.  Since you're running KM there's gonna be a couple extra steps that I'll layout for you to ensure you don't mess up the Saber's ship description.

BCUT should automatically locate your Bridge Commander install.  To check, open up the program and go to the "Options" button.  It should show the path its using.  If that looks like your BC directory you're good.  If not, you can click "automatic" to have it lock onto your most recent BC install.  The "manual" button is just that - you'd specify your BC directory manually (if you only have one copy of BC installed you shouldn't need to use this).

So now that you know how to ensure BCUT is locked to your BC directory, let's back up your KM ship plugin first, we'll need to copy some code out of that later to the new plugin.  Go to your scripts/custom/ships folder and copy the "Sabre.py" file to a temporary directory or your desktop.  Once that's done, we'll go into BCUT.

1.  Click on the BCSMC and select "Advanced BCSMC".

2.  Where it says "ship filename" click the dropdown arrow and locate the Sabre.py file.  Once selected the other fields should auto-populate for you.

3.  Under "menu group", select "Fed Ships"

4.  To add the ablative armor, you'll need to select "Edit FTech Properties".  This will bring up another window for you.

5.  Under technologies, select "ablative armour".  In the box to the right, type in the name of your armor - note in the example above I have it listed as "Ablative Armor" in the first line, so if you copied mine that's what you would type.

6.  Under "tech value", you'll see it's currently listed as -1.  You'll change this to however many hit points your armor has (the "SetMaxCondition" we talked about earlier).  You'll change that -1 to whatever value your armor has - in my example it's set to 6000 so that's what I'd type.  If you change it to 8000 type 8000, etc.

7.  Click "apply changes"

8.  Click "generate plugin"

This will generate a new ship plugin, and BCUT will open up your scripts/custom/ships folder afterwards.  The next step is to go into the backup Sabre.py file we copied earlier, I want you to copy the following:

Code: [Select]
Foundation.ShipDef.Sabre.hasTGLName = 1
Foundation.ShipDef.Sabre.hasTGLDesc = 1

What I would do is just paste it below this line in the new plugin:

Code: [Select]
Foundation.ShipDef.Sabre.desc = 'No Description Available'That should do it!  If you did everything right, when you load up the Saber you should have a grey line indicating your armor strength ingame.  When it's depleted, it'll go back to the default green for your primary hull's life.  Let me know how it goes!

Offline AdmiralWhite

  • Posts: 94
  • Cookies: 0
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #43 on: September 19, 2017, 06:58:11 PM »
ran into another snafu wile adding torpedo, I did everything right here's a pic:

https://imgur.com/a/zRc9s

Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #44 on: September 19, 2017, 07:10:56 PM »
ran into another snafu wile adding torpedo, I did everything right here's a pic:

https://imgur.com/a/zRc9s
Can you post that hardpoint file for me so I can take a look?  The console isn't being too specific.


Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #46 on: September 19, 2017, 08:01:40 PM »
here ya go:

https://drive.google.com/file/d/0Bz4ISsr3ugK7alNWak1heUhEbGM/view?usp=sharing
That's the regular KM hardpoint again without any of your modifications?  I need to see the one you modified with the changes.


Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #48 on: September 19, 2017, 08:13:44 PM »
https://drive.google.com/file/d/0Bz4ISsr3ugK7alNWak1heUhEbGM/view?usp=sharing
Thanks!  I think I see the problem, it's located here:

Code: [Select]
        pObj.AddToSet("Scene Root", prop)
prop = App.g_kModelPropertyManager.FindByName("Fwd Torpedo 1", App.TGModelPropertyManager.LOCAL_TEMPLATES)
if (prop != None):
                pObj.AddToSet("Scene Root", prop)
prop = App.g_kModelPropertyManager.FindByName("Aft Torpedo 1", App.TGModelPropertyManager.LOCAL_TEMPLATES)
if (prop != None):
                pObj.AddToSet("Scene Root", prop)
prop = App.g_kModelPropertyManager.FindByName("Aft Torpedo 2", App.TGModelPropertyManager.LOCAL_TEMPLATES)
if (prop != None):
You have an extra that needs to be deleted, just above FwdTorpedo1.  Delete this:

Code: [Select]
        pObj.AddToSet("Scene Root", prop)Leave everything below it alone.  Give that a go and let me know

Offline AdmiralWhite

  • Posts: 94
  • Cookies: 0
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #49 on: September 19, 2017, 08:31:27 PM »

Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #50 on: September 19, 2017, 08:37:58 PM »
deleted the property, but still not working.

https://drive.google.com/file/d/0Bz4ISsr3ugK7OUE5MUMtOU43WXc/view?usp=sharing
Looks like that line you deleted is missing below Aft Torpedo 2.  I should have caught that on the first go.  So this:

Code: [Select]
        pObj.AddToSet("Scene Root", prop)Needs to be below this:

Code: [Select]
prop = App.g_kModelPropertyManager.FindByName("Aft Torpedo 2", App.TGModelPropertyManager.LOCAL_TEMPLATES)
if (prop != None):
Like how you'll see on the other properties above it. 

Offline AdmiralWhite

  • Posts: 94
  • Cookies: 0
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #51 on: September 19, 2017, 08:54:26 PM »
I followed your instructions, but still no joy, should I have deleted the other photon turrets as well since I deleted the properties?

https://drive.google.com/file/d/0Bz4ISsr3ugK7eHZpc0lQdzA3Zjg/view?usp=sharing

Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #52 on: September 19, 2017, 09:09:36 PM »
I followed your instructions, but still no joy, should I have deleted the other photon turrets as well since I deleted the properties?

https://drive.google.com/file/d/0Bz4ISsr3ugK7eHZpc0lQdzA3Zjg/view?usp=sharing
Since you deleted the properties it doesn't matter that the Photon Turrets are still up there.  However, you see where you added the:

Code: [Select]
        pObj.AddToSet("Scene Root", prop)Now check this out:

Code: [Select]
prop = App.g_kModelPropertyManager.FindByName("Aft Torpedo 1", App.TGModelPropertyManager.LOCAL_TEMPLATES)
if (prop != None):
                pObj.AddToSet("Scene Root", prop)
prop = App.g_kModelPropertyManager.FindByName("Aft Torpedo 2", App.TGModelPropertyManager.LOCAL_TEMPLATES)
if (prop != None):
         pObj.AddToSet("Scene Root", prop)
See how the spacing on pObj.AddToSet under Aft Torpedo 2 isn't the same as Aft Torpedo 1?  That's a problem.  Sounds petty but BC is picky like that and you can't argue with a computer sadly.

Offline AdmiralWhite

  • Posts: 94
  • Cookies: 0

Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #54 on: September 19, 2017, 10:59:32 PM »
still no joy ;(

https://drive.google.com/file/d/0Bz4ISsr3ugK7RC11RzdtdHZkNHc/view?usp=sharing
I don't see anything wrong with it.  To confirm I downloaded it and tested it on my own BC install.  Loaded up and played fine.  What's happening when you try to play it?

Offline AdmiralWhite

  • Posts: 94
  • Cookies: 0
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #55 on: September 20, 2017, 07:45:45 AM »
it still doesn't load from the Sovereign bridge, here's the console report:

https://imgur.com/a/vWoo5

Offline KrrKs

  • Posts: 461
  • Cookies: 25
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #56 on: September 20, 2017, 09:46:58 AM »
That looks like you have a 'sabre' instead of 'Sabre' in the plugin file.

Offline AdmiralWhite

  • Posts: 94
  • Cookies: 0
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #57 on: September 20, 2017, 09:57:00 AM »
I saved the py file as Sabre.py

Offline AdmiralWhite

  • Posts: 94
  • Cookies: 0
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #58 on: September 20, 2017, 10:06:06 AM »
new console report, I capitalized the "S":

https://imgur.com/a/NJxit

Offline AdmiralWhite

  • Posts: 94
  • Cookies: 0
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #59 on: September 20, 2017, 10:07:01 AM »
where's the plugin file?