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

Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #60 on: September 20, 2017, 11:43:09 AM »
where's the plugin file?
scripts/custom/ships

Offline AdmiralWhite

  • Posts: 94
  • Cookies: 0
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #61 on: September 20, 2017, 02:33:02 PM »

Ok, I got the ship loading again however when testing out the torpedoes, the targeting seems to be off, and on the torpedo readout type it list projectile substitute. the forward torpedo seems to be off as you can see in the pic. How do I fix the targeting so the torpedoes actually hit the target. and I also want to add Quantum torpedoes as well so I can switch between the two types. see image.

https://imgur.com/a/axG0f

Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #62 on: September 20, 2017, 04:30:01 PM »
Ok, I got the ship loading again however when testing out the torpedoes, the targeting seems to be off, and on the torpedo readout type it list projectile substitute. the forward torpedo seems to be off as you can see in the pic. How do I fix the targeting so the torpedoes actually hit the target. and I also want to add Quantum torpedoes as well so I can switch between the two types. see image.

https://imgur.com/a/axG0f
That's just the icon, the torpedo launcher itself is functioning normally.  The accuracy of the torpedoes is determined by the projectile itself, not the launcher.  You get best results by waiting to fire until the crosshair is showing the small arrows on each end (see pic for example).

You're getting "ProjectileSubstitute" because the hardpoint is still only loading a placeholder torpedo, not the standard KM photon.  To get the results you'll want, you'll need to edit the following:

Code: [Select]
Torpedosystem.SetMaxTorpedoes(0, 0)
Torpedosystem.SetTorpedoScript(0, "Tactical.Projectiles.Dummy")
Torpedosystem.SetNumAmmoTypes(1)
We talked about editing the torpedoes a little bit in an earlier post, but I'll refresh real quick.  You'll want to change these three lines to the following:

Code: [Select]
Torpedosystem.SetMaxTorpedoes(0, 100)
Torpedosystem.SetTorpedoScript(0, "Tactical.Projectiles.PhotonTorpedo")
Torpedosystem.SetMaxTorpedoes(1, 100)
Torpedosystem.SetTorpedoScript(1, "Tactical.Projectiles.QuantumTorpedo")
Torpedosystem.SetNumAmmoTypes(2)
Can you spot the differences and see what I did?  "SetNumAmmoTypes(2)", since we have two torpedo types loaded.  The first torpedo load is indicated with a 0 for the first number on the "SetMaxTorpedoes" and "SetTorpedoScript" line; the second torpedo load is indicated with a 1.  If you want a third it would be 2, etc., and you'd set number ammo types to 3 like so.  The second number (100) is simply the number of torpedoes you have of that type - change that to your liking for each one.

The "SetTorpedoScript" line is telling is what projectile you want to use and where it is located, in this case for your photons, the hardpoint will look for a script named "PhotonTorpedo" in the scripts/Tactical/Projectiles folder.

Give those a go real quick and let me know how everything is working :)

Offline AdmiralWhite

  • Posts: 94
  • Cookies: 0
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #63 on: September 20, 2017, 05:08:20 PM »

Offline AdmiralWhite

  • Posts: 94
  • Cookies: 0
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #64 on: September 20, 2017, 08:44:02 PM »
I followed your instructions, I don't know where I went wrong

Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #65 on: September 20, 2017, 11:29:19 PM »
I followed your instructions, I don't know where I went wrong
You got a name mismatch.  Take a look:

Code: [Select]
Torpedosystem.SetMaxTorpedoes(0, 100)
Torpedosystem.SetTorpedoScript(0, "Tactical.Projectiles.PhotonTorpedo")
Torpedoes.SetMaxTorpedoes(1, 100)
Torpedoes.SetTorpedoScript(1, "Tactical.Projectiles.QuantumTorpedo")
Torpedosystem.SetNumAmmoTypes(2)
See how everywhere else it says "Torpedosystem", but the line you added starts with "Torpedoes"?  That's where the error lies.  You gotta change those to "Torpedosystem" just like the rest of that property.

Offline AdmiralWhite

  • Posts: 94
  • Cookies: 0
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #66 on: September 21, 2017, 08:44:12 AM »
OK, I changed Torpedoes to Torpedo system and the ship still doesn't load in game. see file

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

Offline AdmiralWhite

  • Posts: 94
  • Cookies: 0
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #67 on: September 21, 2017, 08:48:13 AM »
I also would like to set the option of torpedo spread e.g.: single, dual, and quad. can I also increase the explosive yield as well?

Offline AdmiralWhite

  • Posts: 94
  • Cookies: 0
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #68 on: September 21, 2017, 02:58:57 PM »
Should I also delete the firing chain line?

Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #69 on: September 21, 2017, 04:34:30 PM »
OK, I changed Torpedoes to Torpedo system and the ship still doesn't load in game. see file

https://drive.google.com/file/d/0Bz4ISsr3ugK7TXVtaF9ObFFwQlE/view?usp=sharing
You got a typo on this line:

Quote
Torpedoesystem.SetMaxTorpedoes(1, 150)
It says "torpedoesystem", not "torpedosystem".  Just fix that one line and you should be ok.

Quote
I also would like to set the option of torpedo spread e.g.: single, dual, and quad. can I also increase the explosive yield as well?
Setting up torpedo spreads is a bit complicated and I won't have time to go into detail on how to do that today, but sometime this weekend I'll walk you through the process.  FYI, it's kind of lengthy.

As for the explosive yield of the torpedoes, that requires modifying the individual projectile scripts in scripts/tactical/projectiles.  You can find the .py's in the corresponding KM SRC folder.  Once you pull them up and look at them it should be pretty obvious how to increase the damage :)

Quote
Should I also delete the firing chain line?
No, leave that alone.  Even something that looks miniscule can drastically screw up your game if you mess with it wrong.

Offline AdmiralWhite

  • Posts: 94
  • Cookies: 0
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #70 on: September 21, 2017, 08:00:47 PM »
its woking now. I look forward to your tutorial over weekend on increasing the yield.

Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #71 on: September 22, 2017, 01:06:18 AM »

Offline AdmiralWhite

  • Posts: 94
  • Cookies: 0
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #72 on: September 22, 2017, 07:51:24 AM »
I also want to add bottom and aft phaser because after doing some testing, I noticed my ship doesn't have any protection there. and I would also like to personalize my ship with its own name. e.g. USS Oberon, NCC-61983. is there a way to do that?

Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #73 on: September 22, 2017, 11:47:53 AM »

Offline Nebula

  • BC elder / BCC Vice Admin
  • Administrator
  • Posts: 5499
  • Cookies: 1129
  • KM - Mod Team Member & BC - Elder (2002)
    • 9th fleet HQ
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #74 on: September 22, 2017, 08:38:21 PM »
it says right in there it's a case mismatch. Most likely the S on the Py needs to be capitalized.
Canon is what people argue exists on ships that don't exist.

Offline AdmiralWhite

  • Posts: 94
  • Cookies: 0
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #75 on: September 24, 2017, 12:59:02 AM »
I look forward to your phaser tutorial.

Offline KrrKs

  • Posts: 461
  • Cookies: 25
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #76 on: September 24, 2017, 07:48:40 AM »
For phasers you really need to use the SDK's modelpropertyeditor. There should be a "modelpropertyeditor.html" introduction/howto file in the sdk main folder. Especially the faq section at the end is important, w.r.t. the hp size scaling.

To add a phaser you create a new phaserproperty (or similar), or better yet, clone an existing one and move that one. That way, all the variable controlling the look, sound, fire duration and damage will already be set and you only need to change position, size and orientation and what else you want to change. You need to look out a bit with the firing arcs in respect to orientation when you place the phaser.

Offline JimmyB76

  • Posts: 6423
  • Cookies: 421
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #77 on: September 24, 2017, 11:26:37 AM »
i think this thread has veered waaaaaay offtopic from its original intent...
has the original question about the Sabre Class been answered and solved somewhere in the last 4 pages?

if so, please create a new thread in Modding forum for any other questions relating to Modding BC...


thx :)

Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #78 on: September 24, 2017, 11:50:08 AM »
i think this thread has veered waaaaaay offtopic from its original intent...
has the original question about the Sabre Class been answered and solved somewhere in the last 4 pages?

if so, please create a new thread in Modding forum for any other questions relating to Modding BC...


thx :)
The original issue was indeed about adding torpedoes and it seems to have... umm... evolved yes.

AdmiralWhite, if you're still in need of further assistance after reviewing all the tutorials around here and in the SDK as mentioned by KrrKs, by all means feel free to create a new post and we'll all assist as best we can.  If you encounter hiccups be sure to include a console report with any troubleshooting requests.

I know I promised to at least walk you through how to do torpedo spreads, so I'll PM you those instructions when I get time.

Offline AdmiralWhite

  • Posts: 94
  • Cookies: 0
Re: Sabre Class that comes with KM doesnt have Torpedoes
« Reply #79 on: September 24, 2017, 02:43:37 PM »
not a problem, I figured since we were on the topic of torpedoes I wanted to ask about phasers as well. my apologies for deviating.