I've been through this recently too. I found the same - a lot of how to do it is spread across various wikis and it's not so clear.
Here's what I figured out and works for me. This is on OS X Big Sur. and FG 2020.3.6. Should be easily modifiable for other OSses:
1) Make sure you have some prerequisites installed - (Mac only) firstly you need the xcode command line tools - install by opening a terminal and typing
- Code: Select all
xcode-select --install
You also need git (which comes with the Xcode tools) and python2 - OS X only comes with python 3 so the easiest way to get python 2 is to install 'homebrew' and then install the python2 cask. For Windows, you'll need to install git and python2 however this is done in windows (apologies - I don't know how to do this).
2) Make a directory for working in and storing the needed executables. Open a terminal in this directory.
3) In this directory, clone the d-laser-fgtools tools
- Code: Select all
git clone https://github.com/mherweg/d-laser-fgtools.git
4) in the master working directory, make a directory for the airport - in my case EHKD. open a terminal in this directory.
5) in the airport directory, download the airport you want to update from the X Plane gateway by using the gateway_pull.py script - when in the airport directory:
- Code: Select all
python2 /path/to/d-laser-fgtools/gateway_pull.py - i <airport ICAO code>
6) convert the airport from X-plane to flightgear with the dsf2aptdat.py script - in the airport directory
- Code: Select all
python2 /path/to/d-laser-fgtools/dsf2aptdat.py -i <airport ICAO code>
7) open the <airport>.dat created by the script in X-Plane World Editor to check it's got everything needed, make any edits, then export to a new .dat if required, making sure to export in X Plane 10.5 format.
8 ) open the resulting <airport>.dat file in a text editor and rearrange the first few lines as follows:
a) First line needs to be a capital letter 'I' (as in India)
b) second line needs to the airport descriptor
c) third line needs to be '1050 Generated by WorldEditor 2.3.1r1' (or whichever version was used)
Example below:
- Code: Select all
I
1 1 0 0 EHKD De Kooy
1050 Generated by WorldEditor 2.3.1r1
9) upload the resulting .dat file to the flightgear airport web generator -
http://ns334561.ip-5-196-65.eu/tgweb/ and follow the instructions. Then download the zip the site generates that contains the airport .btg file. Put this in the working directory for now. Note i'm using the web generator as i've not managed to get terragear and genapt850 installed locally on OS X yet (still working on it).
10) Copy the .btg and .dat file to your custom scenery folder as described here
https://forum.flightgear.org/viewtopic.php?f=5&t=30734 and specify this scenery path in the launcher (--fg-scenery=/path/to/Scenery). Note the part at the bottom of the article 'Technical Details' - this is the key part for making FG pick up the custom airport.dat and the scenery models and then display it correctly - the Scenery/Terrain/xxxxxxx/yyyyyyy/ICAO.btg path needs to be the same as that in the master FG scenery directory. What I did was search for there ICAO.btg filename in the master scenery directory, make a note of the folder names, then replicate the directory structure in my custom scenery directory, then put the custom .btg there.
11) Launch flightgear with the UFO at the new airport and check everything is as it should be,
The key steps seem to be step 6 that converts (or removes) the incompatible X-plane objects. After this, the 'converted' airport can be opened in Worldeditor to add anything that's missing, and then placing the scenery generated in the correct locations as per step 9 so that FG picks it up.
Hope this helps,
Tom