SCASM 2.88

Jumps, conditional Jumps and Calls

  
command index:
 
back to main index
 
Jump( )
Jump32( )
IfVarRange( )
IfVarRange2( )
IfVarRange3( )
IfVarAnd( )
IfHSize( ) / IfHRes( )
IfVSize( ) / IfVRes( )
IfVis( ) / MonitorPt( )
AreaSense( ) / SenseBorder( )
IfPlaneInBox( ) / Monitor3D( )
MonitorTr( )
SeparationPlane( ) / VectorJump( )
Call( ) / Call32( )
Return
PerspectiveCall( ) / AddObj( )
Perspective
PerspectiveCall32( )
PerspectiveCall2( ) / AddMountain( )
LayerCall( )
ShadowCall( )
RotatedCall( )
PBHCall( )
TransformCall( )
LandingLights( ) / LightBeamCall( )
CallAsm( )
CallAsm32( )

 

FS5 - FS2002
Jump( :Label )
 

Execution is continued at :Label
The jumptable is deleted everytime a new Area() is started, so you can use the same name in different areas. This also means you cannot jump out af an Area() - EndA block.
Jump distance is limited to 32767 bytes.


TOP 

FS98 - FS2002
Jump32( :Label )
 

Jump with a 32 bit address displacement. Practically no limit of jump distance


TOP 

FS5 - FS2002
IfVarRange( :Label   Var minval maxval )
 

The contents of the FS variable Var is tested. If the value is within the range of minval and maxval the execution is continued with the next command. Otherwise execution is continued at :Label.

Var  FS5 variable number in HEX.

TOP 

FS5 - FS2002
IfVarRange2( :Label Var1 MinVal1 MaxVal1
Var2 MinVal2 MaxVal2 )
 

Similar to IfVarRange(), conditions ANDed


TOP 

FS5 - FS5.1
IfVarRange3( :Label Var1 MinVal1 MaxVal1
Var2 MinVal2 MaxVal2
Var3 MinVal3 MaxVal3 )
 

Similar to IfVarRange(), conditions ANDed


TOP 

FS5 - FS2002
IfVarAnd( :Label Var Mask )
 

The contents of the FS5 variable Var is AND_ed with the value of Mask. If the result of this operation is TRUE execution is continued with the next command. Otherwise execution is continued at :Label.

Var FS5 variable number in HEX
Mask Bitmask, any 16 bit HEX value

TOP 

FS5 - FS2002
IfHSize( :Label r p )
IfHRes( :Label r p )
 

The horizontal size is tested. If the object size given by r does not cover p pixels on the screen a jump to :Label is performed and the object is not drawn. But you can force FS to draw it just by increasing your zoom factor during flight.
The effect is like using binoculars.

object radius, integer
pixels, integer

TOP 

FS5 - FS2002
IfVSize( :Label r p )
IfVRes( :Label r p )
 

The vertical size is tested.

object radius, integer
pixels, integer

TOP 

FS5 - FS2002
IfVis( :Label ptnum0 ... ptnumX )
MonitorPt( :Label ptnum0 ... ptnumX )
 

This command tests whether one of the points in the list is visible or not. If none of the points is visible a jump to :Label is performed. This command is usually used with 4 or 8 points describing an flat or 3-dimensional area. The points have to be defined with the Points() command before.


TOP 

FS5 - FS2002
AreaSense( :Label ptx0 pty0 ... ptxn ptyn )
SenseBorder( :Label ptx0 pty0 ... ptxn ptyn )
 

The following instruction block is executed if we are within the polygon defined by the list of point coordinates. Oterwise execution is continued at :Label. Concave polygones are not allowed and the points should be entered in a clockwise order !


TOP 

FS5 - FS2002
IfPlaneInBox( :Label xmin xmax zmin zmax ymin ymax )
Monitor3D( :Label xmin xmax zmin zmax ymin ymax )
 

The 3D area is monitored. If the aircraft is NOT in the specified area a jump to :Label is performed. All values are in meters. This command cannot be roteted (RotatedCall) or transformed (TransformCall) in FS5.x and FS2000


TOP 

FS5 - FS2000 ?
MonitorTr(:label
 dx
wx
xdeg
dz
wz
ydeg
dy
wy
zdeg )
 

This is the transformed 3D monitoring instruction. The monitored 3D area is shifted (from the RefPoint position) and rotated. A jump to :Label is performed if the aircraft is outside.

dx  x offset from the reference point (int)
dz  z offset from the reference point (int)
dy  y offset from the reference point (int)
wx total x width of the area (int)
wz total z height of the area (int)
wy total y width of the area (int)
xdeg x rotating angle
ydeg y rotating angle
zdeg z rotating angle

TOP 

FS5 - FS2002
SeparationPlane( ... )
VectorJump( :Label m   vx vz vy len )
VectorJump( :Label a   pnum1 pnum2 pnum3 ... )
VectorJump( :Label p   elev_angle   heading   len )
 

The elements vx, vz and vy are representing a vector standing rectangular on a virtual plane (surface). Len is a distance in RefPoint-units. The following commands are executed if the distance from the viewer (aircraft) to the virtual plane measured in the vectors direction is greater than dist. Otherwise execution is continued at :Label (Jump to :Label).
In some cases the plane is identical with one of the surfaces of an object you have just constructed. If so you can use the auto-vector feature to calculate the vector and the distance.
You have to enter only 3 point numbers of the object surface (polygon). If there are more, the others will be ignored.
This instruction has the same function as the GLUE Template in the FSFS aircraft factory for FS5.1.


TOP 

FS5 - FS2002
Call( :Label )
Call32( :Label )
 

Calls a subroutine at :Label. After the Return from the subroutine execution continues with the next command.


TOP 

FS5 - FS2002
Return
 

Returns the control to the next instruction after the ..Call() command. (Return from subroutine). Every subroutine MUST end with a Return command. All parts entered with a ..Call.. command should be considered as a subroutine. Most FS5 'database error' mesages are caused by forgoten Returns or misplaced Jump instructions.


TOP 

FS5 - FS2002
PerspectiveCall( :Label )
AddObj( :Label )
 

Use this instruction for drawing 3 dimensional objects. There is no need to draw flat ground polygons with this instruction.

Typical sequence:
Area( ... )
    PerspectiveCall( :House )
    Jump( : )

:House
    Perspective
    RefPoint( :H_end ... )
    SurfaceColor(...)
    Poly( ... )
    ...
:H_end
    Return

...
EndA

TOP 

FS5 - FS2002
Perspective
 

This should be the first command in a subroutine called with PerspectiveCall(). If you forget this command you will see nothing or even crash!
FS2002 SDK ays this command should not longer be used, but I still found it in the default scenery when calling library objects.


TOP 

FS95 - FS2002
PerspectiveCall32( :Label )
 

The 32 bit Version of PerspectiveCall()


TOP 

FS5 - FS98 ?
PerspectiveCall2( :Label )
AddMountain( :Label )
 

Another version of PerspectiveCall. Objects drawn with this command are added to the scenery before normal 3D objects are drawn.


TOP 

FS5 - FS2002
LayerCall( :Label layer )
 

Ground surface polygons drawn within a LayerCall'ed subroutine are sorted according to their layer number before they are drawn into the scenery. The sorting is done with all currently visible scenery elements, even if they are in different BGL files.

It is reported that only layer numbers 4, 8, 12, 16 ... are working in FS2000. See "The Categories System" and BGL_ADDCAT in the Microsoft® FS2000 scenery SDK for more information.

layer  number (1 to 63 decimal) of a priority layer (category layer in FS98SDK) for a flat surface polygon to cover the ground. Polygons with higher number are always drawn on top of the others.
Use the following layer / category numbers:
Mesh, seed, ground
ground polygon/texture overlays
12 river
16 road
20 lines, strobes
24 runways, taxiways
28 mountain
32 crater
60 shadows


TOP 

FS5 - FS2002
ShadowCall( :Label )
 

The shadow of the static object at :Label is drawn. Do not direct a ShadowCall to a Perspective command, use the next command instead. Otherwise scenery hangups can happen (in FS5).


TOP 

FS5 - FS2002
ShadowCallVI( :Label var )
 

SHADOWVINSTANCECALL in FS98SDK
This command is used to draw a shadow of variable objects. The position is specified in an array of variables. Used for dynamic objects.


TOP 

FS5 - FS2002
RotatedCall( :Label pitch bank heading )
 

The subroutine at :Label is called with rotated coordinates. The pivot point is the active RefPoint().

pitch  Pitch angle. Positive values are nose down.
bank  Bank angle
heading  Heading angle

TOP 

FS5 - FS2002
PBHCall( :Label var )
 

VINSTANCE_CALL in FS98SDK
This command is used to rotate an object around all 3 axis (pitch bank heading). Var points to an array of 3 variables holding the values for pitch bank and heading. This command is often used for programming dynamic library objects.


TOP 

FS5 - FS2002
TransformCall( :Label   delta_x   delta_z   delta_y
x_deg   xvar
y_deg   yvar
z_deg   zvar )
 

This is an expansion of the RotatedCall(). A subroutine is called with transformed coordinates. That means you can assume the new temporary reference point is at the given delta_# distances from the original point. Also the coordinate system is rotated around this point according the #_deg values.
Note: Shadows produced from the transformed scenery element will also be moved. This can cause funny flying shadows.

:Label  Address of the subroutine which is called with a transformed coordinate system.
delta_#  linear displacement of the object (integer)
#_deg  rotation in degrees (e.g. -22.5)
#_var  variable (hex), 0 if not used !

TOP 

2.01 | FS5 - FS98
LandingLights( :Label varptr vx vz vy )
LightBeamCall( :Label varptr vx vz vy )
 

This instruction is used to generate the aircrafts landing lights in FS versions 5.0 to 98. For FS2000 and later see the Light() command

varptr  Points to a set of local variables which holds the position data of this object.
vx
vz
vy
the vector components of the light beam

TOP 

FS5 - FS5.1
CallAsm( :Label seg )
 

Calls an 8086 assembly language programm at :Label
I have no information about the seg (hex) parameter. Set it to 1. The assembly language instructions can only be entered using the Dbx(...) binary instructions family.
Ignored by FS6.0/FS95 and later to avoid conflicts with the new 32 bit environment.


TOP 

FS95 - FS2000
AsmCall32( :Label )
 

This is the 32 bit version of CallAsm(). Found in MDL files.
The FS2000 scenery SDK says this command is reserved and should not be used.


 

    
TOP © Manfred Moldenhauer