• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

P3D v4 Switch/animation bool with night condition

Messages
116
Country
canada
Hi,

How would I go about adding a condition to my gauge that starts these
1 (>L:knob_fcu_light)
1 (>L:knob_fcu_display)
when it is nighttime in the sim or after a specific time?

Edit: I've come up with this, but I can't click them on and off. I don't want them on permanently when it's nighttime, just to automatically come on when it's night.... and it seems to come on during the day as well

<Update> (E:TIME OF DAY, enum) 3 == if{ 1 (&gt;L:knob_fcu_light) 1 (&gt;L:knob_fcu_display) } </Update>


Thanks!
 
Last edited:
Adrian,

I would think that you probably need

(&gt;L:knob_fcu_light,bool)
And
(&gt;L:knob_fcu_display,bool)

Walter
 
Adrian,

I would think that you also need something like this, to avoid it setting all night long...

<Update> (E:TIME OF DAY, enum) 3 ==
if{
(L:knob_fcu_light,bool) 0 ==
if{ 1 (&gt;L:knob_fcu_light,bool) }
(L:knob_fcu_display,bool) 0 ==
if{ 1 (&gt;L:knob_fcu_display,bool) } }
</Update>
 
When you want something to happen only once, you need to set a flag so it doesn't happen again. Then reset the flag when the condition is no longer met. In this case, test that a flag variable is equal to 0 AND the time of day = 3. If so, set your variables to 1, and also set the flag variable to 1. Now your variables will never be set to 1 again while it is night. Then when the time of day is no longer equal to 3 set the flag variable back to 0, ready for the next night.

Not tested:

XML:
<Update>   
(E:TIME OF DAY, enum) 3 == (L:Time_Flag, bool) 0 == &amp;&amp;
if{   1 (&gt;L:knob_fcu_light)  1 (&gt;L:knob_fcu_display)   1  (&gt;L:Time_Flag, bool) }
(E:TIME OF DAY, enum) 3 !=  (L:Time_Flag, bool) 1 == &amp;&amp;
if{   0  (&gt;L:Time_Flag, bool) }
</Update>
 
Back
Top