Author Topic: Rapid fire torpedo launcher not reloading completely  (Read 2966 times)

Offline Anew9

  • Posts: 197
  • Cookies: 1
Rapid fire torpedo launcher not reloading completely
« on: October 06, 2018, 08:15:56 AM »
Hey everyone,

I recently found a way to create a rapid firing torpedo launcher WITHOUT using a pulse weapon launcher.

-I just went into the hardpoints script and set max ready torpedoes to 1 launcher at 10
- reload delay 40
- immediate delay to 0
- Deleted the other launchers
- Set firing chain to 0; single;53;Full spread (make sure the torpedo launchers are in these firing groups)
- Launch game
- Target enemy set spread to full spread and fire.

Torpedoes are now rapid firing.

BUT...

For some reason after launching a full volley fully, the tubes don't ever fully reload back to 10 again for the rest of the battle. In fact, they actually start firing fewer and fewer torpedoes - even when I set torpedoes to single spread again AFTER firing full. 

Does anyone know how to fix this issue? It doesn't happen when I only fire torpedoes in single spread pattern, only when I use my new spread config.

Offline Tethys

  • -=USF=- Co-Leader
  • Posts: 256
  • Cookies: 89
Re: Rapid fire torpedo launcher not reloading completely
« Reply #1 on: October 06, 2018, 10:06:39 AM »
What torpedo is the hp using? Can you upload the file so we can have a look at the modified code? Check the projectiles, there may be a power cost to be accounted for that may be preventing the torpedoes from fully reloading. Have you checked the warp core/battery in F5 when using the rapid fire torpedoes? There may also be a power cost in the hardpoint as well. As a test, you could make the warp core conduits insanely high and see if your torpedoes last longer. That would be a fairly quick test. Or eliminate power costs from the projectile py and the hardpoint torp launcher(s)

Offline Anew9

  • Posts: 197
  • Cookies: 1
Re: Rapid fire torpedo launcher not reloading completely
« Reply #2 on: October 06, 2018, 11:01:47 AM »
What torpedo is the hp using? Can you upload the file so we can have a look at the modified code? Check the projectiles, there may be a power cost to be accounted for that may be preventing the torpedoes from fully reloading. Have you checked the warp core/battery in F5 when using the rapid fire torpedoes? There may also be a power cost in the hardpoint as well. As a test, you could make the warp core conduits insanely high and see if your torpedoes last longer. That would be a fairly quick test. Or eliminate power costs from the projectile py and the hardpoint torp launcher(s)

I don't think the torpedoes themselves use power to launch - only disruptor weapons.

I check my main battery levels during weapons firing and they don't move much.

The issue only happens when I completely empty the tube using my Full spread. If I don't empty the tube, it reloads back to 10.

Offline Anew9

  • Posts: 197
  • Cookies: 1
Re: Rapid fire torpedo launcher not reloading completely
« Reply #3 on: October 06, 2018, 11:05:27 AM »
ForwardTorpedoTube = App.TorpedoTubeProperty_Create("Forward Torpedo Tube")

ForwardTorpedoTube.SetMaxCondition(2400.000000)
ForwardTorpedoTube.SetCritical(0)
ForwardTorpedoTube.SetTargetable(1)
ForwardTorpedoTube.SetPrimary(1)
ForwardTorpedoTube.SetPosition(0.005519, -0.055472, -0.147180)
ForwardTorpedoTube.SetPosition2D(49.000000, 55.000000)
ForwardTorpedoTube.SetRepairComplexity(3.000000)
ForwardTorpedoTube.SetDisabledPercentage(0.500000)
ForwardTorpedoTube.SetRadius(0.200000)
ForwardTorpedoTube.SetDumbfire(1)
ForwardTorpedoTube.SetWeaponID(0)
ForwardTorpedoTube.SetGroups(25)
ForwardTorpedoTube.SetDamageRadiusFactor(0.200000)
ForwardTorpedoTube.SetIconNum(370)
ForwardTorpedoTube.SetIconPositionX(76.000000)
ForwardTorpedoTube.SetIconPositionY(35.000000)
ForwardTorpedoTube.SetIconAboveShip(1)
ForwardTorpedoTube.SetImmediateDelay(0.000000)
ForwardTorpedoTube.SetReloadDelay(40.000000)
ForwardTorpedoTube.SetMaxReady(10)
ForwardTorpedoTubeDirection = App.TGPoint3()
ForwardTorpedoTubeDirection.SetXYZ(0.000000, 1.000000, 0.000000)
ForwardTorpedoTube.SetDirection(ForwardTorpedoTubeDirection)
ForwardTorpedoTubeRight = App.TGPoint3()
ForwardTorpedoTubeRight.SetXYZ(-1.000000, 0.000000, 0.000000)
ForwardTorpedoTube.SetRight(ForwardTorpedoTubeRight)
App.g_kModelPropertyManager.RegisterLocalTemplate(ForwardTorpedoTube)
#################################################

Torpedoes = App.TorpedoSystemProperty_Create("Torpedoes")

Torpedoes.SetMaxCondition(8000.000000)
Torpedoes.SetCritical(0)
Torpedoes.SetTargetable(0)
Torpedoes.SetPrimary(1)
Torpedoes.SetPosition(0.000000, 0.000000, 0.000000)
Torpedoes.SetPosition2D(64.000000, 60.000000)
Torpedoes.SetRepairComplexity(3.000000)
Torpedoes.SetDisabledPercentage(0.750000)
Torpedoes.SetRadius(0.200000)
Torpedoes.SetNormalPowerPerSecond(100.000000)
Torpedoes.SetWeaponSystemType(Torpedoes.WST_TORPEDO)
Torpedoes.SetSingleFire(0)
Torpedoes.SetAimedWeapon(1)
kFiringChainString = App.TGString()
kFiringChainString.SetString("0;Single;53;Full spread")
Torpedoes.SetFiringChainString(kFiringChainString)
Torpedoes.SetMaxTorpedoes(0, 200)
Torpedoes.SetTorpedoScript(0, "Tactical.Projectiles.PhotonTorpedo")
Torpedoes.SetNumAmmoTypes(1)
App.g_kModelPropertyManager.RegisterLocalTemplate(Torpedoes)
#################################################

Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Re: Rapid fire torpedo launcher not reloading completely
« Reply #4 on: October 06, 2018, 02:14:29 PM »
ForwardTorpedoTube = App.TorpedoTubeProperty_Create("Forward Torpedo Tube")

ForwardTorpedoTube.SetMaxCondition(2400.000000)
ForwardTorpedoTube.SetCritical(0)
ForwardTorpedoTube.SetTargetable(1)
ForwardTorpedoTube.SetPrimary(1)
ForwardTorpedoTube.SetPosition(0.005519, -0.055472, -0.147180)
ForwardTorpedoTube.SetPosition2D(49.000000, 55.000000)
ForwardTorpedoTube.SetRepairComplexity(3.000000)
ForwardTorpedoTube.SetDisabledPercentage(0.500000)
ForwardTorpedoTube.SetRadius(0.200000)
ForwardTorpedoTube.SetDumbfire(1)
ForwardTorpedoTube.SetWeaponID(0)
ForwardTorpedoTube.SetGroups(25)
ForwardTorpedoTube.SetDamageRadiusFactor(0.200000)
ForwardTorpedoTube.SetIconNum(370)
ForwardTorpedoTube.SetIconPositionX(76.000000)
ForwardTorpedoTube.SetIconPositionY(35.000000)
ForwardTorpedoTube.SetIconAboveShip(1)
ForwardTorpedoTube.SetImmediateDelay(0.000000)
ForwardTorpedoTube.SetReloadDelay(40.000000)
ForwardTorpedoTube.SetMaxReady(10)
ForwardTorpedoTubeDirection = App.TGPoint3()
ForwardTorpedoTubeDirection.SetXYZ(0.000000, 1.000000, 0.000000)
ForwardTorpedoTube.SetDirection(ForwardTorpedoTubeDirection)
ForwardTorpedoTubeRight = App.TGPoint3()
ForwardTorpedoTubeRight.SetXYZ(-1.000000, 0.000000, 0.000000)
ForwardTorpedoTube.SetRight(ForwardTorpedoTubeRight)
App.g_kModelPropertyManager.RegisterLocalTemplate(ForwardTorpedoTube)
#################################################

Torpedoes = App.TorpedoSystemProperty_Create("Torpedoes")

Torpedoes.SetMaxCondition(8000.000000)
Torpedoes.SetCritical(0)
Torpedoes.SetTargetable(0)
Torpedoes.SetPrimary(1)
Torpedoes.SetPosition(0.000000, 0.000000, 0.000000)
Torpedoes.SetPosition2D(64.000000, 60.000000)
Torpedoes.SetRepairComplexity(3.000000)
Torpedoes.SetDisabledPercentage(0.750000)
Torpedoes.SetRadius(0.200000)
Torpedoes.SetNormalPowerPerSecond(100.000000)
Torpedoes.SetWeaponSystemType(Torpedoes.WST_TORPEDO)
Torpedoes.SetSingleFire(0)
Torpedoes.SetAimedWeapon(1)
kFiringChainString = App.TGString()
kFiringChainString.SetString("0;Single;53;Full spread")
Torpedoes.SetFiringChainString(kFiringChainString)
Torpedoes.SetMaxTorpedoes(0, 200)
Torpedoes.SetTorpedoScript(0, "Tactical.Projectiles.PhotonTorpedo")
Torpedoes.SetNumAmmoTypes(1)
App.g_kModelPropertyManager.RegisterLocalTemplate(Torpedoes)
#################################################
You're just posting code but you're not telling us why you are doing so.  Are you asking us to look and make sure you edited something correctly?  Are you asking if these are things you need to edit?  What's the deal?

Offline Anew9

  • Posts: 197
  • Cookies: 1
Re: Rapid fire torpedo launcher not reloading completely
« Reply #5 on: October 06, 2018, 02:22:35 PM »
You're just posting code but you're not telling us why you are doing so.  Are you asking us to look and make sure you edited something correctly?  Are you asking if these are things you need to edit?  What's the deal?

Tethys said he wanted to see the code I edited to see why my weapons aren't reloading fully.

Offline Tethys

  • -=USF=- Co-Leader
  • Posts: 256
  • Cookies: 89
Re: Rapid fire torpedo launcher not reloading completely
« Reply #6 on: October 06, 2018, 02:40:16 PM »
Yes I wanted to look at the code. Perhaps there may be a way to unload all torpedoes except for one, tricking the bug. I will get back to you when I have a little more time later tonight.

Offline Anew9

  • Posts: 197
  • Cookies: 1
Re: Rapid fire torpedo launcher not reloading completely
« Reply #7 on: October 06, 2018, 03:19:01 PM »
Yes I wanted to look at the code. Perhaps there may be a way to unload all torpedoes except for one, tricking the bug. I will get back to you when I have a little more time later tonight.

I was thinking the same thing. I even set the maxready to 11 and would count to 10 while firing but it's silly to need to do that - plus I can't tell when I'm on the last torpedo without counting.

Something else I noticed that was interesting is that every time I empty the tube, the next volley that is reloaded fires 1 torpedo LESS. EVERY. TIME. Until it stops at 6. Furthermore, this only effects the FORWARD torpedo tube; the rear tubes always usually reload completely.

What seems to minimize this is to set the immediatedelay to -0.99999 and that stops the reloaded tube from reloading below 6 torpedoes.

Offline Tethys

  • -=USF=- Co-Leader
  • Posts: 256
  • Cookies: 89
Re: Rapid fire torpedo launcher not reloading completely
« Reply #8 on: October 06, 2018, 05:17:06 PM »
Can you show me the code for the rear tube please?

Also, have you tried to fire rear torpedo spread first, before firing front spread? What do you mean by "usually" reloads to 10 for rear tubes? I would do a specific test of the rear tubes, I have a hunch that it may not matter which tubes are unloaded first, as whichever is unloaded first may present your bug.

Another thing you might try is to add a dummy torpedo type with 0 ammo and see if switching back and forth fully reloads the tubes to 10.

Code: [Select]
Torpedoes.SetMaxTorpedoes(0, 200)
Torpedoes.SetTorpedoScript(0, "Tactical.Projectiles.PhotonTorpedo")
Torpedoes.SetMaxTorpedoes(1, 0)
Torpedoes.SetTorpedoScript(1, "Tactical.Projectiles.QuantumTorpedo")
Torpedoes.SetNumAmmoTypes(2)

Offline King Class Scout

  • Posts: 1775
  • Cookies: 893
  • the other half of SFRD
Re: Rapid fire torpedo launcher not reloading completely
« Reply #9 on: October 06, 2018, 05:27:42 PM »
I'm gonna keep an eye on this and see if you get it (both of you) working correctly.  script innovation like this is nice to see again.

besides, Anew answered a tube question that's come up while I'm fixing a hardpoint for beta release.  cheers.

btw...have a cookie!
OS novel fan

Coming Soon: King's Mod Tuning Shop

best line I've ever read
Me: mine [my bridges] would probably be simple to get the characters to use.  the only person that sits is the captian.
Baz: space is vast there[sic] legs will be tired by the time they get to the next planet

Offline Anew9

  • Posts: 197
  • Cookies: 1
Re: Rapid fire torpedo launcher not reloading completely
« Reply #10 on: October 06, 2018, 09:33:29 PM »
Can you show me the code for the rear tube please?

Also, have you tried to fire rear torpedo spread first, before firing front spread? What do you mean by "usually" reloads to 10 for rear tubes? I would do a specific test of the rear tubes, I have a hunch that it may not matter which tubes are unloaded first, as whichever is unloaded first may present your bug.

Another thing you might try is to add a dummy torpedo type with 0 ammo and see if switching back and forth fully reloads the tubes to 10.

Code: [Select]
Torpedoes.SetMaxTorpedoes(0, 200)
Torpedoes.SetTorpedoScript(0, "Tactical.Projectiles.PhotonTorpedo")
Torpedoes.SetMaxTorpedoes(1, 0)
Torpedoes.SetTorpedoScript(1, "Tactical.Projectiles.QuantumTorpedo")
Torpedoes.SetNumAmmoTypes(2)

I already tried to switch torpedo types on my sovereign class with the exact same rapid fire script but the forward tube does the same thing - I thought that might expose the problem also.

Offline Anew9

  • Posts: 197
  • Cookies: 1
Re: Rapid fire torpedo launcher not reloading completely
« Reply #11 on: October 06, 2018, 09:34:21 PM »
I'm gonna keep an eye on this and see if you get it (both of you) working correctly.  script innovation like this is nice to see again.

besides, Anew answered a tube question that's come up while I'm fixing a hardpoint for beta release.  cheers.

btw...have a cookie!

Thank you! Hopefully, we can figure this out.

Offline Anew9

  • Posts: 197
  • Cookies: 1
Re: Rapid fire torpedo launcher not reloading completely
« Reply #12 on: October 06, 2018, 09:36:18 PM »
Can you show me the code for the rear tube please?

AftTorpedoTube = App.TorpedoTubeProperty_Create("Aft Torpedo Tube")

AftTorpedoTube.SetMaxCondition(2400.000000)
AftTorpedoTube.SetCritical(0)
AftTorpedoTube.SetTargetable(1)
AftTorpedoTube.SetPrimary(1)
AftTorpedoTube.SetPosition(-0.004098, -2.586010, -0.475469)
AftTorpedoTube.SetPosition2D(59.000000, 100.000000)
AftTorpedoTube.SetRepairComplexity(3.000000)
AftTorpedoTube.SetDisabledPercentage(0.500000)
AftTorpedoTube.SetRadius(0.250000)
AftTorpedoTube.SetDumbfire(1)
AftTorpedoTube.SetWeaponID(4)
AftTorpedoTube.SetGroups(4)
AftTorpedoTube.SetDamageRadiusFactor(0.200000)
AftTorpedoTube.SetIconNum(370)
AftTorpedoTube.SetIconPositionX(77.000000)
AftTorpedoTube.SetIconPositionY(116.000000)
AftTorpedoTube.SetIconAboveShip(1)
AftTorpedoTube.SetImmediateDelay(-0.999990)
AftTorpedoTube.SetReloadDelay(40.000000)
AftTorpedoTube.SetMaxReady(10)
AftTorpedoTubeDirection = App.TGPoint3()
AftTorpedoTubeDirection.SetXYZ(0.000000, -1.000000, 0.000000)
AftTorpedoTube.SetDirection(AftTorpedoTubeDirection)
AftTorpedoTubeRight = App.TGPoint3()
AftTorpedoTubeRight.SetXYZ(-1.000000, 0.000000, 0.000000)
AftTorpedoTube.SetRight(AftTorpedoTubeRight)
App.g_kModelPropertyManager.RegisterLocalTemplate(AftTorpedoTube)
#################################################

Offline Anew9

  • Posts: 197
  • Cookies: 1
Re: Rapid fire torpedo launcher not reloading completely
« Reply #13 on: October 06, 2018, 09:44:11 PM »

Also, have you tried to fire rear torpedo spread first, before firing front spread? What do you mean by "usually" reloads to 10 for rear tubes? I would do a specific test of the rear tubes, I have a hunch that it may not matter which tubes are unloaded first, as whichever is unloaded first may present your bug.


Yup, that's the problem. Whichever tube you deplete first presents this bug; forward or aft.

So this is the pattern:

1) Set torpedo to full spread - fire all 10 until empty
2) Next reloaded volley has only 9 torpedoes loaded and won't reload that 1 remaining
3) Fire the 9 torps until empty in full spread
4) Next reloaded volley has 8 torps etc.

If you continue to fire in full spread the loaded torps will decrease until 6 and then won't go any lower (usually).

Offline Tethys

  • -=USF=- Co-Leader
  • Posts: 256
  • Cookies: 89
Re: Rapid fire torpedo launcher not reloading completely
« Reply #14 on: October 06, 2018, 10:30:17 PM »
Idea: Duplicate the forward launcher in the hardpoint. Rename the duplicate so there is no conflict, dont forget the label (or whatever its called, I cant recall) at the bottom of the hardpoint. Both forward rapid launchers should empty simultaneously, or if we are lucky one will take precedence over the other. I would like to know if you get 18 or 19 torpedoes upon reload. If 19, the solution could simply be to add a dummy forward launcher with a SetMaxReady of either 0 or 1. Ideally we would want to use 0 so there is no extra torpedoes throwing off the spread, as the tube would by default read as depleted. Good luck; until tomorrow.

I assume that the problem lies outside the ship hardpoint. You might need to SetMaxTorpedoes on the dummy (quantum) torps to 20 to fill all launchers when switched, I do see you tried the switch without success.

It will be tomorrow before I can look any further into the code. From what I can see at first glance the launchers look good. It might be time to look for clues elsewhere, perhaps whatever script handles loading the projectile. Something tells me its in the foundation, but maybe we will get lucky tomorrow.

Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Re: Rapid fire torpedo launcher not reloading completely
« Reply #15 on: October 06, 2018, 10:52:45 PM »
Tethys said he wanted to see the code I edited to see why my weapons aren't reloading fully.
Ah ok.  I should have read above.

Offline Anew9

  • Posts: 197
  • Cookies: 1
Re: Rapid fire torpedo launcher not reloading completely
« Reply #16 on: October 07, 2018, 10:42:59 AM »
Idea: Duplicate the forward launcher in the hardpoint. Rename the duplicate so there is no conflict, dont forget the label (or whatever its called, I cant recall) at the bottom of the hardpoint. Both forward rapid launchers should empty simultaneously, or if we are lucky one will take precedence over the other. I would like to know if you get 18 or 19 torpedoes upon reload. If 19, the solution could simply be to add a dummy forward launcher with a SetMaxReady of either 0 or 1. Ideally we would want to use 0 so there is no extra torpedoes throwing off the spread, as the tube would by default read as depleted. Good luck; until tomorrow.

I assume that the problem lies outside the ship hardpoint. You might need to SetMaxTorpedoes on the dummy (quantum) torps to 20 to fill all launchers when switched, I do see you tried the switch without success.

It will be tomorrow before I can look any further into the code. From what I can see at first glance the launchers look good. It might be time to look for clues elsewhere, perhaps whatever script handles loading the projectile. Something tells me its in the foundation, but maybe we will get lucky tomorrow.

I just tested that idea out this morning. I set up another torpedo tube with set max ready as 0 but the problem still exists for whatever launcher is emptied first.

Then I tried creating another launcher with a setmaxready of 1, to see if that tube will take the bug away from my main launcher - didn't work.

Something about my main launchers that causes this bug. Maybe its the amount of torpedoes that can be loaded?

Ive tried loading 5 and increasing the reload speed but the bug persists.

Offline Tethys

  • -=USF=- Co-Leader
  • Posts: 256
  • Cookies: 89
Re: Rapid fire torpedo launcher not reloading completely
« Reply #17 on: October 07, 2018, 10:54:33 AM »
Which forward launcher is emptied first? Does the second forward launcher reload completely? Did they both deplete at the same time? Do they both fail to reload completely? Perhaps try SetReloadDelay on the new forward launcher to 39.0 instead of 40.0 as you have for the first launcher. Also change SetDumbFire 0 on both launchers. If I remember, this option disallows launching from the tube if another launcher is actively firing. Also, good morning.

Offline Anew9

  • Posts: 197
  • Cookies: 1
Re: Rapid fire torpedo launcher not reloading completely
« Reply #18 on: October 07, 2018, 11:13:01 AM »
Which forward launcher is emptied first? Does the second forward launcher reload completely? Did they both deplete at the same time? Do they both fail to reload completely? Perhaps try SetReloadDelay on the new forward launcher to 39.0 instead of 40.0 as you have for the first launcher. Also change SetDumbFire 0 on both launchers. If I remember, this option disallows launching from the tube if another launcher is actively firing. Also, good morning.

Good morning!

I set the second launcher to fire only 1 torp so it empties first and I increased the reload delay so that I wouldn't use it for the rest of the fight but the bug still persists on the main launcher.

I'll try the dumbfire option

EDIT: Dumbfire option didn't work

Offline Tethys

  • -=USF=- Co-Leader
  • Posts: 256
  • Cookies: 89
Re: Rapid fire torpedo launcher not reloading completely
« Reply #19 on: October 07, 2018, 11:38:58 AM »
I set the second launcher to fire only 1 torp so it empties first and I increased the reload delay so that I wouldn't use it for the rest of the fight but the bug still persists on the main launcher.

Also, maybe try 0 for both SetMaxReady and SetReloadDelay for the duplicate forward launcher. I still have a feeling the problem will be found outside the hardpoint file. I will see if I can look for clues in other files.