Sign in to follow this  
Guest

Macro's --- visual problems

Recommended Posts

hi all I have been working on converting a macro in to a library object, with limited sucess!!!!The macro is only visable when viewed from a certain angle in spot view and when the viewing angle is increased or decreased beyond(Appx 180' in view).Also as approaching the object, fairly close, it disappears. Their are other examples of the object(Pylon) which just dont show at times and do on other occasions.My first thought is 'V1 and V2' variables, not sure? Although V2= 0, I have tried V2= 200, without sucess.I have had similar experiences with ground polygons, because I had not included a Flattening polygon.This how I am trying to install the Pylon in my scenery!!!!!; ------------------------------------------------------------------------; PYLON MACRO; ----------- Area( 5 52:38:41.598433 -03:08:24.499980 20 ) ; Start of library call IfVarRange( : 346 2 5 ) PerspectiveCall32( :persp ) Jump32( : ):persp Perspective :Pylon01;------------------------------------------------------------------- RefPoint( rel :NoDisplay 0.1 52:38:41.598433 -03:08:24.499980 V1= 5000 V2= 0 ) RotatedCall( :objcall1 0 0 43.407532 ) ; rotate object to user preset :objcall1 CallLibObj( 0 0013CC70 0013CC6E 00517344 4D415400 ) :Pylon02;-------------------------------------------------------------------- IfVarRange( : 346 2 5 ) RefPoint( rel :NoDisplay 0.1 52:38:31.786581 -03:08:38.427482 V1= 5000 V2= 0 ) RotatedCall( :objcall2 0 0 43.407532 ) ; rotate object to user preset :objcall2 CallLibObj( 0 0013CC70 0013CC6E 00517344 4D415400 ) ;--------------------------------------------------------------------;ETC Etc (repeated for the number of pylons required);--------------------------------------------------------------------:NoDisplay Return :EndP EndA Hope someone can help me with this. I have spent thirtysix hours on this one, feel it is simpleMany thanks in anticipationRegards Dave

Share this post


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

Hi DaveThere a couple of things in your calling code that are not quite right. Here is a suggested replacement with comments

; ====================================================================; PYLON MACRO - Modified version ; ------------------------------  Area( 5 52:38:41.598433 -03:08:24.499980 20 )  IfVarRange( : 346 2 5 ); you don't need to repeat this later - one check is enough  PerspectiveCall( :persp )   Jump( : ) :persp ; Perspective - This command is obsolete and can be omitted - it is just ignored by all recent versions of FS  RefPoint( rel :Pylon02 0.1 52:38:41.598433 -03:08:24.499980 V1= 5000 V2= 250 )   RotatedCall( :objcall 0 0 43.407532 ); this needs to calls a separate subroutine - see below:Pylon02  RefPoint( rel :EndP 0.1 52:38:31.786581 -03:08:38.427482 V1= 5000 V2= 250 )   RotatedCall( :objcall 0 0 43.407532 ); ---------------------------------------------------- ; ETC Etc (repeated for the number of pylons required) ; ---------------------------------------------------- :EndP ; this is the end of the subroutine called by PerspectiveCall()   Return :objcall; --------------------------------------------------------------------; Because the object calls require a 'RotatedCall' to set the heading,; they must be written as a subroutine with a Return.  Because you are; calling the same object, the same subroutine will suffice for each; instance of the object call :-; --------------------------------------------------------------------  CallLibObj( 0 0013CC70 0013CC6E 00517344 4D415400 )   ReturnEndA ; ====================================================================

Although your original code does work after a fashion (ignoring the visibility problems), it creates a rather jumbled sequence that actually results in the second pylon being drawn four times at the same location! Every ...Call() command needs to call a separate, self-contained, subroutine block ending with its own Return. These subroutines should be placed between the Return that terminates the routine reached via PerspectiveCall() and the EndA that terminates the Area block.(Note also that you don't actually need 32-bit calls and jumps here - they are only required for large Area blocks compiling to code exceeding 32kB, although the savings achieved by using the shorter/quicker 16-bit versions are, to be honest, insignificant - it's just me being pernickity about correct coding really!)However, the incorrect structure of your original code may not, by itself, be the cause of your visibility problems. The V2 parameter is intended to prevent the problem that you are having with the objects disappearing as you get close to them; it is meant to be the radius of the object in design units, but experience suggests that it's worth trying a higher value such as 250.The viewing angle problem might have something to do with the code of the library object itself - let us see a copy of that too!Hope this helpsKind RegardsGerrish

Share this post


Link to post
Share on other sites

My thanks to Gerrishfor his constructive coding.for others that may have read, V2= 3600 seemed to resolve the problemRegards Dave

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