May 2, 200224 yr I've created a object library which contains following code:; generated with MAT's Scasm Editor Version 1.0 ; copyright 2001 ; Start of LibraryObject Header( 1 90 -89 -180 -179 ) ; object header ObjId( AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA ) LibObj( PWR 0 SIZE 10 SCALE 1 TYPE 0x0 NAME Koivu ) :B; CRASH DetectionIfVarRange3( :NoCrash 37E -110 110 382 0 222 386 -110 110 )SetVar( 0284 14 ):NoCrashCall32( :Part0 )Call32( :Part1 ):SkipReturn:ExitJump( :End );; Part: Polygon:Part0Points( 0 -109 223 0 ; 0 110 223 0 ; 1 110 1 0 ; 2 -109 1 0 ; 3 -109 223 0 ; 4 110 223 0 ; 5 110 1 0 ; 6 -109 1 0 ; 7 );RGBSColor( ef 121 121 121 )Dwx( 2d ) ; color commandDbd( 121 ) ; redDbx( ef ) ; flag/transparencyDbd( 121 ) ; greenDbd( 121 ) ; blue; BGL_TEXTURE: tclass=39h color=79EF7979 name=treessu.bmpDwx( 0043 001a 0000 0039 ef79 7979 )Dba(treessu.bmp)Dbx( 00 00 )TexPoly( 0 0 -32767 0.00 0 138 192 1 243 192 2 243 128 3 138 128 )TexPoly( 0 0 32767 0.00 7 243 128 6 138 128 5 138 192 4 243 192 )Return;; Part: Polygon.1:Part1Points( 0 0 223 -109 ; 0 0 223 110 ; 1 0 1 110 ; 2 0 1 -109 ; 3 0 223 -109 ; 4 0 223 110 ; 5 0 1 110 ; 6 0 1 -109 ; 7 );RGBSColor( ef 121 121 121 )Dwx( 2d ) ; color commandDbd( 121 ) ; redDbx( ef ) ; flag/transparencyDbd( 121 ) ; greenDbd( 121 ) ; blue; BGL_TEXTURE: tclass=39h color=79EF7979 name=treessu.bmpDwx( 0043 001a 0000 0039 ef79 7979 )Dba(treessu.bmp)Dbx( 00 00 )TexPoly( 32766 0 0 -0.00 0 138 192 1 243 192 2 243 128 3 138 128 )TexPoly( -32766 0 0 0.00 7 243 128 6 138 128 5 138 192 4 243 192 )Return:End EndObj ; End of LibraryObject I've compiled this by using SCASM 2.88 and copied bgl file into FS2002scenery directory and textures to FS2002texture directory. However, when trying to use library object, FS2002 displays Library object ID 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA not found error message. What goes wrong?The API macro that utilizes this object is:Area( 5 %1 %2 %3 ) IfVarRange( : 0x0346 %12 5 ) PerspectiveCall( :Persp ) Jump( : ):Persp ; Perspective:Rotate mif( %11 ) RefPoint( 2 :EndC %4 %1 %2 v1= %10 E= %11 %13 %14 ) melse RefPoint( 7 :EndC %4 %1 %2 v1= %10 %13 %14 ) mifend RotatedCall( :Objcall 0 0 %5 ):EndC Return:Objcall CallLibObj( 0 AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA ) ReturnEndA
May 2, 200224 yr There is a typo in Ralf's scasm editor...it prints the header wrong,Header( 1 90 -89 -180 -179 ) ; object headerShould beHeader( 1 90 -89 180 -179 ) ; See the difference?I don't know if you can set the crash variable from within a library object...if you still are having prob, edit that out and see.Finally, you have some dangling labels from the fsds code...that'll cause errors...:skip and :end are not referred to.I'd delete the lines :SkipReturn:Exitthat way when you return from your second part, you'll jump to :end, which leaves the object.finally in your calling macro, I see a label :rotate which is not used, should be deleted.Hope that helps,Bob Bernstein
May 2, 200224 yr Commercial Member And to complete what Bob said, there is a Return statement missing on the end of the library. To help you a bit I'll place the corrzected code below.[tt]Header( 1 90 -89 180 -179 )ObjId( AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA ) LibObj( PWR 0 SIZE 10 SCALE 1 TYPE 0x0 NAME Koivu ) IfVarRange3( :NoCrash 37E -110 110 382 0 222 386 -110 110 ) SetVar( 0284 14 ) :NoCrash Call32( :Part0 ) Call32( :Part1 ) Jump( :End ) ; Part: Polygon :Part0 Points( 0 -109 223 0 ; 0 110 223 0 ; 1 110 1 0 ; 2 -109 1 0 ; 3 -109 223 0 ; 4 110 223 0 ; 5 110 1 0 ; 6 -109 1 0 ; 7 ) RGBSColor( ef 121 121 121 ) LoadBitmap( 0 6 EF 79 79 79 treessu.bmp )TexPoly( 0 0 -32767 0.00 0 138 192 1 243 192 2 243 128 3 138 128 ) TexPoly( 0 0 32767 0.00 7 243 128 6 138 128 5 138 192 4 243 192 ) Return ; Part: Polygon.1 :Part1 Points( 0 0 223 -109 ; 0 0 223 110 ; 1 0 1 110 ; 2 0 1 -109 ; 3 0 223 -109 ; 4 0 223 110 ; 5 0 1 110 ; 6 0 1 -109 ; 7 ) RGBSColor( ef 121 121 121 ) LoadBitmap( 0 6 EF 79 79 79 treessu.bmp )TexPoly( 32766 0 0 -0.00 0 138 192 1 243 192 2 243 128 3 138 128 ) TexPoly( -32766 0 0 0.00 7 243 128 6 138 128 5 138 192 4 243 192 ) Return :End ReturnEndObj ; End of LibraryObject Area( 5 %1 %2 %3 ) IfVarRange( : 0x0346 %12 5 ) PerspectiveCall( :Persp ) RotatedCall( :Obj )Jump( : ) :Persp ;Perspective :Objmif( %11 ) RefPoint( 2 :EndC %4 %1 %2 v1= %10 E= %11 %13 %14 ) melse RefPoint( 7 :EndC %4 %1 %2 v1= %10 %13 %14 ) mifend CallLibObj( 0 AAAAAAAA AAAAAAAA AAAAAAAA AAAAAAAA ) :EndC Return EndA[/tt]I hope it now works for you,ArnoMember NL2000 Teamhttp://home.wanadoo.nl/arno.gerretsen Arno If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done. FSDeveloper.com | Former Microsoft FS MVP | Blog
Create an account or sign in to comment