SCASM 2.88

command line interface

  

command index:
 
back to main index
 
command line
command line switches
SCASM error codes
Conventions, names, etc.


SCASM was created as a low level tool for generating FS5 BGL-files. I call it an assembler because it generates one BGL instruction for each command. SCASM has some limitations. One of this limitations is that he can handle only one latitude band per source file. To solve this problem I created SCLINK, an BGL file linker.

SCASM 2.xx is a Win32 console application. That means that it will look like a DOS program to you but will have all advantages of 32 bit programms including the ability of handling long filenames.

SCASM itself does not need an special install procedure. Simply copy it into a working directory of any name you want. If SCASM is used through front ends like Airport, ASD, VOD, DOD, or SCC please follow the instructions which come with those programms.

Start the scenery assembler with following command line:
 
scasm input_file.sca output_file.bgl [<optional switches>]

In case of errors the return code (error code) is non zero. The return code is used to indicate error conditions to batch files or to front ends.

For the input file any extension is accepted, but it must be a pure ASCII file. I suggest the .SCA extensions for stand alone sourcees and .SCM for macro files. You must enter the .BGL extension for the output file.

If the second filename is omitted, SCASM takes the first one and and changes the file extension to .BGL.

TOP 

Command line switches (optional):
If possible you should better place a Set() command into the source code.
 
-l  causes SCASM to generate a file named SCAERROR.LOG, which contains the error messages, if any, but not the normal statistic lines.
-i  I am not proud of this switch! It causes SCASM to suppress all the "integer number expected" errors to maintain compatibility with older versions. However, I strongly recommend not to use this switch in general, since the result may differ from what you expect and can cause other problems.
BTW, the number format is normaly checked when FS5 requires an integer number. SCASM has no problems with floating point numbers!
-f  This switch disables the number format casting option (this is if a decimal number is expected you can enter a hex number in the form 0x0A). This switch is only needed to avoid problems with leading "0"s AND lower case letters for hex numbers. In case of problems you can also use the "int[..]" function which is available in SCASM 2.02 and later.
-m  This switch enables the generation of a map file (.MPF). This file contains some aditional information for the BGLTST program wich is an analyser for BGL files. This program can help to find some problems in the logical structure of BGL instructions.
-LB ##  Set the line buffer size (default is abt. 20000 /v.2.15)
In very long point definition lists it can happen that you get a "line buffer overflow" error during compile time. You can set a larger buffer size by using this command line switch. -LB 48000 sets the buffer to 48000 bytes.
-RAW  supresses the header initialisation
Area( r )
Needed for raw BGL output.

You can also set these switches in an environment variable. Just add the line:
SET SCASM=-i -f
to your AUTOEXEC.BAT or type this line from the DOS prompt. This even works in Win95/98 environment.
Use these options only if you really have compatibility problems.

TOP 

SCASM result codes:
 
OK, no errors
syntax error(s) in source file
file init error (disk space, file names, access permissions, etc.)
aborted due to too many syntax errors
others  different buffers not available, should never happen!

TOP 

Conventions, names, etc.
 
Lat  Geographic Latitude. Positive values are North, negative values are South.
Lon  Longitude. Positive values are east, negative values are west.
The values of Lat/Lon are assumed to be
degrees(0..180):minutes:seconds.decimal_seconds
Letters N/S, E/W, +/- are accepted.
Example for valid inputs:
     53:30:30.00
     53:30:30
    N53:30.5
    +53.50833
distance in east - west direction (integer)
distance in north - south direction (integer)
altitude, elevation (integer)
:Label  Name for a jump destination (up to 15 chars.). You cannot exit an Area() block with any jump, so :Labels are only valid within a block. You must enter the ':' character but the name can be omitted. In this case the jump is directed to the end of the block (->EndA). A :Label as a definition of a jump destination should be entered in a single line and should start in the first column. Label names are case sensitive.
The number of Labels per block is limited to 1500.
The number of label references is limited to 2000.
The length of a label name is limited to 30 characters.
$varname  (version 1.7 or later)
User defined variables (not FS5 variables) to store some parameter calculation results for later use or for passing some frequently used values to macros. The name of a variable must start with the "$" character, but do not use other special characters in the name to avoid confusion of the expression evaluator.
vx  X component of an vector.
vy  Y component of an vector.
vz  Z component of an vector.
A vector consists of these 3 components. The geometrical (3D) sum of these three components is normalized to 32767 (highest positive integer value). Vectors are used to define a direction in the 3D world i.e. to indicate from which side a surface of an object can be seen.
len  This is a length or distance in RefPoint units. If the scale factor of the reference point is one, RefPoint units are given in meters. When used with vectors this factor can be seen as the vector length. You can handle 'len' as a floating point value.
vattr  Vector Attributes for automatic vector calculation. In FS5 vectors are used to indicate directions in the 3D world.
In many cases it is possible for the programm to calculate these vectors. The 'vattr' parameter is used to control these calculation.
It is assumed that the RefPoint is in the middle of the object you want to construct, so the programm can get an idea of the vector direction. If you want to design a house and the RefPoint is outside or at one corner you cannot use any automatic calculation.
 
manual, you have to calculate the vector components by yourself (default).
automatic. All components (vx, vz, vy and len, if needed) are calculated by the programm.
vector has only a z component. (points straight up in the air). No vector calculation is done but its length is calculated.
xy  only the x-y component is calculated. Z is always 0.
xz  only x-z component
yz  only y-z component
These 3 vattr are usefull for VectorPoints() in regular shaped (cylinric) objects.
au  automatic, but the vector is always pointing up. That means if the z-component is negative, the vector is reversed.
This feature is usefull for ground polygons where there the perpendicular distance from the reference point to the plane is zero. In this cases the vector direction depends from the order the points are entered in the polygon definition and cannot be corrected automatically.
ad  automatic, but the vector is always pointing down. If the z-component is positive, the vector is reversed.
ai  usefull for drawing the inner walls of hangars. The vector will always be reversed.
using polar coordinates format for the following vector. (angle of elevation, heading, [length]). The programm converts this into BGL vector format.
enables Texture Point calculation automatic for any ..TexPoly's. SCASM tries to use the whole texture map, but the aspect ratio is maintained. Only valid with ..TexPoly's
The same as above, but texture aspect ratio is not maintained. This may result in a different scaling for the bitmap in x- and y- direction. Only valid with ..TexPoly's
This flag reverses the bitmap in y direction (up/down).
Only valid with ..TexPoly's

( )  If a command requires parameters they MUST be entered in parentheses. There MUST be at least one space between the parenthesis and the first/last parameter.
{ }  The current version of SCASM cannot handle nested brackets. Since some users wants to include them into the name strings of navaids or in ATIS messages converts the curly brackets {} to normal brackets ().
[ ]  In the command describtion:
If you find parameter names within these brackets in an command description the parameter is optional and can be omitted.
[ ]  In the SCASM source text:
these brackets triggers the expression evaluator. This enables you to do some simple calculations with the parameters.
Note: this does not work with any frequency parameter.
Indicates the following text is a comment. Be very carefull when using this within parameter brackets because the whole rest of the line is skiped.
Underscores are converted to spaces only in name strings of navaids and in ATIS messages.
This character represents a number in some parameter names. E.g. OBI# can be replaced by OBI1 or OBI2.
hex  Some parameters are required as a hex value. Since SCASM expects this format you need not to enter any additional caracters to indicate this. So simply enter C1, not C1h.
To avoid the risk of confusing the new expression evaluator you should use only upper case letters for hex numbers.
If you are not familar with hex arithmetics you can use the calculator in MS-Windows. You only need to change it from standard to scientific in the calculator menu.
Special character for generating unambiguous labels in macros.
A-Z  Capital characters are used in this document only for best overview. The scenery assembler itself is NOT case sensitive except in label names and function names.


    
TOP © Manfred Moldenhauer