Jump to content
Sign in to follow this  
arno

My custom light excludes autogen

Recommended Posts

Guest projca

Hello everybody!I've made a custom light in scasm, but when I place it in the scenery the light excludes autogen. I've read about this topic previously but I'm not a expert in scasm programming!.Here is the code of the light macro;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=; API Header Lines added by SceneGenXVersion 1.0 Build 34;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;MACRODESC Lamp (EOD);DEFAULTSCALE 1.00;DEFAULTPARAMS , , , , , , , , , , ;PARAMDESCR , , , , , , , , , , ;DEFAULTRANGE 3000 M;DEFAULTDENSITY NORMAL;TEXTURES , ;DESIGNSHAPELINES -20, -10, -20, 10, -20, 10, -10, 20, -10, 20, 10, 20, 10, 20, 20, 10, 20, 10, 20, -10, 20, -10, 10, -20, 10, -20, -10, -20, -10, -20, -20, -10, ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;--------------------------------------------; Filename: lamp.api; Directory: ; Project: ; Designer: ; Date: 2005-03-05; Update: 2005-03-05; Credits: ; Macro generated using EOD 2.2.84; Any commercial distribution or use of this file is prohibited;--------------------------------------------; %1 = Latitude; %2 = Longtitude; %4 = Not used [RefpointScale=1, ObjectScale=0.25]; %5 = Rotation; %6 = Not Used; %7 = Not Used; %8 = Not Used; %9 = Not Used; %10 = Visibility range; %11 = Altitude; %12 = Detail level; 0 = Radial visibility range (x 1.5); %15 = User definedArea( B %1 %2 22 ) mif( %12 ) IfVarRange( : 0346 %12 5 ) mifend PerspectiveCall( :Pos ) ShadowCall( :Pos ) Jump( : ) :Pos mif( %11 ) RefPoint( 3 :End %1 %2 E= %11 V1= %10 V2= 0 ) melse RefPoint( 7 :End 1 %1 %2 V1= %10 V2= 0 ) mifend SetScaleX( :End 0 0 14 ) ; Scale=0.25 mif( %5 ) RotatedCall( :Begin 0 0 %5 ) melse Call( :Begin ) mifend :End Return :Begin Call( :Lamps ) VectorJump( :West 32767 0 0 0 ) VectorJump( :SouthEast 0 0 32767 0 ):NorthEast Return:SouthEast Return:West VectorJump( :SouthWest 0 0 32767 0 ):NorthWest Return:SouthWest Return:Lamps;Lamp: Object 1 IfVarAnd( :EndofLamp0 28c 6 ) Light( m 0 0.0 0.0 0.0 1073741824 0.0 0.0 FB 255 160 64 0.0 0.0 0.0 )Light( m 0 0.0 0.0 0.0 1073741824 0.0 0.0 FB 255 160 64 0.0 0.0 0.0 )Light( m 0 0.0 0.0 0.0 1073741824 0.0 0.0 FB 255 160 64 0.0 0.0 0.0 ):EndofLamp0 ReturnEndA---------------Thank you!!Pablo

Share this post


Link to post
Share on other sites

Hi Pablo,I don't know if it really solves the autogen exclude, but can you check this macro? There were a few coding errors in the code you posted. For example no v2 value was set. Maybe this code works better (and it is a bit more efficient as well).[tt]Area( B %1 %2 22 )mif( %12 )IfVarRange( : 0346 %12 5 )mifendPerspectiveCall( :os )Jump( : ):osmif( %11 )RefPoint( 2 :End %4 %1 %2 E= %11 V1= %10 V2= 5 )melseRefPoint( 7 :End %4 %1 %2 V1= %10 V2= 5 )mifendmif( %5 )RotatedCall( :Begin 0 0 %5 )melseCall( :Begin )mifend:EndReturn:BeginIfVarAnd( :EndofLamp0 28c 6 )Light( m 0 0.0 0.0 0.0 1073741824 0.0 0.0 FB 255 160 64 0.0 0.0 0.0 ):EndofLamp0ReturnEndA[/tt]


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

Share this post


Link to post
Share on other sites
Guest projca

Hello arnoI've tried your code and it worked well but the lights are excluding the buildings.I've attached a screenshotThank youPablo

Share this post


Link to post
Share on other sites

Hi Pablo,Your screenshot does not look to bad if you ask me. You will always get some autogen exclusion, as that is how it is supposted to work.Maybe you could try the dummy RotatedCall we found out for Fs2002 some time I go. Just do a search for dummy RotatedCall on this forum.


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

Share this post


Link to post
Share on other sites
Guest projca

Hello arno, After I read a lot of topics about the rotated call dummy, I get confused! :-hmmm I'd like if you can add to the light macro that code. I usually work with gmax and other tools like sbuilder, so I amnot familiarized with scasmThank you!!!Pablo

Share this post


Link to post
Share on other sites

Hi Pablo,It's a long time ago that I used this trick, so I hope I did it correct. Please try this code:[tt]Area( B %1 %2 22 )mif( %12 )IfVarRange( : 0346 %12 5 )mifendPerspectiveCall( s )Jump( : )smif( %11 )RefPoint( 2 :End %4 %1 %2 E= %11 V1= %10 V2= 5 )melseRefPoint( 7 :End %4 %1 %2 V1= %10 V2= 5 )mifendmif( %5 )RotatedCall( :Begin 0 0 %5 )melseCall( :Begin )mifendRotatedCall( :End):EndReturn:BeginIfVarAnd( :EndofLamp0 28c 6 )Light( m 0 0.0 0.0 0.0 1073741824 0.0 0.0 FB 255 160 64 0.0 0.0 0.0 ):EndofLamp0ReturnEndA[/tt]


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

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...