Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: General Battuta on October 05, 2015, 05:37:39 pm

Title: BATTUTA'S HUBRIS AROUSES PREPOSTEROUS BUG
Post by: General Battuta on October 05, 2015, 05:37:39 pm
I have a tale of bomb-pumped lasers, boom distances, and coordinate systems to tell you once we figure out WHAT THE **** IS GOING ON
Title: Re: BATTUTA'S HUBRIS AROUSES PREPOSTEROUS BUG
Post by: General Battuta on October 05, 2015, 05:38:51 pm
But uh it seems that weapons with $Detonation Radius will detonate instantly inside your fighter if fired when within the $Detonation Radius of the mission origin?

More to follow
Title: Re: BATTUTA'S HUBRIS AROUSES PREPOSTEROUS BUG
Post by: General Battuta on October 05, 2015, 05:55:45 pm
Repro mission: http://pastebin.com/5aUG1418

You will need to use this weapon tbm: http://pastebin.com/uULWBDTj
 
(requires BP2 and a recent nightly, sorry)

I am on sprint for BP right now so I can't get this into Mantis right away but hopefully the repro mission is illuminating.

Title: Re: BATTUTA'S HUBRIS AROUSES PREPOSTEROUS BUG
Post by: General Battuta on October 05, 2015, 06:15:31 pm
[18:54] <MageKing17> This may be a simple order-of-operations problem.
[18:57] <MageKing17> Basically, battuta, here's what's happening.
[18:58] <MageKing17> weapon_set_tracking_info() sets the homing object/subsystem, and then relies on weapon_home() to set the actual homing position.
[18:58] <MageKing17> weapon_home() is called in weapon_process_post().
[18:58] <MageKing17> Detonation radius is checked in weapon_process_pre().
[18:59] <MageKing17> So it's checking how far away from the missile homing_pos is before homing_pos has actually been set in the first place. :P
[18:59] <EatThePath> sounds noodly
[19:00] <Phantom__Hoover> no, it's pretty straightforward
[19:01] <MageKing17> It's tempting to just nuke the homing_pos check altogether, but then it would be absolute distance to the target ship's center regardless of how far away the targeted subsystem was, so that's obviously a no-go.
[19:01] <MageKing17> So instead weapon_set_tracking_info() will probably need to be modified to set homing_pos.
Title: Re: BATTUTA'S HUBRIS AROUSES PREPOSTEROUS BUG
Post by: headdie on October 06, 2015, 01:14:06 am
http://www.hard-light.net/forums/index.php?topic=70050.msg1384027#msg1384027
Title: Re: BATTUTA'S HUBRIS AROUSES PREPOSTEROUS BUG
Post by: AdmiralRalwood on October 06, 2015, 01:53:58 am
On the plus side, I have another quote for my forum sig:
Quote
<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.