SCASM 2.88

new FS200x commands 2

  

command index:
 
back to main index
 
BGLVersion( )
EndVersion
RGBSColor( )
RGBLColor( )
LoadBitmap( )
TextureSize( )
ZBias( )
MaterialList( )
TextureList( )
SetMaterial( )
VertexList( )
DrawTriList( )
DrawLineList( )
IfInF( )
Light( )


 

2.75 | FS2002
BGLVersion( code )
 

Sets the version of BGL code. All instructions between this command and EndVersion are asumed to be designed for a specific version. Often found at the beginning of subroutines in CFS2/FS2002 Library objects. Needs an EndVersion command just before the Return in the same subroutine.
I don't know what this instruction is used for. All my test objects work without it, but I found it in all FS2002 library objects.

Codes are:
0732  CFS2
0800  FS2002

TOP 

2.75 | FS2002
EndVersion
 

End command for BGLVersion.


TOP 

CFS1/FS2000 - FS2002
RGBSColor( a r g b )
 

Set RGB surface color.
Surface colors are daytime sensitive, that is their brightnes depends on the suns position.

red value, 0...255
green value, 0...255
blue value, 0...255
color attributes, flags (one hex byte) I found the following values in the original BGL's:
Ex  with x (0 to F) giving different values of opacity. (zero opacity is complete transparent)
EF  solid RGB color (full opaque)
E0  transparent RGB color
Bx  ? (B0...BF)
0F  ?
F0  the old FS5 color palette code in R-chanel is selected (G=0 and B=0)

TOP 

CFS1/FS2000 - FS2002
RGBLColor( a r g b )
 

Set RGB line color, for parameters see RGBSColor().


TOP 

CFS1/FS2000 - FS2002
LoadBitmap( x type a r g b   name_of_a_BMP_file )
 

Loads a bitmap in uncompressed BMP format. These bitmaps usually have formats:
256x256, 128x128, 64x64, 32x32 and uses a 256 color palette.
If the bitmap is smaller than 256x256 it seem to be expanded. You have to take this into account when dealing with bitmap coordinates.
Do not use the old BitmapMode() instruction with this command.

unknown, always set it to 0
argb  color code, used if texture not found or disabled. see RGBSColor()
name  Filename of the .BMP file. Long filenames allowed. Use quotation marks if containing spaces.
type  type/classification and flag bits for this texture. This classification is used in the Option/Setup menus (does not work in FS2K) -> textured ground ON/OFF selection.
none
aircraft
map
water
sky
ground
building
effect (FS2002)
damage (FS2002)

Optional flag bits (FS2K). These flag bits enables the search and conditional load of replacement bitmaps with the following name template:
<name>_LM.BMP (night) light map
<name>_WI.BMP winter bitmap
<name>_HW.BMP hard winter bitmap
<name>_FA.BMP fall/autum bitmap
<name>_SP.BMP spring bitmap

If needed use these flags as a prefix to the type number without spaces. Example: L6 for a building with aditional night bitmap or WSF5 for a ground texture with aditional seasonal replacements. It seems that not all flags work with all texture types.


TOP 

2.75 | FS2002
TextureSize( size )
 
size  texture size in meters. (float)

TOP 

2.43 | FS2000 - FS2002
ZBias( z_bias )
 

This command will add a bias to an objects distance. This instruction is often found in MDL files.

z_bias  z bias value (integer). Typical values 0, 7

    ...
    ZBias( 1 )
    VecPoints( ... )
    ZBias( 0 )
    Specular( 0 )
    LoadBitmap( 0 1   EF  43 255   0  decal.bmp )
    ShadedTexPoly( ... )
    ...

TOP 

2.75 | FS2002
MaterialList( 0 <material_0> ... <material_n> )
 

This is a new instruction for defining colors.
Every value must be in the range 0.0 to 1.0. According to FS2002 SDK the values for ambient_a, specular_a and emissive_a are currently not used and must be set to 1.0.

Every material entry consists of the following values:
diffuse_r 
diffuse_g
diffuse_b
diffuse_a
Diffuse color
ambient_r 
ambient_g
ambient_b
Ambient color
ambient_a  must be 1.0
specular_r 
specular_g
specular_b
Specular color
specular_a  must be 1.0
emissive_r 
emissive_g
emissive_b
Emissive color
emissive_a  must be 1.0
power  Specular power, always (?) found 0.0.

TOP 

2.75 | FS2002
TextureList( 0 <texture_0> ... <texture_n> )
 

Every texture entry consists of the following:

class  texture class as in LoadBitmap
ARGB  fallback color
It seems that this parameter is not used by FS2002. I always found it as FF 255 255 255. It seems FS preferes the colors defined in SetMaterial.
reserved value
size  texture size in meters
"name"  texture name, maximal 63 characters

TOP 

2.75 | FS2002
SetMaterial( material_index   texture_index )
 

This instruction selects the material (color) and the texture to use for the next triangle(s) to draw. Indices are starting with 0 and must be defined with the MaterialList and TextureList instructions If no texture is used set the index to -1.


TOP 

2.75 | FS2002
VertexList( 0 <vertex_0> ... <vertex_n> )
 

This command replaces the old Point command. All values are floating points.

reserved parameter, must be 0

Every vertex consists of the following values:
x, z, y,  vertex coordinates
values are in meters but there is often an aditional scaling done in the Transform_Mat() command. The factor is 1 / 1024.
nx, nz, ny  components of a so called normal vector
The alternate input format is: p <elevation angle> <heading angle>
This vector is used for color shading.
tu, tv  This are the texture coordinates asociated with this vertex.
0.0 - 0.0 is texture bottom left
1.0 - 1.0 is texture top right.

TOP 

2.75 | FS2002
DrawTriList( start   v01 v02 v03 ... vn1 vn2 vn3 )
 

Draws triangles with vertices of the vertex list using vertex indexes (start + vn).

Important note: This new instruction does not include data for a normal vector. So there is no way for SCASM to tell FS from which side we want the triangle to be seen. FS calculates this vector by himself. For this reason it is very important to enter the points (vertices) in anti clockwise order when looking on the visible triangle side. Reversing the order will also reverse the visibility direction.

start  index of the first point/vertex from VertexList used in this instruction. All vertex numbers are relative to this one. That means the real vertex number is (start + n).
In SCASM version 2.83 you can use the letter "q" to cause SCASM to optimise all indices (I avoided the letter "o" which can be confused with the number "0". Maybe this will produce quicker BGL code.
vn1,
vn2,
vn3
vertex indices for one triangle

TOP 

2.75 | FS2002
DrawLineList( start   v01 v02 ... vn1 vn2 )
 

Draws lines with vertices of the vertex list using vertex indexes (start + vn).


TOP 

2.43 | FS2000 - FS2002
IfInF( :Lab32   var   f_low   f_high )
 

This is a new IfVarRange instruction using floating point numbers and 32 bit labels.
(if in range - floating point version)

:Lab32  Address to continue if not in range
var  variable number to test (hex)
Note: In the moment the size and format of this variable is unknown.
f_low  low value in floating point format
f_high  high value in floating point format

TOP 

2.43 | FS2000 - FS2002
Light( vattr type ox oz oy
intens liat sqat   a r g b
direction
)
 

The FS2000 version of landing lights. Older FS versions uses the LandingLights( ) command
Note: From user reports it seems that FS2000 ignores the offset values and the light direction vector. So the only to move and rotate the light beam is to use the Transform_Mat() instuction.
Note2: Some of the above parameters are not longer mentioned in the latest SDK. They are labled as reserved or "currently not used" and should now be set to 0.

vattr  vector attributes the only allowed values are:
this tells SCASM that the vector data are in component form (x z y)
this tells SCASM that the vector data are in polar coordinates and needs to be converted to FS format.
type  type of light
beacon
?
?
taxi light
nav light
landing light
strobe
project landing light on ground only (FS8)
10 proj. taxilight on ground only
11 draw landing light cone only
12 draw taxi light cone only
ox
oz
oy
offset values, usually 0.0
intens  intensity, typical values are 20, 40
(currently not used by FS)
liat  linear attenuation factor (normaly 0.6)
(currently not used by FS)
sqat  squared attenuation factor (normaly 0.4)
(currently not used by FS)
argb  color
typical values:
FF 255 255 255
F5 255 255 255
FF 255 000 000
00 255 255 000
direction  Light direction vector. (currently not used by FS)
FS uses vector data in normalised component form giving a vector with the length of 1. For this reason non of the 3 vector components can be larger than 1.
If vattr = m the direction vector is expected in x-z-y component form (-0.1715 0.1585 -0.9724).
For humans it is easier to express the direction vector in polar coordinates which is elevation angle (positive = up) and heading angle. This data is expected if the p flag is set.


 
    
TOP © 1995-2002 Manfred Moldenhauer