Author Topic: Turret Ammo Help  (Read 980 times)

0 Members and 1 Guest are viewing this topic.

Offline Black Wolf

  • Twisted Infinities
  • Global Moderator
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
Hey SCPeople.

I'm trying to get a handle on the new Turret Secondary Ammo, and I'm not having much luck. Trying to get a Fusion Mortar to fire from a turret, using this in my shp.tbm:

Code: [Select]
$Subsystem: turret14a,8.0,12.0
$Alt Subsystem Name: Main Launcher
$Default SBanks: ( "Fusion Mortar")
$SBank Capacity: ( 75 )
$Flags: ( "check hull" "no subsystem targeting" "turret use ammo")

The Fusion Mortar has a cargo size of 1.0 defined in the weapons table, so it should work just fine. But for some reason, it won't fire at all. If I remove the secondary ammo stuff entirely, the turret fires just fine. What am I doing wrong?

There was a suggestion on IRC that I needed to define each turret's capacity on a per mission basis using sexps, but that seems enormously inefficient. And when I tried that, I still couldn't get it to fire.

Also, just to confirm - do the turret-set-secondary-ammo and turret-get-secondary-ammo sexps return percentages, or integers? I.e., in my above example, after firing 25 Fusion mortars, would turret-get-secondary-ammo return 66.66667 (i.e. the percentage remaining) or 50 (i.e. the number of missiles and, coincidentally for this example, the number of arbitrary cargo units remaining).

Really excited to get this feature working for obvious reasons (Going to be massive for future FL chapters) so any help would be greatly appreciated.
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp

 

Offline DahBlount

  • Moderator
  • 29
  • Alpine ☆ Cancer Tribulation
    • Minecraft
    • Skype
    • Steam
I believe you need to encapsulate the ammo count in quotations, "75".

The sexps return integer values.
<Axem> yet still more insightful than #hard-light

<Axem> jad2.23 will just be cat videos

<DahBlount> So
<DahBlount> JAD2.2 is like that
<Axem> maybe
<Axem> it can be whatever you like!
<DahBlount> A Chocolate Sundae?
<Axem> sure

My models: GTF Gilgamesh - GTD Nuadha [Redesigning] - Ningirama [WIP] - GTG Zephyrus

 

Offline Black Wolf

  • Twisted Infinities
  • Global Moderator
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
Hmm... adding quote marks to the ammo count didn't help - could you possibly post the exact table entry you used to test the Narayana?

Also, just to confirm then, if my turret has 20 missiles, it fires off five of them, it will return a figure of 15?
« Last Edit: August 08, 2015, 01:33:13 am by Black Wolf »
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp

 

Offline SF-Junky

  • 29
  • Bread can mold, what can you do?
 :bump:

I'm bringing up this old thread because I experienced trouble with this, too. The core problem is that FRED seems to calculate in units of 1000 when you manually change the bank's capacity. But one thing at a time.

What I have is this:

Code: [Select]
$Subsystem: turret01-torp, 0.8, 3.0
$Default SBanks: ( "Shark#Three" )
$SBank Capacity: ( 100000 )
$Flags: ( "turret use ammo" )

Initially, Shark#Three was a weapon that fires voleys of three missiles where each missile has a cargo size of 10.

Now if I put a ship with that turret in a little test mission and open the weapons tab it shows me a capacity of 10,000. Because FRED always shows the actual number of missiles you can fire and not the capacity and 100,000/10 = 10,000.

In a specific mission, I want that turret to fire only ten volleys which is a capacity of 30. This, however, is always rounded down to 0. If I enter values >50, they are rounded up to 100. If you then enter the mission in the text editor, you see this:

Code: [Select]
+Subsystem: turret01-torp
+Sbank Ammo: ( 1 )

So I went on from there and put a 3 in there. This gave me a capacity of 300 missiles. So +Sbank Ammo: ( 3 ) seems to be qual to $SBank Capacity: ( 3000 ).

I then went further on to change cargo size to 100 in the wep.tbm and opened the mission file in fred again. It then showed me the correct number of 30 missiles.

As for the situation Black Wolf described over four years ago, the FusionMortar's cargo size also needs to be so that you get 75 as a division out of a multiple of 1,000 and the cargo size, e.g. 40. (3,000/40 = 75)

I don't know if what I say is fully correct. It's what I deducted from me playing around with it. Anyway, changing the turret ammunition in FRED by the looks of it gives you a totally different calculation formula for the actual number of missiles. And I don't think that this is a situation we want to maintain.

I really hope that one of the coders can say something about this. :)


Supplemental: The turret also seems to be able to fire one more volley once capacity is down to 0. So it always goes down to -3. :D
« Last Edit: January 19, 2020, 01:55:12 pm by SF-Junky »

 

Offline SF-Junky

  • 29
  • Bread can mold, what can you do?
LoL, I'm such an idiot.  :lol: :lol: :lol: :lol: :lol: :lol:

Now I get it.

When you change the bank capacity in FRED, then it uses a percentage share of the value you put in $SBank Capacity: in the wep.tbm. This is why in my case the capacity is always a multiple of 1,000. Because it calculates in whole % numbers.

And it took me only four hours to figure it out. :p

My conclusion is still correct, imo. I think the mission file should use the same measure (i.e. the actual capacity instead of a percentage share of it) than the table file to compute loadout. Or at least allow for decimals.
« Last Edit: January 19, 2020, 02:05:00 pm by SF-Junky »