Archived

This topic is now archived and is closed to further replies.

n4gix

VC lighting and Landing Lights

Recommended Posts

Hey peoplesI have been working on the VC gauge lighting in my new plane for some time now and just about have it down. (Attached is a screen shot for anyone who is interested). one last thing is bugging me, to make the lightmaps work i have tied them to the landing lights and have forced them on at all times usingtrigger_key_event (KEY_LANDING_LIGHTS_SET,1);this is ok but if i press the "L" key or turn the lights on or off using default sim commands the landing lights flicker. i know why this happens, there is a delay between the lights being turned off by the sim and them being turned back on by the gauge. i was wondering if anyone knew of a way to prevent this flickering. Any help on this would be greatly appreciated.CheersPaul

Share this post


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

Lovely!Have you included a check flag to ensure the keyevent is only run once?Tell folks to keep their fingers off the L key, and provide adequate switches for the lighting! ;)I do hope you aren't checking the light status and using that as a trigger for the keyevent, as that will cause the 'flickering' as the gauge will be in a "race condition" and eat your memory quickly... :(

Share this post


Link to post
Share on other sites

Hey oThe statment:trigger_key_event (KEY_LANDING_LIGHTS_SET,1);Is just sitting at the end of a gauge callback with no conditions placed upon it. So i guess its "set" every cycle probably not the best?i can easily run the key event once at start up but if someone dose go and push the L key all the lights will get screwed up i would prefer the flicker in that case. is that the only way?Thanks for the reply lots to think about and i'm glad you like it so far :)Paul

Share this post


Link to post
Share on other sites

As Bill says, add a check variable to the 'on' line. To sort the last problem, keep checking to see if the lights have been turned off and if they have, force them back on again. I can't give code because I'm a C programmer but I use similar checks for e.g. hydraulics failures to stop the user from being able to use various control surfaces.-Dai

Share this post


Link to post
Share on other sites

Hey oThanks for all your help guys will implement your suggestions and let you know how it goes. by the way i am programming in C++ not XML.Thanks againPaul

Share this post


Link to post
Share on other sites

>Thanks for the reply lots to think about and i'm glad you like>it so far :)Well, the trigger_key_event kinda gave me the clue you were coding in C rather than scripting in XML... ;)Although I cannot claim to have "invented" the emissive backlighting technique, I am quite confident that I'm the first to have ever disclosed the details of "how it's done" to the general public!When I first became seriously interested in modeling and gauge coding during the life of FS2002, I spent well over a year in search of the "holy grail" so to speak. Based on tedious piecing together bits-and-pieces of disparate data, close study, and reluctantly shared "veiled hints" from other, established developers, and knowing for a certainty that it COULD be done......I finally figured it out and immediately set about letting everyone know!Imagine my utter surprise to later discover during the late FSX development cycle that even the nice folks at ACES had absolutely no idea that this could be done! :-lol Which is why in FSX we now have two completely different ways to implement emissive gauge backlighting......which honestly is a good thing, because the new method ACES developed allows us to "light" glass gauges brightly even in the daytime! :-kewl

Share this post


Link to post
Share on other sites