Jump to content
Sign in to follow this  
Guest

Day/Night Autoswitch?

Recommended Posts

Guest

I am needing to toggle an fx file based on whether it is daytime or nighttime. Obviously there is no existing K_event that covers this as far as I can determine, but has anyone an idea how this might be implemented?I remember from many months ago that Karl Peterson was trying to come up with a scheme that relied on using lat/lon coordinates and time-of-day, in an effort to determine the sun's current angle (or something similar), but never managed to get it to work properly.Obviously, FS2k2 itself has some way of determining this internally so it will "know" when to use night textures... but I'll be darned if I can figure out how to access this information!Any ideas, anyone? :)BillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://mtco.com/~rsam/fartslogo.jpg

Share this post


Link to post
Share on other sites

Frather,I didn't test it, but perhaps you can use:......if{ 12 (>K:CLOCK_HOURS_SET) } els{ 24 (>K:CLOCK_HOURS_SET) }or something like thatJan"Procul Negotiis"

Share this post


Link to post
Share on other sites
Guest bartels

I have some C code lying around to determine sun angle over horizon ("elevation") from coordinates and time. I might dig them out if you want.Arne Bartels

Share this post


Link to post
Share on other sites
Guest InBetween

Greetings,If you are wanting an "effect" to appear differently at nightthan in daytime, a line can be added to the {particle} section:shade=1Sorry if I have misunderstood the question:)JR

Share this post


Link to post
Share on other sites
Guest

>Greetings,>>If you are wanting an "effect" to appear differently at night>than in daytime, a line can be added to the {particle}>section:>>shade=1>>Sorry if I have misunderstood the question:)No, you may well have hinted at the answer... What I want to do is apply a 'floodlight' to the VC panel only during the daytime to 'brighten up' the otherwise way-too-dark VC when the sun is at the wrong angle.I've achieved *exactly* the effect I want, but I don't want those fx 'floodlights' to be on at night, because then it's way too bright! :(Here is a comparison showing the VC with and without the fx "floodlighting" turned on. As you can see, the effect in the daytime is stunning! But, I don't want the pilot to have to manually switch the 'daytime floods' on/off, but rather make them transparent to the pilot.http://catholic-hymns.com/frbill/FS2002/Pr...e_compare_4.JPGBillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://mtco.com/~rsam/fartslogo.jpg

Share this post


Link to post
Share on other sites
Guest

Here is the code from the current fx file. What would I need to add/change to make this work ONLY during the daytime?[Library Effect]Lifetime=5Version=2.00Display Name=C4 landing light effect[Properties]Cockpit=1VirtualCockpit=0Spot=0Tower=0Map=0[Emitter.0]Lifetime=0.50, 0.50Delay=0.00, 0.00Bounce=0.00Light=1No Interpolate=1Rate=1.00, 1.00X Emitter Velocity=0.00, 0.00Y Emitter Velocity=0.00, 0.00Z Emitter Velocity=0.00, 0.00Drag=0.00, 0.00X Particle Velocity=0.00, 0.00Y Particle Velocity=0.00, 0.00Z Particle Velocity=0.00, 0.00X Rotation=0.00, 0.00Y Rotation=0.00, 0.00Z Rotation=0.00, 0.00X Offset=0.00, 0.00Y Offset=0.00, 0.00Z Offset=0.00, 0.00[Particle.0]Lifetime=0.00, 0.00Type=19X Scale=2.30, 2.30Y Scale=2.30, 2.30Z Scale=0.00, 0.00X Scale Rate=0.00, 0.00Y Scale Rate=0.00, 0.00Z Scale Rate=0.00, 0.00Drag=0.00, 0.00Color Rate=0.00, 0.00X Offset=0.00, 0.00Y Offset=0.00, 0.00Z Offset=0.00, 0.00Fade In=0.00, 0.00Fade Out=0.00, 0.00Rotation=0.00, 0.00Static=1Face=1, 1, 1[ParticleAttributes.0]Blend Mode=2Texture=fx_cplite_C4.bmpBounce=0.00Color Start=50, 47, 45, 45Color End=50, 47, 45, 0Jitter Distance=0.00Jitter Time=0.00uv1=0.00, 0.00uv2=1.00, 1.00X Scale Goal=0.00Y Scale Goal=0.00Z Scale Goal=0.00Extrude Length=0.00Extrude Pitch Max=0.00Extrude Heading Max=0.00[Emitter.1]Lifetime=0.50, 0.50Delay=0.00, 0.00Bounce=0.00No Interpolate=1Rate=1.00, 1.00X Emitter Velocity=0.00, 0.00Y Emitter Velocity=0.00, 0.00Z Emitter Velocity=0.00, 0.00Drag=0.00, 0.00X Particle Velocity=0.00, 0.00Y Particle Velocity=0.00, 0.00Z Particle Velocity=0.00, 0.00X Rotation=0.00, 0.00Y Rotation=0.00, 0.00Z Rotation=0.00, 0.00X Offset=0.00, 0.00Y Offset=0.00, 0.00Z Offset=0.00, 0.00[Particle.1]Lifetime=0.00, 0.00Type=19X Scale=2.30, 2.30Y Scale=2.30, 2.30Z Scale=0.00, 0.00X Scale Rate=0.00, 0.00Y Scale Rate=0.00, 0.00Z Scale Rate=0.00, 0.00Drag=0.00, 0.00Color Rate=0.00, 0.00X Offset=0.00, 0.00Y Offset=0.00, 0.00Z Offset=0.00, 0.00Fade In=0.00, 0.00Fade Out=0.00, 0.00Rotation=0.00, 0.00Static=1Face=1, 1, 1[ParticleAttributes.1]Blend Mode=2Texture=fx_cplite_C4.bmpBounce=0.00Color Start=50, 47, 45, 45Color End=50, 47, 45, 0Jitter Distance=0.00Jitter Time=0.00uv1=0.00, 0.00uv2=1.00, 1.00X Scale Goal=0.00Y Scale Goal=0.00Z Scale Goal=0.00Extrude Length=0.00Extrude Pitch Max=0.00Extrude Heading Max=0.00[Emitter.2]Lifetime=0.50, 0.50Delay=0.00, 0.00Bounce=0.00No Interpolate=1Rate=1.00, 1.00X Emitter Velocity=0.00, 0.00Y Emitter Velocity=0.00, 0.00Z Emitter Velocity=0.00, 0.00Drag=0.00, 0.00X Particle Velocity=0.00, 0.00Y Particle Velocity=0.00, 0.00Z Particle Velocity=0.00, 0.00X Rotation=0.00, 0.00Y Rotation=0.00, 0.00Z Rotation=0.00, 0.00X Offset=0.00, 0.00Y Offset=0.00, 0.00Z Offset=0.00, 0.00[Particle.2]Lifetime=0.00, 0.00Type=19X Scale=2.30, 2.30Y Scale=2.30, 2.30Z Scale=0.00, 0.00X Scale Rate=0.00, 0.00Y Scale Rate=0.00, 0.00Z Scale Rate=0.00, 0.00Drag=0.00, 0.00Color Rate=0.00, 0.00X Offset=0.00, 0.00Y Offset=0.00, 0.00Z Offset=0.00, 0.00Fade In=0.00, 0.00Fade Out=0.00, 0.00Rotation=0.00, 0.00Static=1Face=1, 1, 1[ParticleAttributes.2]Blend Mode=2Texture=fx_esbj400_tailflood.bmpBounce=0.00Color Start=255, 255, 255, 45Color End=200, 200, 200, 0Jitter Distance=0.00Jitter Time=0.00uv1=0.00, 0.00uv2=1.00, 1.00X Scale Goal=0.00Y Scale Goal=0.00Z Scale Goal=0.00Extrude Length=0.00Extrude Pitch Max=0.00Extrude Heading Max=0.00BillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://mtco.com/~rsam/fartslogo.jpg

Share this post


Link to post
Share on other sites
Guest

>I have some C code lying around to determine sun angle over>horizon ("elevation") from coordinates and time. I might dig>them out if you want.>Arne BartelsThank you Arne. If the other suggestion (altering the fx file itself) doesn't pan out, that may well be the only solution. Using that is, "if the sun's angle is :)Right now, the fx is tied to the "LOGO" switch, so I can manually turn the "daytime floods" on/off, but I would prefer this to be automatic... :)BillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://mtco.com/~rsam/fartslogo.jpg

Share this post


Link to post
Share on other sites
Guest

>I didn't test it, but perhaps you can use:>>......if{ 12 (>K:CLOCK_HOURS_SET) } els{ 24>(>K:CLOCK_HOURS_SET) }>>or something like thatThank you for the suggestion, Jan. I don't think that will serve the purpose though... :(But, at least you've tried to be helpful, and for that I thank you! :)BillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://mtco.com/~rsam/fartslogo.jpg

Share this post


Link to post
Share on other sites
Guest

>Thank you Arne. If the other suggestion (altering the fx file>itself) doesn't pan out, that may well be the only solution. >Using that is, "if the sun's angle is < x degrees, toggle OFF>the fx." :)As an update, I added the Shade=1 entry to each of the three Particle.x sections of the .fx file... While it does indeed force the effect darker at night, it's still way too much light... :(BillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://mtco.com/~rsam/fartslogo.jpg

Share this post


Link to post
Share on other sites
Guest

I would be interrested in this as well. Currently all my "not-so-autodimming" features are done with some panel light switch, which doesn't seem too good a solution. Although I'm only working on 2D panels mostly.

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...