Sign in to follow this  
Guest sbdwag

Using SetScaleX while calling library objects

Recommended Posts

Has anyone been successfull in using the SetScaleX command to call a library object from a macro.exampleArea( B %1 %2 %3 )IfVarRange( :ExitComplex 0346 %12 5 )Jump( :ComplexOK ):ExitComplexJump32( :Exit ):ComplexOKPerspectiveCall( :PCall )ShadowCall( :PC02 )Jump32( :Exit ):PCallPerspective:PC02mif( %11 )RefPoint( 2 :Skip %4 %1 %2 E= %11 v1= %10 V2= 1500 )melseRefPoint( 7 :Skip %4 %1 %2 v1= %10 v2= 1500 )SetScaleX ( :B 0 0 7) ;set scale to app .003mifendJump( :Continue ):SkipReturn:ContinueRotatedCall( :B 0 0 %5 )Return:BTransform_Mat( 0.000000 800.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000 )CallLibObj( 0x0 4F47414C 31455346 59683260 00000058 ) ; call library object TransformEndReturn:ExitEndACannot get this to work Transform_Mat works fine though. Would the dz move have to be changed from 800m to .24m in this situation.RegardsDennis Waggoner

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi,try this:==================================Area( 5 %1 %2 %3 )IfVarRange( :Exit 0346 %12 5 )PerspectiveCall( :PCall )ShadowCall( :PC02 )Jump32( :Exit ):PCallPerspective:PC02mif( %11 ) RefPoint( 2 :Skip %4 %1 %2 E= %11 v1= %10 V2= 1500 )melse RefPoint( 7 :Skip %4 %1 %2 v1= %10 v2= 1500 ) SetScaleX ( :B 0 0 7 ) ;set scale to app .003mifendTransformMat( a 0 0 0 0 0 %5 ) CallLibObj( 0x0 4F47414C 31455346 59683260 00000058 )Transform_EndJump( :Continue ):SkipReturn:ExitEndA===============================I think this will work. I have used SetScaleX succesfully with some objects in my scenery but I do not have exact API for calling them at work.Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

It could also be the problem that the SetScale command is inside the mif-loop. I would try the code like this:[tt]Area( 5 %1 %2 %3 )IfVarRange( :Exit 0346 %12 5 )PerspectiveCall( :PCall )ShadowCall( :PCall )Jump32( : ):PCallmif( %11 ) RefPoint( 2 :Skip %4 %1 %2 E= %11 v1= %10 V2= 1500 )melse RefPoint( 7 :Skip %4 %1 %2 v1= %10 v2= 1500 )mifendSetScaleX ( :Skip 0 0 7 ) ;set scale to app .003TransformMat( a 0 0 0 0 0 %5 ) CallLibObj( 0x0 4F47414C 31455346 59683260 00000058 )Transform_End:SkipReturn:ExitEndA[/tt]

Share this post


Link to post
Share on other sites

What Im trying to do is learn enought scasm to create library objects converted from old api already scaled and heights set so that I do not have to call them in the library object call macro.Taking SetScaleX out of the if then statment did the trick now what I would like to do is incorporate them into the library source for compiling but as I have not been successful one reason I suspect is because the SetScaleX command looks for a valid loop (area) call which requires a return. Put the return in the source and compile it and it never gets to the object code in the compiled library so it never shows up the call macro.Anyway Im looking for a way to do this**********object source start****************************Area( 5 0.00 0.00 32 ) PerspectiveCall( :air_1@ ) Jump( :extend ):air_1@ Perspective RefPoint( 7 :ret_1@ 1.0 0.00 0.00 v1= 8000 v2= 120 ) SetScaleX( :ret_1@ 0 0 7 ) TransformCall( :AIRCRAFT 0 789 0 -11.36 0 0 0 0.00 0 ):ret_1@ Return ;this will not work ? ; **** Logical start of Aircraft drawing code:AIRCRAFT VectorJump( :L001298 m 0 32767 0 0.000000 ) Call( :L00129E ) Return.... ;object code.. ShadedPoly( m -2587 -9012 31397 540.80944 43 44 55 54 ) Return*****************object source end*************compile this into the library bgl and then scale and z elevation are already correct without any sophisticated library call macrosRegardsDennis Waggoner

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this