SCASM 2.88

new FS200x commands 1

  

command index:
 
back to main index
 
VarBase( )
VarBaseOverride( )
Interpolate( )
Transform_Mat( )
TransformEnd
Animate( )
RotateToAircraft( )
I_A9( )


 

CFS - FS2002
VarBase( :Lab )
 

Defines an data area at :Lab It seems this data/variable area is used for comunication with library objects and other data tables. Used in MDL files. There are special values for :Lab

:[-1]  resets varbase to previous parameter block
:[0]  sets varbase to GLOBAL
:[1]  resets varbase to previous local parameter block

TOP 

CFS - FS2002
VarBaseOverride( hexval )
I_9F( )
 

Sets a new var base address for the next variable access only. Used in MDL files. The address is implemented as hex value since in most cases the special values 1, 0, -1, as mentioned in VarBase describtion are used.


TOP 

2.43 | FS2000 - FS2002
Interpolate( base invar outbase outvar tabbase taboffs )
 
base  var_base (:Label32) of a table holding the new variables and the conversion table.
(see VarBase for special values)
invar  FS input variable number (in HEX)
outbase  var_base of output, usually 1
outvar  output variable (HEX). This is in fact the byte offset for a new variable
tabbase  var_base of conversion table usually 1
taboffs  conversion table offset (in var_base)
(decimal or hex wit "0x" prefix)

This command interpolates values from an input variable to an output variable by using an table. The table format is as follows:
 dwd( <count> ) ; number of the following pairs
 dwd( <input> <output> )
 ...

Note: Outbase and tabbase should be Labels but are implemented as hex values. If you really need a Label here use [:Label].
Please see the VarBase command for the special values of the ..base labels. Used in MDL files. The below example is for an simple 1:1 conversion table as often found in MDL files of CFS and FS2000.
    ...
    Jump( :NextCommand )
:Table
    Dbx( 0 0 0 0 0 0 0 0 0 0 0 0 )
    ; 12 (0xC) Bytes space for local output
    ;   variables
    Dwd( 2 )  ; 2 entry pairs in interpolation table
    Dwd( -32768 -32767 ) ; smallest input and
                         ; output value pair
    Dwd(  32768  32767 ) ; largest input and
                         ; output values
:NextCommand
    VarBase( :Table )
    Interpolate( :[-1] 68  1 0  1 C )
    Interpolate( :[-1] 8C  1 4  1 C )
    Interpolate( :[-1] E8  1 6  1 C )
    Interpolate( :[-1] EA  1 8  1 C )
    CallLibObj( 0 47BC6E05 11D2F98A 1000849C 2AE60C5A )
    VarBase( :[-1] )
    ...

TOP 

2.43 | FS2000 - FS2002
Transform_Mat([m]
 xozoyo
 m00m01m02
 m10m11m12
 m20m21m22 )
Transform_Mat( a   xo zo yo   p b h )
 

This instruction transforms the coordinate system for all object instructions until an TransformEnd instruction is found. The effect is similar to the TransformCall() instruction but no subroutine call is used. Also all rotations are defined through an so called transformation matrix. If you use the letter "a" as the optional specifier, SCASM will switch to automatic mode and calculate the matrix for you from the pitch, bank and heading angles.
Positive pich numbers are "nose down" and positive bank numbers are "left side down".
All matrix values are floating point numbers. See also TransformEnd.

m..  matrix values
xo,zo,yo  linear offset values
p, b, h  pitch, bank and heading angles
pitch  positive values are nose down.
bank  positive values are left side down
heading  positive values - turn left ??

Example from an FS2000 MDL file:
    ...
    Transform_Mat( m
        -1  1021  900
         1  0  0
         0  1  0
         0  0  1
    )
    VecPoints( ... )
    Specular( 0 )
    LoadBitmap( 0 1   EF 128 128 128  xyz.bmp )
    ShadedTexPoly( ... )
    ...
    TransformEnd
    ...

2nd example from an FS2000 MDL:
    ...
    Transform_Mat(
       3157  146  1178 ; xzy
       1  0  0
       0  1  0
       0  0  1
    )
    Specular( 0 )
    RGBSColor(  EF 255 255 255 )
    IfVarAnd( :L27F0   D8   10 )
    VarBaseOverride( 0 )
    IfVarAnd( :L27F0  282    2 )
    Light( m 6  0  0  0  40  0.6  0.4
        FF 255 255 255
        1  0  0 )
:L27F0
    TransformEnd
    ...

3rd example:
    ...
    Transform_Mat(
         0  761 -8310 ; xzy
         1  0  0
         0 -0.4342 -0.9008
         0  0.9008 -0.4342
    )
    Specular( 0 )
    RGBSColor(  EF 255 255 255 )
    IfVarAnd( :LDF2   D8   10 )
    VarBaseOverride( 0 )
    IfVarAnd( :LDF2  282    2 )
    Light( m 6  0  0  0  40  0.6  0.4
        FF 255 255 255
        0.2868  0.9436  0.1656 )
:LDF2
    TransformEnd
    ...

TOP 

2.43 | FS2000 - FS2002
TransformEnd
 

This instruction marks the end of the code handled by Transform_Mat(). There must be a TransformEnd for EVERY Transform_Mat() !


TOP 

2.43 | FS2000 - FS2002
Animate( :Lab32 invar t_base t_ofs xlat_x xlat_z xlat_y )
 

This instruction animates object parts by using an key frame table. The end of the animated part(s) must be marked by TransformEnd.
According to the MS scenery SDK there are 2 table formats. The format is indicated by the first word in the table.

The codes are:
ANIM_TRANS for linear shifting (translation)
ANIM_QUAT for rotation

:Lab32  input base address (see VarBase)
invar  input variable (hex)
t_base  var_base_32 of table (hex value)
t_offs  variable offset to add to var base (hex)
xlat.  translation values in floating point format. Often found 0.0

The format of the animation table is described in the FS2000 scenery SDK and it will show in SCASM syntax like:
:Tab_base
    Dwd( 1 )       ; format indicator, 1 or 3
    Dr4( -1 )      ; previous frame number
    Dr4( 0 0 0 0 ) ; storage for FS internal
    Dr4( 0 0 0 0 ) ;   matrix data
    Dr4( 0 0 0 0 )
    Dr4( 0 0 0 0 )
    Dwd(  )  ; number of following rows
    ;
    ; the above 72 bytes header is the same
    ; for both formats

If the format indicator is 1 = ANIM_TRANS every row is:
    Dr4( <nKey> ) ; key frame number (0, 1, 2 ..)
    Dr4( <x> <z> <y> )  ; linear offset values

If the format indicator is 3 = ANIM_QUAT every row is:
    Dr4( <nKey> ) ; key frame number (0, 1, 2 ..)
    Dr4( <f1> <f2> <f3> <f4> ) ; ?

Regardsless of the actual number of rows it seems that the last keyframe number (row) is always 200.
Unfortunately I don't have more specific information in this moment.
    ...
:LF836
    VarBase( :Tab_base )
    Animate( :[-1]  D4  1  0    1  -287.4  -1 )
    VarBase( :[-1] )
    ...

TOP 

CFS - FS2000
RotateToAircraft( :Lab   dx dz dy   fx fy fz   vx vy vz )
I_A7()
 

This is a new sort RotatedCall. Can be used to automatically rotate something towards the users aircraft.

:Lab  Label of the called subroutine
dx  offset in x direction
dz  elevation offset
dy  offset in y direction
fx  if this flag is 1, the x axis is rotated towards the players aircraft.
fy  if this flag is 1, the y axis is rotated towards the players aircraft.
fz  if this flag is 1, the z axis is rotated towards the players aircraft.
vx  variable containing x rotation angle, normally 0
vy  variable containing y rotation angle, normally 0
vz  variable containing z rotation angle, normally 0

TOP 

CFS - FS2000
I_A9( :Lab xofs zofs yofs xwid hig ywid p b h )
 

This is another sort of position detection similar to the common Monitor3D() and MonitorTr() commands. The jump to :Lab is performed if plane is not in the box.
Note: I found this instruction only in CFS1 object libraries. During my tests in FS2000 I could not get it to work within rotated subroutines.

xofs  the middle of the box is shifted in E-W direction
zofs -"- up down direction
yofs -"- N-S direction
xwid total width in E-W direction
hig total hight
ywid total width in N-S direction
pitch angle
bank angle
heading angle


 
    
TOP © Manfred Moldenhauer