I was asked by VectorX96 to put something together to allow aerial refueling (aka tanking or mid-air refueling) chatter between a pilot and tanker. So I figured I would just throw together some various dialog that could go back and forth between the tanker and the low-fuel aircraft.
But after doing some testing, I decided to create something to actually enable mid-air refueling for any aircraft.
So far it's working pretty well. One of the nice things about this is that it is an alternative to people who don't use ACE2.
Able to use both BIS C-130 aircraft as well as KC-767 from JSDF mod
Chatter back and forth between tanker and player
Vector to tanker from player aircraft, heading of tanker, altitude of tanker, speed of tanker, distance from tanker (when greater than 100 meters from tanker)
Distance from port fuel drogue or from boom arm (as you get within 100 meters of tanker)
attachTo locks aircraft to tanker during refueling (when within 2 meters of fuel drogue or boom arm)
customized placement of different aircraft types during tanking (including many addon aircraft)
accurate fuel loads for different aircraft in lbs
So far, I don't have a hose model so I'm just using a wall lamp as the refueling drogue (as a placeholder). Once you get within 2 meters of that, the refueling takes place. Watch this video for the beta version demonstration.
On Chernarus, there's something wrong with the map because BIS_fnc_dirTo doesn't work correctly there. I read somewhere that the compass was reversed or something. But now I can't find where I read that. - FIXED (I think)
Is there a command which tells a script which map you are on?
EDIT: MEMORY POINTS:
If you are making a plane or helicopter and want it to be compatible with this module out of the box, please name your memory point like this:
"refuel_probe" for compatibility with the drogue like on an F-18, AV-8B Harrier or most helicopters
"refuel_socket" for the receptacle like on the F-16 and F-22
@wolfbite, the AI are a bit dodgy when trying to hook up. But I've gotten the best results by setting just two waypoints over water far apart for the AI tanker to fly toward. In the above video in the first post, I cut out my first two tries and misses at hooking up before the tanker started their turn. But I was able to hook up on the third try.
It definitely takes some practice and some flying skill to get right up in the right spot. Using just the two waypoints seems to give me at least 30 seconds to try and hook up when the tanker is traveling at "normal" speed. If I slowed it down to "limited" in the waypoints, I'm sure I'd get more time. I just have to do some testing. With the waypoints far enough apart and the altitude low enough and there not being any major terrain features underneath, the tanker flys straight and level at least until the turn. Setting the "completion radius" in the waypoint to like 1500 meters helps a lot.
I thought about just recording myself using UnitCapture or whatever it's called. I've done that before and it works great. But it would require a lot more coding on my end and the file sizes and loading times would be extremely long which would suck for slower computers.
I replaced the wall lamp with the 25mm and 10mm red helper spheres as the refueling drogues and hose. Much easier to see now at different times of day.
I've also made this into a module so all you have to do is place a C130, name it "USAF_Heavy", add the Functions Module, add the Aerial Refueling Module and then sync it with any plane or helicopter you want. I've set custom refueling positions for different aircraft and helicopters as well as a "default" position for any new aircraft that will come along in the future.