Author Topic: turret-get-secondary-ammo seems broken  (Read 1639 times)

0 Members and 1 Guest are viewing this topic.

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
turret-get-secondary-ammo seems broken
Lepanto is using turret-get-secondary-ammo. It seems to have some problems.

1) is the bank counter 0-indexed or 1-indexed? (we are assuming 0)

2) the sexp always seems to return 0, no matter whether or not the turret's fired, and no matter how much ammo you put in the turret. This makes it pretty bad. I don't know if this is because the sexp is broken, or because turret ammo is broken.

The table entry of the turret being read:

Code: [Select]
$Subsystem: turret23, 4, 3.0
$Alt Subsystem Name: Torpedo Battery
$Default SBanks: ( "Eos" "Eos" "Eos" "Eos" )
$SBank Capacity: (20000, 20000, 20000, 20000)
$Turret Base RotationSnd: 256
$Turret Gun RotationSnd: 257
$Turret BaseSnd Volume: 1.0
$Turret GunSnd Volume: 1.0
$Turret Reset Delay: 15000
$Flags: ( "check hull" "reset when idle" "carry no damage" "carry shockwave" )
$animation: triggered
$type: initial
+relative_angle: 90, -90, 0

Maybe the Eos missile doesn't have a cargo size defined? Or the cargo size is huge? I'll check on that... Eos missile has a pretty normal cargo size of 2
« Last Edit: October 12, 2015, 10:53:52 am by General Battuta »

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: turret-get-secondary-ammo seems broken
I'm on 3.7.3 f32a6e7

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: turret-get-secondary-ammo seems broken
« Last Edit: October 12, 2015, 02:02:48 pm by General Battuta »

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: turret-get-secondary-ammo seems broken
Is this in a Mantis or Github ticket?

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: turret-get-secondary-ammo seems broken
I haven't done one and can't until Monday, if somebody could that'd be cool

 

Offline DahBlount

  • Moderator
  • 29
  • Alpine ☆ Cancer Tribulation
    • Minecraft
    • Skype
    • Steam
Re: turret-get-secondary-ammo seems broken
This should actually be working soon if not now, as we found why the third bank was reading 0, MageKing17 fixed that. As for why the rest appear as 100, that's because FRED saves ammo data as percentages.
As long as the "turret use ammo" flag is set, turrets should be using ammo.
<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 AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: turret-get-secondary-ammo seems broken
Actually, quite a few of the SEXPs in that area of the code appear to be written wrong. They seem to be checking for "node" to be something different without having actually advanced it (but some get away with it because they loop and ignore invalid nodes). So the SEXP probably is broken right now.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline Echelon9

  • 210
Re: turret-get-secondary-ammo seems broken
Do we have this as a Git Issue or Mantis yet from the bug reporter?

Would be helpful to link to it here.

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: turret-get-secondary-ammo seems broken
This was dealt with in PR 377
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Echelon9

  • 210
Re: turret-get-secondary-ammo seems broken
Great, thanks. I thought I'd seen something similar recently on our GitHub.