We all know how bad the AI is at flying planes, I've experienced it lots of times. But, I think I may have come up with an idea to solve that.
Instead of making the AI find the best time to drop a bomb, how about we just let the AI worry about flying the plane and a script handle all the weapon stuff. From what I can tell, it's an easy system, I just need help getting it into script form. So, let's see if we can figure some of this physics stuff (its been a while) and see if we can't get a script working.
Here is how it would work.
#1. A target would be specified, either being called directly by the mission maker or perhaps via a trigger, all that matters is that there is a set target.
#2. An AI plane would be airborne, set on careless, and once the target has been specified a move waypoint would be set over the target.
#3. The script would run, and would compute a firing solution. The solution would have to include speed, aircraft height, direction in relation to the target, and distance to target.
#4. This part needs to be discussed. Either a bomb would be camcreated underneath the aircraft, or a fire command would be given to the aircraft. Personally, I think the first option would be easier.
-----------------------------------------------------------------------------------------
Advantages:
*We avoid the problem of aircraft not attacking men, because the script would not worry about the class of the target, just it's position.
*The script can cheat, well kind of. The plane doesn't have to be facing the target exactly, it can be slightly offset and the player would never know.
*The AI won't worry about targeting, so they can worry about staying airborne.
Alright guys, I need some help. I've got most of the calculations down (or so I think), so I just need some help getting this into script form.
Math: (This is mainly just me thinking out loud, getting my thoughts out)
*Airtime = sqrt(2*distance)/9.8
*Distance = airtime * aircraftvelocity