This tutorial is
possible through the efforts of Jeff Stanyer, who mentored me through
this process via email over several weeks. He put up with a ton of
bandwidth going his way asking questions that were sometimes pointless,
useless, meaningless, and which often contained the answer in my
description of the problem I was asking him to solve. None of this --
the tutorials, the lowered framerate impact in my sceneries, even the
redesigned macros to lower the overall polygon count -- would have been
possible without his vast storehouse of knowledge and his EXCEPTIONAL
patience and understanding. As I posted about him in another forum, "If
'ere's a 'eaven som-'ere, e'll be th' bloke standin' roun' the rivers
o' wine tellin' St Peter 'ow ta change it into BEER!!!!!!" Thanks, Jeff!
1. SCASM
-- you will need this program to compile your XML file into the
correctly formatted .bgl scenery file for use in your scenery; get it
HERE
and install it in a directory that you will use to keep the 3rd party
macros in and where you will generate your XML file to place those
macros.
2. Copy the below code and, using Wordpad, paste
the code into the new document and save it with a name that will let
you readily identify what it is and why it was created:
;*********************************
; START OF CODE FOR PEASE AFB NH 2
;*********************************
Set( buf 100 )
Set( areamx 64 )
Set( linbuf 64 )
Set( ppperr 2000 )
UVar( $FSSCTEMP1 5 )
Header( 1 N43:05:43.9500 N43:03:36.0000 W070:48:24.0000 W070:50:15.9900 )
LatRange( N43:03:36.0000 N43:05:43.9500)
;ILS RUNWAY 16
Macro( F:\SargeCIV3\ilss_v10.api N43:05:15.1560 W070:49:45.9178 20 0.1 160.00 0 0 0 0 10000 0.0 1 v2= 100 0 0 0 0 0 0 )
;**************
; END OF CODE
;**************Make sure you have copied-pasted the
ENTIRE above code, exactly as is -- nothing left out, and nothing extra. The parts you need to change will be highlighted in
red as we move through this tutorial.
3. In the same directory,
put any macros you have downloaded that were created by other
designers. You will need two files per macro -- the .api or .scm macro
file itself, and either a .bmp or .jpg image of the macro. DO NOT USE A
TEXTURE .bmp IMAGE -- you need to see a picture of the completed macro
as it will appear in the scenery to make sure you are getting ready to
call out the correct macro.
4. Change the header data to something that means something to you.:
;*********************************
; START OF CODE FOR PEASE AFB NH 2
;*********************************It's a way to double check that you're working with the correct XML file.
5. Change the location to show the location of the airport/airbase you're working on:
Header( 1 N43:05:43.9500 N43:03:36.0000 W070:48:24.0000 W070:50:15.9900 )
LatRange( N43:03:36.0000 N43:05:43.9500)Bottom line of lattitude; your airport/airbase is COMPLETELY above this line.
Header( 1 N43:05:43.9500 N43:03:36.0000 W070:48:24.0000 W070:50:15.9900 )
LatRange( N43:03:36.0000 N43:05:43.9500)Top line of lattitude; your airport/airbase is COMPLETELY below this line.
Header( 1 N43:05:43.9500 N43:03:36.0000 W070:48:24.0000 W070:50:15.9900 )
LatRange( N43:03:36.0000 N43:05:43.9500)Right line of longitude; your airport/airbase is COMPLETELY to the left of this line.
Header( 1 N43:05:43.9500 N43:03:36.0000 W070:48:24.0000 W070:50:15.9900 )
LatRange( N43:03:36.0000 N43:05:43.9500)Left line of lattitude; your airport/airbase is COMPLETELY to the right of this line.
6. Define the complete path and name of the macro you want to install by changing the above code:
;ILS RUNWAY 16
Macro( F:\SargeCIV3\ilss_v10.api N43:05:15.1560 W070:49:45.9178 20 0.1 160.00 0 0 0 0 10000 0.0 1 v2= 100 0 0 0 0 0 0 )You
must have the full path, and it should be as simple as possible (no
spaces or dashes or underscores in the directory name, and try to keep
the number of sub-directories in the path to a minimum -- it's easier
on the program to locate the macro file and read the data). If your
macro is .scm, then change the .api in the above example to read .scm.
7. Open your airport in AFCAD
and collect the following information -- the lattitude and longitude
where you want the CENTER of the macro to be placed, and the direction
(heading) you want the macro to face. If the macro is supposed to
appear above ground level, write down how many feet ABOVE THE AIRPORT
the macro will appear. (If the airport elevation is 700' do not place
the macro at 735' if you only want it 35' above the airport; FS9 will
add whatever you put in the elevation entry to the airport elevation;
if you put 735' and the airport elevation is 700', FS9 will draw your
macro at 1,435' MSL (relative to mean sea level).
8. Change the lat/lon in the code to show where you want the macro to appear:
;ILS RUNWAY 16
Macro( F:\SargeCIV3\ilss_v10.api N43:05:15.1560 W070:49:45.9178 20 0.1 160.00 0 0 0 0 10000 0.0 1 v2= 100 0 0 0 0 0 0 )You
aren't going to get that particular version of lat/lon from AFCAD.
AFCAD shows coordinates as degrees and minutes (ddd* mm.ssss').
Converting to the format you need is simple -- enter the degrees (ddd
or dd), enter the digits BEFORE the decimal point as the minutes (mm).
Multiply 60 by the decimal value (.ssss) and enter the seconds
(ss.ssss). This defines a precise location for the center of the macro.
(You can also get the coordinates from FS9 by moving to a location,
selecting map mode, and reading the lat/lon on the left side of the map
display. However, FS9 presents the coordinates as dd* mm', which is not
precise enough for macro alignment with other scenery. Use the AFCAD
coordinates and convert them with some simple arithmetic.)
9. Change the direction you want the macro to face:
;ILS RUNWAY 16
Macro( F:\SargeCIV3\ilss_v10.api N43:05:15.1560 W070:49:45.9178 20 0.1 160.00 0 0 0 0 10000 0.0 1 v2= 100 0 0 0 0 0 0 )This
is generally the magnetic heading (adjusted for annual magnetic
variation); however, in some cases when the area the macro needs to
align with isn't quite "squared away", you may be able to use the true
heading (no magnetic variation). You'll have to play with this to see
which one is the right way for your particular scenery.
10. Set the elevation at which you want the macro to appear:
;ILS RUNWAY 16
Macro( F:\SargeCIV3\ilss_v10.api N43:05:15.1560 W070:49:45.9178 20 0.1 160.00 0 0 0 0 10000 0.0 1 v2= 100 0 0 0 0 0 0 )This entry is relative to the airport elevation. If you want the macro to appear at ground level, leave the entry at
0.0; if you want it 20' above the airport, your entry would be
20.0.
11. Save your file
to the same directory in which you have placed the SCASM program. Then
drag-and-drop the file over the SCASM icon; wait a few seconds and you
will see a .bgl file appear in the directory with the same name as the
XML file you created. Copy/move the .bgl file into the scenery
directory for your airport. The next time you start FS9 and go to that
airport, the macro you placed will appear exactly where you specified.
If it doesn't, go back and double-check your coordinates to make sure
you entered them correctly, and reopen the airport in AFCAD to make
sure you copied the essential data correctly. If the .bgl file does not
appear after you drag-and-drop, it means you've left something out of
the code and SCASM doesn't know what to do with it. Make sure you have
not accidentally removed any of the quotation marks or > or < or
other symbols in the above code.
12. Copy the macro textures into the Texture folder for your airport. This is
CRITICAL unless you like white boxes all over your scenery.
13. To place additional 3rd party macros, simply keep repeating the two lines of code
ILS RUNWAY 16
Macro( F:\SargeCIV3\ilss_v10.api N43:05:15.1560 W070:49:45.9178 20 0.1 160.00 0 0 0 0 10000 0.0 1 v2= 100 0 0 0 0 0 0 )(making
the required changes, of course, for each placement) until you have
them all listed and correctly modified for location, heading and
elevation. Then drag-and-drop to compile.
NOTE: There are a couple of other segments of that line of code you may be interested in:
ILS RUNWAY 16
Macro( F:\SargeCIV3\ilss_v10.api N43:05:15.1560 W070:49:45.9178 20 0.1 160.00 0 0 0 0 10000 0.0 1 v2= 100 0 0 0 0 0 0 )Scale
used; you can adjust this up or down (in tenths, unless you already
know the number corresponding to the exact size you want the macro
adjusted to) to present the macro at the size you want it.
ILS RUNWAY 16
Macro( F:\SargeCIV3\ilss_v10.api N43:05:15.1560 W070:49:45.9178 20 0.1 160.00 0 0 0 0 10000 0.0 1 v2= 100 0 0 0 0 0 0 )The
distance from your viewpoint (aircraft) in METERS that FS9 will begin
to draw the object. In this example, FS9 would start drawing the ILS
transmitter when you are flying within 10,000 meters (10 km) of where
the macro is located. This can be a GREAT framerate saver; can you
"see" the ILS transmitter on an airport from 10 km away? No; so why
would you want FS9 to start drawing it that far away and use resources
that it could be using to do something else, like maintain your
framerate? If you are flying TOWARDS the airport, maybe you WOULD want
FS9 to start drawing it 10 km away, so it would be fully displayed when
you did get close enough to see it. But how important is that? What
about all those transmitters at airports you are PASSING BY? If FS9 has
to draw them when you're within 10 km, it doesn't matter if you're
going to that airport or not; FS9 is using resources to draw the macro
even though you're never going to get close enough to see it. Setting
this to 5000 is acceptable; at 5 km, if you aren't going to that
airport, no problem, because you'll be past it soon and FS9 will forget
about maintaining it in the display. If you ARE going to that airport,
it will be displayed by the time you get there.