Here we go!
Step 1: You'll need to install the FSX SDK. If you have FSX Deluxe, it is on Disk 1, under a folder that says SDK. Simply install it here and you're done. Don't have FSX deluxe edition? I think you're out of luck, as it only comes with the Deluxe version. But again, someone please correct me if I am wrong.
Now download the SDK Service Pack update, this includes several new tools and bug fixes, download SP1 here, and SP2 here. You will have to install the service packs in line with the updates for FSX (here is the SP2 update for FSX.) So you'll need to download 4 files, the FSX SP1 Update, the FSX SDK SP1 update, the FSX SP2 update, and the FSX SDK SP2 update... You don't have to update if you're running the original FSX and the original SDK, but the Service Packs include many new features and fixes.
Step 2: You need to add the SDK so it is recognized by FSX.
In order to activate it, we'll need to go this directory:
Windows XP:
C:\Documents and Settings\[USERNAME]\Application Data\Microsoft\FSX
Windows Vista:
C:\Users\[USERNAME]\AppData\Roaming\Microsoft\FSX
You may need to enable viewing of hidden folders to navigate to this directory.
Now, find "dll.xml", and make a backup of this just incase we mess something up. Rename it to "dllbak.xml". Open this file in your favorite text editor such as WordPad. You'll need to find the following lines:
<Launch.Addon> <Name>Traffic Toolbox</Name> <Disabled>True</Disabled> <ManualLoad>False</ManualLoad> <Path>..\Microsoft Flight Simulator X SDK\SDK\Environment Kit\Traffic Toolbox SDK\traffictoolbox.dll</Path> </Launch.Addon>
Change this to:
<Launch.Addon> <Name>Traffic Toolbox</Name> <Disabled>False</Disabled> <ManualLoad>False</ManualLoad> <Path>..\Microsoft Flight Simulator X SDK\SDK\Environment Kit\Traffic Toolbox SDK\traffictoolbox.dll</Path> </Launch.Addon>
Save this file as "dll.xml" (Don't overwrite out backup file!)
Now start up FSX, and if you see Traffic Toolbox under the Tools menu in FSX, you have installed the DLL correctly. (You will need to start a flight.)
Step 3: Here is the fun part. In this portion I will be showing you how to add custom AI flight plans to FSX. This will be using default aircraft, and default airports. If you want to go more advanced and add custom airports and airplanes, see this post here.
On your desktop, make a new shortcut. Under the Target, paste:
C:\Windows\System32\cmd.exe
Name is anything you want, and complete the wizard. Now find the shortcut, Right click it and select Properties. Edit the Start In location to this:
"C:\Program Files\Microsoft Games\Microsoft Flight Simulator X SDK\SDK\Environment Kit\Traffic Toolbox SDK"
Making sure to keep the quotes, and substituting any differences. (IE, the drive letter.)
Doubleclick the shortcut, you should see a command window that says something like:
Microsoft Windows [Version 6.0.6000] Copyright (c) 2006 Microsoft Corporation. All rights reserved. C:\Program Files\Microsoft Games\Microsoft Flight Simulator X SDK\SDK\Environment Kit\Traffic Toolbox SDK>
Substituting your drive letter with the proper one, and you MUST copy and paste the quotation marks ("").
We're going to leave this window alone for now. You can close or minimize this.
Step 4: Making the flight plan. Now we're going to write a sample flight plan...
From the SDK documentation:
Quote
{
departureTime,destinationAirportId,flightLevel[,flightNumber][,circuitEndTime]
departureTime,destinationAirportId,flightLevel[,flightNumber][,circuitEndTime]
# enter as many departures as required
}
Description:
typeKey = one of the typeKeys from fs10.AircraftTypes.csv
tailNumber = unique aircraft tail number
trafficDensity = minimum traffic density required (1 to 100)
repeatEvery = ONE_HOUR, TWO_HOURS, FOUR_HOURS, SIX_HOURS, EIGHT_HOURS, TWELVE_HOURS, ONE_DAY, ONE_WEEK
flightRules = IFR or VFR
departureTime = DHHMM, where D = optional day of the week (0=Monday, 1=Tuesday, etc) and HHMM = zulu hour and minute of the day
destinationAirportId = destination airport ICAO identifier
flightLevel = the flight level, for example 20 = 20,000 feet
flightNumber = optional airline flight number
circuitEndTime = optional time to stop flying circuits at the destination
Above is the way to format the flight plan, along with detailed descriptions of what each value means. Now, I am going to make a sample flight like this:
Aircraft: C172
Tail Number: FSZONE
Traffic Density: 1% (This is the minimum traffic percentage that must be set until this flight shows up)
Repeat Flight: Every Two Hours
Type: VFR
Start Time: 0000 (Zulu Time)
Depart From: KCVG
Flight Level 4,300ft
Arrive At: KDAY
Depart At: 0100 (Depart from Arrival airport, to complete circuit)
Flight Level: 4,300
Now, the first thing I need to do is find the aircraft type, a list of default planes are found here:
C:\Program Files\Microsoft Games\Microsoft Flight Simulator X SDK\SDK\Environment Kit\Traffic Toolbox SDK\fs10.AircraftTypes.cvs
Looking for the aircraft I am using, I find that the Type Key for this aircraft is C172-0. That is all I need, I can actually write my flight plan now. Following the format as the SDK documentation says, here is how I would do it:
C172-0,FSZONE,1,TWO_HOURS,VFR
{
0000,KCVG,43
0100,KDAY,43
}All you need to so it write this in Notepad or Wordpad. Once you've written it, save it here:
C:\Program Files\Microsoft Games\Microsoft Flight Simulator X SDK\SDK\Environment Kit\Traffic Toolbox SDK
You can name it whatever you want, but you MUST make it a .dat extension. I am going to save mine as custom.dat. Now, we have our sample flight plan, and we need to build a BGL file so FSX can recognize it.
Step 5: Compiling the BGL.
Open the shortcut file you made in step 3, once again you should see something like this:
Microsoft Windows [Version 6.0.6000] Copyright (c) 2006 Microsoft Corporation. All rights reserved. C:\Program Files\Microsoft Games\Microsoft Flight Simulator X SDK\SDK\Environmen t Kit\Traffic Toolbox SDK>
Here is the command we're going to send:
TrafficDatabaseBuilder /Output=testtraffic0.bgl /AircraftTypes=fs10.AircraftTypes.csv /Countries=countries_regions.csv /Airports=fs10.Airports.dat /Schedules=custom.dat /AutoSchedule=No /log=log.txt
Lets tear that apart, so you understand it a little better...
TrafficDatabaseBuilder: This is what activates the builder.
/Output=fszonetraffic.bgl: This is our exported BGL file that FSX will use.
/AircraftTypes=fs10.AircraftTypes.csv: This is the list of aircraft types for FSX, this is the default listing.
/Countries=countries_regions.csv: This is the list of countries for FSX, again default.
/Airports=fs10.Airports.dat: Airports for FSX, once again the default listings.
/Schedules=custom.dat: This will be our flight plan file we just saved.
/AutoSchedule=No: This will add all of the default flight plans to our BGL file. I recommend choosing No for this. I will explain later.
/log=log.txt: Our log file, so we can check errors.
Now, paste the command into the Command Prompt, and hit enter. If everything is correct, you should see it compile the traffic file.
Check in the Traffic Toolbox SDK folder for a file called "fszonetraffic.bgl". If it is there, then hopefully everything went well. If not, something didn't go right.
Whether you see a file or not, always check the log.txt file. This will tell any errors you had in your flight plan. For example, I had to adjust my times and cruise altitude before.
Step 6: Installing the BGL file.
As long as your don't have any errors, you can now move your BGL file to the proper directory.
The directory FSX uses is:
C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\Scenery\World\Scenery
Now, let me explain why it is a good idea not to use AutoRoute. FSX is capable of recognizing multiple traffic files in this directory. By default you will have "trafficAircraft.bgl" these are your default flight plans. If you turn AutoRoute On, then you will have duplicate flight plans, and very crowded airports. Keeping AutoRoutes Off will also save you time down the road, as you are able to organize sets of flight plans through different BGL files.
Since FSX can do multiple traffic files, just leave AutoRoute Off for now.
Now, I moved "fszonetraffic.bgl" to the directory above, and thats it! Now I am going to find my AI plane in FSX!
Step 7: Finding our AI!
I set up a flight, and set the proper airport, time, and date so I can view my aircraft. If there is a lot of traffic, you can use the explorer which comes with the SDK. It is under Tools->Traffic SDK->Explorer (You will likely need to exit full screen, Alt+Enter)
Under the explorer, I find my aircraft:
It also shows up on the Views list:
My AI flight:
That about does it for flight plans, we can get into custom airports and aircraft later, but this tutorial was just meant to get you used to how the SDK works, please explorer it more for yourself. I learned all of this in a few days just from reading the documentation.
If you can't get something working, please provide many details, and what the log file from step 5 says if you have it
Sign In
Register
Help
Fszone.org
Videos
Forums
Help
Calendar
Members
Search


Back to top
MultiQuote




