Author Topic: Fighter Beam force fire  (Read 2799 times)

0 Members and 1 Guest are viewing this topic.

Offline DefCynodont119

  • 210
  • Ascended GTSC-Faustus Artist
    • Steam
Fighter Beam force fire
So, I just picked back up on a thing I was working on that I completely forgot about, and I know why I forgot about it.  :ick:

But instead of bumping that thread: http://www.hard-light.net/forums/index.php?topic=93090.0 << read this first plz I am making a new one. 


Long story short, workaround did not work as intended, so I'm going back to Plan:A.


I now know what the problem is, this script:
Code: [Select]
#Conditional Hooks
$Application: FS2_Open
$On Game Init:
[

function FireAllPri(shipname)

local ship = mn.Ships[shipname]

if ship:isValid() then

for i=1, #ship.PrimaryBanks do
local thisBank = ship.PrimaryBanks[i]

if thisBank:isValid() then
thisBank.Armed = true
ship:firePrimary()
end
end

end

end

]


#End

dose not work if the weapon in question is a Fighter-mounted beam.  (Type-2 as marked in the table files)

If there are any scripting-wizes who understand the intricacies of beam weapon code out here, I could really use your help.



TL;DR I need a way to force fighter-mounted beams to fire.
My gift from Freespace to Cities Skylines:  http://steamcommunity.com/sharedfiles/filedetails/?id=639891299

 

Offline m!m

  • 211
Re: Fighter Beam force fire
The code for the firePrimary function should handle beam weapons but I'm not sure what exactly is required to make them work correctly. Do you have some kind of test mod I could try this out with? Fighter mounted beams are pretty rare so it's not easy to find a mod to test this with.

 

Offline DefCynodont119

  • 210
  • Ascended GTSC-Faustus Artist
    • Steam
Re: Fighter Beam force fire
Soooo, uhh, I was making the test mission, and I discovered that apparently this problem no longer exists,  :wtf:

I did some experimentation, and sometime between build: 3_7_5 and 3_8_0 It just started working.

I don't recall anyone having this issue before, so I do not think this was fixed knowingly. . .  (code be like that)


Granted I did run into a completely unrelated problem now, so there's that. . . .

since this thread is only 3 posts, if I need help I will just change the thread title and start from there. .

Thanks anyway tho  :D
My gift from Freespace to Cities Skylines:  http://steamcommunity.com/sharedfiles/filedetails/?id=639891299

 

Offline m!m

  • 211
Re: Fighter Beam force fire
I don't remember any changes to that function but I'm not going to complain about something that was fixed :p

  

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Fighter Beam force fire
It might have been caused by a different bug that got fixed, but without knowing exactly what version it got fixed in, trying to track it down would be virtually impossible (but hey, it's working, so nobody needs to find out when it got fixed :P).
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.