Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: General Battuta on October 12, 2015, 10:50:30 am

Title: turret-get-secondary-ammo seems broken
Post by: General Battuta on October 12, 2015, 10:50:30 am
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
Title: Re: turret-get-secondary-ammo seems broken
Post by: General Battuta on October 12, 2015, 11:00:46 am
I'm on 3.7.3 f32a6e7
Title: Re: turret-get-secondary-ammo seems broken
Post by: General Battuta on October 12, 2015, 01:56:32 pm
Mission file: http://pastebin.com/qqdmpt7c

Table file: http://pastebin.com/R4M0m4fn

Weapon file: http://pastebin.com/wU7K1Qj1
Title: Re: turret-get-secondary-ammo seems broken
Post by: Goober5000 on October 15, 2015, 11:59:44 am
Is this in a Mantis or Github ticket?
Title: Re: turret-get-secondary-ammo seems broken
Post by: General Battuta on October 15, 2015, 12:08:04 pm
I haven't done one and can't until Monday, if somebody could that'd be cool
Title: Re: turret-get-secondary-ammo seems broken
Post by: DahBlount on October 15, 2015, 01:40:15 pm
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.
Title: Re: turret-get-secondary-ammo seems broken
Post by: AdmiralRalwood on October 15, 2015, 01:49:34 pm
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.
Title: Re: turret-get-secondary-ammo seems broken
Post by: Echelon9 on October 22, 2015, 02:26:08 am
Do we have this as a Git Issue or Mantis yet from the bug reporter?

Would be helpful to link to it here.
Title: Re: turret-get-secondary-ammo seems broken
Post by: The E on October 22, 2015, 02:34:28 am
This was dealt with in PR 377 (https://github.com/scp-fs2open/fs2open.github.com/pull/377)
Title: Re: turret-get-secondary-ammo seems broken
Post by: Echelon9 on October 22, 2015, 02:41:11 am
Great, thanks. I thought I'd seen something similar recently on our GitHub.