Wall and Fence API macros for Airport 2.xx and Microsoft Flight Simulator
-------------------------------------------------------------------------

This is a set of eight API macros that will allow you to add 3D walls and
fences of any size to your FS scenery. Walls and fences are usually found at
the boundaries of many airports and military bases, and adding them to your
scenery will give it a much better and realistic look.

The wall macros require the BRICK*.R8 textures. If you don't have them
already, don't worry, since they are included in this package.

These macros can be used to generate scenery for FS 5.x and later. I have not
tested them with FS 2000, but the generated scenery should work without any
problem.


Overview:
---------

I made these macros because I was just needing to add walls to some airport I
was designing. My first choice was to do it with VOD, but later I edited the
VOD generated SCASM code, to make the macro more flexible and adjustable.
Then I realized that fences could be done the same way, with only a little
difference in the SCASM code to allow transparency.

The eight included macros are:

FENCE01.API - Adjustable fence with plain wires
FENCE02.API - Adjustable fence with spiked wires
FENCE03.API - Adjustable fence with rhomboidal wires
WALL01.API - Adjustable wall with Light Gray bricks
WALL02.API - Adjustable wall with Dark Brown bricks
WALL03.API - Adjustable wall with Light Brown bricks
WALL04.API - Adjustable wall with Light Red bricks
WALL05.API - Adjustable wall with Dark Red bricks

Actually, they are all based on the same macro, but each one using a
different texture bitmap, and a transparent color for the fences.

You can adjust the length and height of your walls and fences, and also the
base altitude, only if necessary (normally you will not change this value,
since most walls and fences are usually at ground level, unless you want to
place a wall or a fence on the top of a building or a mountain). If you call
these macros from within Airport, these are the parameters you will usually
change:

Parameter 1 = Length
Parameter 2 = Height
Parameter 3 = Altitude (normally 0)
Parameter 4 = Not used

Remember that the point where you insert a wall or a fence will be actually
the center of it.

Also, remember that when you indicate a specific Heading, you are actually
entering the wall's face orientation, and not the wall's side alignment!
So, after you calculated your wall's direction, before entering the heading
just add 90 degrees.

You may choose to use the Microsoft Excel sheet included in this package, so
everything will be automatically calculated for you.

The walls and fences are crash-enabled, so be careful when you fly or taxi
your aircraft near them.... If you crash with them, you will get a "Building
Crash". Sorry, there is no "Wall Crash" or "Fence Crash" among the FS crash
codes....


Contents:
---------

The following files are included in this package:

API Macros:

FENCE01.API (Normal fence)
FENCE02.API (Spiked fence)
FENCE03.API (Rhomboidal fence)
WALL01.API (Light gray wall)
WALL02.API (Dark brown wall)
WALL03.API (Light brown wall)
WALL04.API (Light red wall)
WALL05.API (Dark red wall)

API Bitmaps:

FENCE01.BMP (Normal fence)
FENCE02.BMP (Spiked fence)
FENCE03.BMP (Rhomboidal fence)
WALL01.BMP (Light gray wall)
WALL02.BMP (Dark brown wall)
WALL03.BMP (Light brown wall)
WALL04.BMP (Light red wall)
WALL05.BMP (Dark red wall)

Textures (Only the FENCE*.R8 textures are made by me):

BRICK0.R8 (Light gray bricks)
BRICK1.R8 (Dark brown bricks)
BRICK2.R8 (Light brown bricks)
BRICK3.R8 (Light red bricks)
BRICK4.R8 (Dark red bricks)
FENCE0.R8 (Normal fence)
FENCE1.R8 (Spiked fence)
FENCE2.R8 (Rhomboidal fence)

Other files:

FILE_ID.DIZ (Id file)
README.TXT (You are reading it)
WALLS.XLS (Excel sheet for calculations)
EXAMPLE.JPG (Image of an airport with walls at the boundaries)


Installation:
-------------

- Copy all the *.R8 files to your main Flight Simulator \TEXTURE folder

For Airport 2.xx:

- Copy all the *.API files to your Airport \API folder
- Copy all the *.BMP files to your Airport \RESOURCE folder

For VOD 2.7:

- Copy all the *.API files to your VOD \API folder
- Copy all the *.BMP files to your VOD \APIBMP folder


Tips for scenery designers:
---------------------------

Using these macros with Airport is very easy. To place a wall or a fence at
some specific place in your scenery, just follow these steps:

1. Try to use the normal scale of 1 cm / 1000 meters, since this way thigs
will be very easy for you. A Grid every 1000 meters will be also handy,
so you can choose to activate it.

2. Determine the two extremes of the wall or fence. Airport will show you the
relative coordinates (x1,y1) - (x2,y2) when you place the mouse at both
points, so you can take note of these values.

3. Calculate the distance between these two points. You can use the formula:

Distance = sqrt( (x1 - x2)^2 + (y1 - y2)^2 )

4. Calculate the center of the wall or fence (x,y). This can be done this way:

x = (x1 + x2) /2
y = (y1 + y2) /2

5. Calculate the heading of the wall or fence. You can use these formulas:

If your wall or fence is crossing the NW / SE zone:
Heading = 360 - atan( (y2 - y1) / (x2 - x1) ) * 180 / Pi

If your wall or fence is crossing the NE / SW zone:
Heading = - atan( (y2 - y1) / (x2 - x1) ) * 180 / Pi

I have included an Excel sheet that will do all of this for you. If you use
it, please, don't change the yellow cells, since the formulas are there. Only
enter the coordinates of the two extremes of the wall or fence in the white
cells, and Excel will do the rest. This sheet will give you the length, the
center point and the heading, so you can place the wall or fence in the right
position, and also enter the corresponding parameters in the Airport dialog.
The height of the wall or fence can be whatever you need for your scenery.
(For example, 3 meters).


Disclaimer and legal stuff:
---------------------------

I provide these files for your free use, and will not be held responsible for
any damage caused to your software or hardware, as a result of the misuse of
these files. Use them at your own risk.

You may not sell this package nor include it in any commercial CD or any other
publication without my permission.

You can copy and distribute this software freely. Indeed, you are encouraged
to do that, and also to share with the FS community all the scenery you have
developed using this package. The only thing you can't do is trying to make
money with it.


Credits:
--------

Airport - Pascal Meziat
SCASM - Manfred Moldenhauer
VOD - Rafael Sanchez


Contact:
--------

If you want to send me any comment or suggestion, just write to:

Jorge Merino
jmerino@terra.com.pe

(C) 2000 - Jorge Merino