NathanKell
...
"Can I store the position of the firing ship to some `ship-specific` variables every time it fires?"
Sure. You can do it from either void Ship_FireAction() in AIShip.c or void Ball_AddBall() in AIBalls.c
I suggest the latter as I'm not certain the former is used in every instance when a ship fires.
Add a block of code like so (assuming we're using Ball_AddBall)
{and note I don't add Y pos, but you can (and make the calcs 3D) if you _really_ want to... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/biggrin.gif" style="vertical-align:middle" emoid="
" border="0" alt="biggrin.gif" />, and that I add Y angle, for below.)
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> aCharacter.lastfiredpos.x = aCharacter.ship.Pos.x;
aCharacter.lastfiredpos.z = aCharacter.ship.Pos.z;
aCharacter.lastfiredpos.ay = aCharacter.ship.Ang.y;<!--c2--></div><!--ec2-->
Then you can check that anywhere you have a reference to whose cannonball the ball you're operating on is (which is LastBallCharacter, I believe).
---
For quadrants you use the same stuff only you check both ships and do some trig: first render the enemy ship's coordinates into those based on the firing ship's position and axis (using vector change of base--is that what it's called when you make one vector use as axes another pair?--formulae which I'd need to look up), then check which of X and Z are positive.
It's probably quicker another route, but that makes the (final) comparison easiest.
Then do your deflection check.
---
Re: integration. Mwahaha, yes. Thank you, WinMerge.
Regarding toggleability. I would certain suggest that as worthwhile, but I think you're right in terms of making _everything_ toggleable.
So why not just the speed and angle changes, and leave the rest (new calibers, ricochets, etc.) `always-on`.
---
Cat: MATH! YAY!
Sure. You can do it from either void Ship_FireAction() in AIShip.c or void Ball_AddBall() in AIBalls.c
I suggest the latter as I'm not certain the former is used in every instance when a ship fires.
Add a block of code like so (assuming we're using Ball_AddBall)
{and note I don't add Y pos, but you can (and make the calcs 3D) if you _really_ want to... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/biggrin.gif" style="vertical-align:middle" emoid="

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> aCharacter.lastfiredpos.x = aCharacter.ship.Pos.x;
aCharacter.lastfiredpos.z = aCharacter.ship.Pos.z;
aCharacter.lastfiredpos.ay = aCharacter.ship.Ang.y;<!--c2--></div><!--ec2-->
Then you can check that anywhere you have a reference to whose cannonball the ball you're operating on is (which is LastBallCharacter, I believe).
---
For quadrants you use the same stuff only you check both ships and do some trig: first render the enemy ship's coordinates into those based on the firing ship's position and axis (using vector change of base--is that what it's called when you make one vector use as axes another pair?--formulae which I'd need to look up), then check which of X and Z are positive.
It's probably quicker another route, but that makes the (final) comparison easiest.
Then do your deflection check.
---
Re: integration. Mwahaha, yes. Thank you, WinMerge.
Regarding toggleability. I would certain suggest that as worthwhile, but I think you're right in terms of making _everything_ toggleable.
So why not just the speed and angle changes, and leave the rest (new calibers, ricochets, etc.) `always-on`.
---
Cat: MATH! YAY!