SCASM Animations
The Tailhook
Keyframe Animation

NOTE
FSDS Pro version 2.33 automatically includes keyframe animation tables when generating the object source code file (.sca) for your model!

Earlier versions of FSDS do not generate these tables, only the code for a static part. If you are using an earlier version of FSDS, you have to build the keyframe data tables code by hand with the help of a little hex editing of the MDL file.

Template     Original SCA Code     Edited SCA Code

In FSDS, each time you set a KeyFrame, you are generating a single row of translation and rotation data that appears in the animation tables for that part.

VAR - hex offset to the variable tailhook extension/retraction.

; Part: PARTNAME
:PARTLABEL
IfVarAnd( :RETPARTNAME  90  8 )
Jump( :PARTNAME )

:RETPARTNAME
Return

:PARTNAME
Jump( :DrawTableNumber ) ; Animation Motion Table
:MotionTblNUM
Dwx( 1 )
Dr4( -1 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dwx( rows )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
     ..........
Dr4( 100.000000 0.000000 0.000000 0.000000 )

; Animation Rotation Table
:RotationTblNUM
Dwx( 3 )
Dr4( -1 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dwx( rows )
Dr4( 0.000000 0.000000 0.000000 0.000000 1.000000 )
     ..........
Dr4( 100.000000 0.000000 0.000000 0.000000 0.000000 )
:DrawTableNumber
VarBase( :MotionTblNUM )
Animate( :[-1] VAR 1 0 0.000000 0.000000 0.000000 )
VarBase( :[-1] )
VarBase( :RotationTblNUM )
Animate( :[-1] VAR 1 0 0.000000 0.000000 0.000000 )
VarBase( :[-1] )
SetMaterial(  m  t  )
DrawTriList( index  ... vertex indices ...  )
TransformEnd
TransformEnd
Return

Original SCA Code     Template     Edited SCA Code

This is the original object source code for tailhook generated by FSDS Pro v2.33 from fxpaint.fsc. Note that if this part had child parts attached to it, the Call32( ... ) commands to those parts would appear just before the two TransformEnd commands near the end of this code. This would ensure that any animation to tailhook would apply to those parts as well.

; Part: tailhook
:Part000093
Jump( :Draw015 )
; Animation Motion Table
:MotionTbl015
Dwx( 0001 )
Dr4( -1.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dwx( 5 )
Dr4( 0.000000 0.000000 0.000000 -1000.160645 )
Dr4( 30.000000 0.000000 0.000000 -1468.970215 )
Dr4( 100.000000 0.000000 0.000000 -1468.970215 )
Dr4( 101.000000 0.000000 0.000000 -1468.970215 )
Dr4( 200.000000 0.000000 0.000000 -1468.970215 )
; Animation Rotation Table
:RotationTbl015
Dwx( 0003 )
Dr4( -1.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dwx( 5 )
Dr4( 0.000000 0.000000 0.000000 0.000000 1.000000 )
Dr4( 30.000000 0.000000 0.000000 0.000000 1.000000 )
Dr4( 100.000000 0.382683 0.000000 0.000000 0.923880 )
Dr4( 101.000000 0.382683 0.000000 0.000000 0.923880 )
Dr4( 200.000000 0.382683 0.000000 0.000000 0.923880 )
VarBase( :MotionTbl015 )
Animate( :[0] 314 1 0 0.000000 0.000000 0.000000 )
VarBase( :[0] )
VarBase( :RotationTbl015 )
Animate( :[0] 314 1 0 0.000000 0.000000 0.000000 )
VarBase( :[0] )
SetMaterial( 4 -1 )
DrawTriList( 1503
    0 1 2
    0 2 3
    4 5 6
    4 6 7
    8 9 10
    8 10 11
    12 13 14
    12 14 15
    16 17 18
    16 18 19
    20 21 22
    20 22 23
    24 25 26
    24 26 27
    28 29 30
    28 30 31
    32 33 34
    32 34 35
    32 35 36
    32 36 37
    32 37 38
    32 38 39
    40 41 42
    40 42 43
    44 45 46
    44 46 47
    48 49 50
    48 50 51
    52 53 54
    52 54 55
    56 57 58
    56 58 59
    60 61 62
    60 62 63
    )
TransformEnd
TransformEnd
Return

Edited SCA Code     Template     Original SCA Code

This is the edited object source code that produces the animated part tailhook in fxpaint.mdl.

; Part: tailhook
:Part000093
Jump( :Draw015 )
; Animation Motion Table
:MotionTbl015
Dwx( 0001 )
Dr4( -1.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dwx( 5 )
Dr4( 0.000000 0.000000 0.000000 -1000.160645 )
Dr4( 30.000000 0.000000 0.000000 -1468.970215 )
Dr4( 100.000000 0.000000 0.000000 -1468.970215 )
Dr4( 101.000000 0.000000 0.000000 -1468.970215 )
Dr4( 200.000000 0.000000 0.000000 -1468.970215 )
; Animation Rotation Table
:RotationTbl015
Dwx( 0003 )
Dr4( -1.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dr4( 0.000000 0.000000 0.000000 0.000000 )
Dwx( 5 )
Dr4( 0.000000 0.000000 0.000000 0.000000 1.000000 )
Dr4( 30.000000 0.000000 0.000000 0.000000 1.000000 )
Dr4( 100.000000 0.382683 0.000000 0.000000 0.923880 )
Dr4( 101.000000 0.382683 0.000000 0.000000 0.923880 )
Dr4( 200.000000 0.382683 0.000000 0.000000 0.923880 )
:Draw015
VarBase( :MotionTbl015 )
Animate( :[-1] 0xE6 1 0 0.000000 0.000000 0.000000 )
VarBase( :[-1] )
VarBase( :RotationTbl015 )
Animate( :[-1] 0xE6 1 0 0.000000 0.000000 0.000000 )
VarBase( :[-1] )
SetMaterial( 4 -1 )
DrawTriList( 1503
    0 1 2
    0 2 3
    4 5 6
    4 6 7
    8 9 10
    8 10 11
    12 13 14
    12 14 15
    16 17 18
    16 18 19
    20 21 22
    20 22 23
    24 25 26
    24 26 27
    28 29 30
    28 30 31
    32 33 34
    32 34 35
    32 35 36
    32 36 37
    32 37 38
    32 38 39
    40 41 42
    40 42 43
    44 45 46
    44 46 47
    48 49 50
    48 50 51
    52 53 54
    52 54 55
    56 57 58
    56 58 59
    60 61 62
    60 62 63
    )
TransformEnd
TransformEnd
Return