Sign in to follow this  
Guest btrpilot

Pilot controlled lighting

Recommended Posts

Hello,I'm curious if anybody anybody has been able to incorporate pilot controlled lighting in their FS9/2002 sceneries. I know that ASD has a PCL macro, but it doesn't work in FS2002/2004.Thanks,Brandon

Share this post


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

Hi!It's not such an awful thing, it's quite easy. I made it for my scenery project but it was done in FSDS using SCASM compiler. The basic idea is to use condition where the wariable used is a variable that carries information about navigation radio frequency. This variable can be for ADF (7BC), NAV1 (7C0), NAV2 (7C2) or COM1 (7BE) instrument. Also take a look in the tutorial here:http://www.combatflight.de/html/scasm-tut/scasm2_eng.html the topic on complex object animations.That's for start of course! Until next time,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

I read the tutorial but it was a little over my head... I'm a newbie with macro design. Could you walk me through the process? Also I'm thinking of purshasing FSDS so I can create animated objects, (eg. hangar door sliding open when I tune nav 2 to a certain freq) is this easier to do in FSDS than GMAX? I can't figure out animation in GMAX and I don't have the time to either, being a high school student.Thanks for your help,Brandon

Share this post


Link to post
Share on other sites

Hi Brandon,How did you make your lighting now? Maybe we can give you some simple commands to add when we know how you have made them.And about the animations, I don't know FSDS good enough, but usually with animations like hangar doors it is the problem that the animation plays endlessly (just like the default animations do). This is not really what we want for a hangar door of course. If you are using GMax you could use CAT to correct this problem. It allows you to add conditions to your animations.Maybe FSDS does not have this problem, I bet Goran can tell us :).

Share this post


Link to post
Share on other sites

Um, I either use FSSC or Airport. I also use AFCAD2, but I don't think you can work with that much.Is there a tutorial on animating in GMAX out there? Preferably something easier for a GMAX newbie to understand?

Share this post


Link to post
Share on other sites

Have a look at my website, you can find a video tutorial about animating with GMax there. This tutorual assumes you already now the basic things of GMax.

Share this post


Link to post
Share on other sites

Hi Brandon!FSDS has more or less enless animations although some other non-endless animations are possible. It is easy to understand and start producing complex objects but with GMAX You can step one level higher (at least). Although I do not use GMAX (but I hope I will very soon), I know that animations here are easier to build and more flexible. So much on this topic.As regrads pilot controlled lighting, I would suggest to make one simple light to test the feature. Create it with scenery object program and then tweak it. For SCASM API's (macros produced with FSDS, EOD or FSNova) You must just add a condition, when to show the light. For example, FSDS macro is looking like this:- header (where properties and positioning of the object is done)- a list of textures used in model- a list of materials used in model- a list of all points used in model- calls for drawing each part of the model- definitions of every part of the modelNow the easiest way to make condition is to "correct" calls. If we have part named light.nav with label :_Part000003 then correct section of calls would look like this:...Call32( :_Part000001 )Call32( :_Part000002 ); Call32( :_Part000003 ) ;comment this line and put it at the endCall32( :_Part000004 )Call32( :_Part000005 )IfVarRange( :SkipPart3 7BC 0x296 0x296 ) ;conditionCall32( :_Part000003 ) ;if ADF freq. is 296kHz, call part 3:SkipPart3 ;otherwise jump over and continueEndVersionReturn...Of course in FSDS You can add these conditions on every part, so FSDS will put them at the right place.Similar to this looks correcting ASM files produced by GMAX the structure of the file looks similar, function names are a little bit different...Hope it helps!Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

Thanks, Goran for all your help. I think I'll pick up a copy of FSDS sometime soon. I made a simple lamp in EOD and the code looks a little different than yours. Can you help me out here?;macrodesc Lamp (EOD);defaultscale 1;designshape -1,-1,-1,0,0,0,0,-1;--------------------------------------------; Filename: lamp.api; Directory: Program FilesFS Scenery CreatorMacros; Project: ; Designer: ; Date: 2004-08-02; Update: 2004-08-02; 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 RGBLcolor( BF 255 0 0 ) Dot( 0 0 0 ):EndofLamp0 ReturnEndA

Share this post


Link to post
Share on other sites

Hi,try this:;-------------------------------------------------------;macrodesc Lamp (EOD);defaultscale 1;designshape -1,-1,-1,0,0,0,0,-1;--------------------------------------------; Filename: lamp.api; Directory: Program FilesFS Scenery CreatorMacros; Project: ; Designer: ; Date: 2004-08-02; Update: 2004-08-02; Credits: ; Macro generated using EOD 2.2.84; Any commercial distribution or use of this file isprohibited;--------------------------------------------; %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 ) IfVarRange( :SkipPart3 7BC 0x296 0x296 ) ;condition Call32( :Lamps ) ;if ADF freq. is 296kHz, call part 3 :SkipPart3 ;otherwise 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 RGBLcolor( BF 255 0 0 ) Dot( 0 0 0 ):EndofLamp0 ReturnEndA;-------------------------------------------------But if they have to be illuminated by night, then before my IfVarRange() add a lineIfVarAnd( :Lamps 28C 1 )BTW, since I write this on job, I haven't tested it, but it should work.Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

Hello Goran,I tried it and I got this scasm error message,Error in macro file C:PROGRA~1FSSCEN~1MacrosLITTLE~1.API line 15 -> prohibited -> unknown commandError in line 85 ->

Share this post


Link to post
Share on other sites

In the header of the file the word prohibited is on the next line, but there is no ; in front of it to make it a comment. That is what causes the first part of your error. Maybe if you fix that the other error will also go away.

Share this post


Link to post
Share on other sites

Well it helped, but now it looks like this,Error in line 85 ->

Share this post


Link to post
Share on other sites

Hey! I got it to compile. I deleted the last line with the "-----" after the EndANow I test it out...

Share this post


Link to post
Share on other sites

Ah yes, now I remember, it does not like comments at the end of the file :). It happened to me before and took me a long time to figure out back then.

Share this post


Link to post
Share on other sites

Wow!! Works great! You guys are awesome!!Can you please tell me how to do like a frequency event for my hangar doors? I'm building it for my virtual airline and they really wanted opening doors... So do I build a model with opened doors and then one with closed doors? Then what?

Share this post


Link to post
Share on other sites

Hi,Do I read it right, You want ot have frequency controlled animated hangar doors? Ehm, this is a little bit long and complex API... But yes, it can be done. Check once again the link I have written for SCASM tutorial by Andreas Klisch. There is complete addition You need, sometimes it needs to be customized.Otherwise, if You have just plain opening/closing, without rotation, then just create an API with closed doors. Then you need to animate those doors.The idea of animation is like this:- recreate timer based on variable 5FC, which itself is known as timer tick_18. You need to check last 8 bits, for maximum 256 steps (you can have also only 64 if You wish). Each value is stored in special variable- next create traps on this new timer; for every step create TransformCall, which will put the door at certain distance, like:step 0, door closed, dx = 0step 1, door little opened, dx =1step 2, door little opened, dx =2step 3, door little opened, dx =3...step 63, door fully opened, dx= max- then You will need some extra variables for frequency, for status of opening/closing doors.It's a bit complex but it gives user much much fun then :)Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

Hi Goran, That does sound a little too complex for me... How can I set up the code to show the hangar doors open after tuning a certain frequency in the nav2 or ADF and simply closed when the radios are tuned to another frequency? EOD has an "interactive elements" feature that basically is supposed to do the same thing, but it doesn't work in FS9. I'll try to create a simple macro of a hangar using the interactive elements feature and maybe you can check it out--see what the problem is.;)Thanks a lot for your help, I really appreciate it,Brandon

Share this post


Link to post
Share on other sites

Sure, post the code here, maybe we can see why it does not work anymore.

Share this post


Link to post
Share on other sites

Hello,I guess your still on vacation Arno but maybe somebody else can help me out. Here is the code for my hangar, I also have a screenshot attached of EOD's "interactive elements" box to show you what I'm talking about. Group 2 is the hangar minus the door, group 3 is just the door in the closed position, and group 4 is of course the door in the open position. When I try it out the macro in FS, both groups 3 and 4 are displayed. Any ideas?Thanks for your help,Brandon

Share this post


Link to post
Share on other sites

Brandon,from the source You have attached I can't see any groups there. I don't see any suitable IfVarRange() switch so I can't really exactly tell You how help.Anyway, if You wish to have smooth animation, then You'll have some work to do. If You just want open/close at some frequency then it is just switch like this:IfVarRange( :close_door 7B0 0x1800 0x1800 ) ;var. 7C0 is for NAV1, 0x1800 is for 118.00 Call32( :draw_open_door ) Jump( :_skip ):close_doorCall32( :draw_closed_door ):_skipAgain, smooth animation is quite complex and www.combatflight.de ->tutorials ->SCASM tutorial, part2 holds the answer with all the explanation You need.Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

I didn't see any groups either. Does this mean I can't even do a simple open/close switch like you described?And if it is possible, where exactly do I place the switch?Thanks again,Brandon

Share this post


Link to post
Share on other sites

Hi Brandon!I don't know how EOD works these days. I used it 2 years ago and since then only FSDS. But if You manually tweak the code, then You can do it. Where to put it? I think best before those numerous TransformCalls(). I hope this code will work:http://forums.avsim.net/user_files/88768.txtAnd please TO ALL USERS POSTING CODE! PLEASE DO NAME THE OBJECTS IN CASE OF SUCH PROBLEMS - We can't smell which object is door, mechanism of door or whatever!!!Hope it helps,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

Aha! Its all starting to come together! I still have errors when I compile though, If you don't mind I'd like to continue this discusion on the www.scenerydesign.org website.Thanks,Brandon

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