SCASM 2.88

crash detection

  

command index:
 
back to main index
 
Crash( )
CrashIndirect( )
CrashStart( )
CrashSphere( )
CrashBox( )
SetCrashCode( )
CrashOctTree( )

New commands for crash detection. Used by CFS1/FS2000 and later versions.

2.49 | CFS/FS2000 - FS2002
Crash( :Lab1 rad :Lab2 :Lab3 dens )
 

Test for crash detection.
This command should be used before using the PerspectiveCall command.
Do not use it in library objects.

:Lab1  Points to the end of the following crash code.
rad  the objects ground radius
:Lab2  Points to the RefPoint() instruction used with this object. This must be a normal refpoint with an scale factor.
:Lab3  Points to the RotatedCall() used with this object. Set it to :[0] if not used.
dens  scenery density code (min) for this object

TOP 

2.43 | CFS/FS2000 - FS2002
CrashIndirect( :Lab1 :Lab2 :Lab3 fl dens )
I_95(...)
 

Test for crash detection. Usually used for BGL library objects in normal scenery BGL's. This command should not be used in library objects. The called library object must do the crash detection. See CrashStart.

:Lab1  Points to the object call (mandatory). This is usually a CallLibObj instruction
:Lab2  Points to the RefPoint instruction used with this object. This must be a normal refpoint with an scale factor.
:Lab3  Points to the RotatedCall used with this object. Set it to :[0] if not used.
fl  Flags, purpose unknown, maybe reserved for internal use. Set it to 0.
dens  scenery density code (min) for this object

Example:
Area( A   51:30  -00:11 100 )
    IfVarRange( :  346 2 32767 )
    CrashIndirect( :Obj :RefP :Rotate 0 2 )
    ShadowCall( :RefP )
    PerspectiveCall( :Start )
    Jump( : )
    ;
:Start
    Perspective
:RefP
    RefPoint( rel :EndP 0.5  51:30  -00:11 V2= 260 )
:Rotate
    RotatedCall( :Obj  0.0  0.0  -140.90 )
:EndP
    Return
    ;
:Obj
    CallLibObj
        ( 0 9797FC57 8A930060 11D14AC5 A028DC53 )
    Return
    ;
EndA

TOP 

2.43 | FS2000 - FS2002
CrashStart( :Lab rad )
I_96( :Lab rad )
 

Used in object libraries for crash detection codes. It seems this insruction also acts as a switch which decides whether to execute the crash detection code or the display code.
Maybe the crash detection code is only executed if invoked from CrashIndirect().

:Lab  continue at Lab if no crash
rad  object ground radius in meter

This is a typical start code sequence of an simple library object:

LibObj( ... )
    CrashStart( :Object 54 )
    CrashBox( :NoCrash  0 18 0  32 25 82  0 0 0 )
    SetCrashCode( 14 )
:NoCrash
    Return ; end of crash test
    ;
:Object
    ; here follows the normal object code
    ...

TOP 

2.43 | FS2000 - FS2002
CrashSphere( :Lab rad )
I_97( :Lab rad )
 
:Lab  continue here if outside the sphere
rad  object 3D radius in meter

TOP 

FS2000 - FS2002
CrashBox( :Lab xofs zofs yofs   xwid hig ywid   p b h )
I_98( ... )
 

This is a crash detection box which can be shifted and rotated. The jump to :Lab is performed if plane is not in the box. Longitudinal units are scale factor dependant. Only found in 3D library objects.

xofs  the center 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 height
ywid  total width in N-S direction
pitch angle
bank angle
heading angle

TOP 

FS2000 - FS2002
SetCrashCode( code )
 

This instruction sets the crash code. Used in 3D library objects.

code  any value different than 0 triggers a crash normally code 14 is used.
mountain
general
building (eye position)
splash
10 gear up
12 overstress
14 building (plane position)
16 aircraft
18 fuel truck
20 object

TOP 

2.85 | FS2002
CrashOctTree(code   x y z   w h d
 n10 n11 n12 n13 n14 n15 n16 n17
 <list of nodes> )
 

Used in library objects for crash detection. Sorry, no more information available.

code  crash code
x z y  crash box coordinates
w h d  wide height and deepth of the crash box
n(ik)  crash node data (index), 8 per node
254 = node empty
255 = node full
-


 

    
TOP © Manfred Moldenhauer