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

Loop this code?

Messages
29
Country
unitedkingdom
Some guidance appreciated again guys!

I have the following code which is working as intended but wonder if there is a more elegant way of doing it? I experimented with a loop and goto but could not get it to work in the same way.

XML:
<Update>
    (L:AzCenter, degrees) 46 &lt; (L:LoopRev, enum) 0 == &amp;&amp; if{
(L:AzCenter, degrees) 2 + (>L:AzCenter, degrees) (L:AzCenter, degrees) 46 == if{ 1 (>L:LoopRev, enum) }
} els{
(L:AzCenter, degrees) 46 /-/ &gt; (L:LoopRev, enum) 1 == &amp;&amp; if{
(L:AzCenter, degrees) 2 - (>L:AzCenter, degrees)
(L:AzCenter, degrees) 46 /-/ == if{ 0 (>L:LoopRev, enum) }
}}
</Update>

I use the output from L:AzCenter to sweep a line across my radar screen from left to right. Eventually I would like to be able to freeze it when the radar is switched off or just complete a single 'sweep'.
 
Could try this, not tested.
1st I moved everything to the positive side, it gets biased -46 to 46 at the end. Just seems easier plus it self initializes.
It should complete the full sweep back to the left, regardless of where it is, on radar off or supply (avionics bus) off, then stop.
XML:
<Update>
    (L:Counter, number) 0 == if{ 2 (>L:Rate,number) }
    (L:Counter, number) 92 == if{ -2 (>L:Rate,number) }
    (A:CIRCUIT AVIONICS ON, bool) ! (L:Radar_On, bool) ! || (L:Counter, number) 0 != and (A:CIRCUIT AVIONICS ON, bool) (L:Radar_On, bool) and || if{ (L:Counter, number) (L:Rate,number) + 0 max 92 min (>L:Counter, number)  }
    <!-- THIS ONE WOULD BE ONLY A FREEZE WHEN OFF
    (A:CIRCUIT AVIONICS ON, bool) (L:Radar_On, bool) and if{ (L:Counter, number) (L:Rate,number) + 0 max 92 min (>L:Counter, number)  }
    -->
    (L:Counter, number) 46 - (>L:AzCenter, degrees)
</Update>
 
Last edited:
Thanks for the input guys. I’ve tested a combination of the codes to fit with what I need. Got the freeze working. Just trying to implement a single ‘sweep’ now.
 
Back
Top