• 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 v2 Conditional Visibility ... more frustrations :/

Messages
95
Country
ireland
Hi folks,

I've created a DME device for my panel. The distance and speed readouts display correctly etc. When there is no DME signal present on the tuned nav frequency the display should change to a dash in place of each digit. I am doing this by using dummy nodes with the visibility code attached. One node has the distance and speed readouts childed to it and the other has the dashes childed to it. The dashes display perfectly correctly when there is no DME signal present, here's the code for the dashes....

Code:
<PartInfo>
  <Name>L200_DME_signal_no</Name>
    <Visibility>
    <Parameter>
    <Code>
            (L:L200_DMEknob2, bool) 1 ==
            (L:L200_RadioMasterSW, bool) 1 ==
            (A:ELECTRICAL MASTER BATTERY, bool) 1 ==
            (A:NAV HAS DME:1, bool) 0 ==
            and
            and
            and
            if{ 100 } els{ 0 }
    </Code>
    </Parameter>
    </Visibility>
</PartInfo>

Note: L200_DMEknob2 is the DME unit power knob. L200_RadioMasterSW is the radio master switch (duh!).

Now, here's the perplexing problem I'm having.....
When there is a DME signal present I want the distance and speed to show instead of the dashes, here's the code I have for this.... as you can see, there is only one change from the working code above, yet this simply refuse to work. WHY ??????
I've reset XForm mulitple times on each node, also had it in the root of the parts hierarchy and childed it to the panel etc.

Code:
<PartInfo>
  <Name>L200_DME_signal_yes</Name>
    <Visibility>
    <Parameter>
    <Code>
            (L:L200_DMEknob2, bool) 1 ==
            (L:L200_RadioMasterSW, bool) 1 ==
            (A:ELECTRICAL MASTER BATTERY, bool) 1 ==
            (A:NAV HAS DME:1, bool) 1 ==
            and
            and
            and
            if{ 100 } els{ 0 }
    </Code>
    </Parameter>
    </Visibility>
</PartInfo>


While I'm on the subject of DMEs, has anybody got a code example to effect the 'Time To Go' or 'Minutes' readout ?

Many thanks for any help, suggestions or sympathy :)

Skip
 
Last edited:
Rather than make more than 1 LCD screen you use the same method but in the DME script. This has less draw to the sim overall.

Here is a quick sample i put together and is exactly like what you have but in a string format for the original LCD.
This allows you to adjust the size of each text and update at once. This is not tested but should work with text out of sink. Also this is setup for nav 2.
Code:
<!--             Nav has Nav          -->
  <Element>
     <Position X="203" Y="0"/>
<Visible>(A:NAV HAS DME:2, bool) 1 ==</Visible>
     <Text X="196" Y="14" Length="6" Fixed="Yes" Font="quartz" Adjust="Left" VerticalAdjust="Top" Color="#FF5500" Bright="YES">
        <String>%((A:Nav active frequency:2,Megahertz))%!7.3f!</String>
     </Text>
     <Failures>
       <GAUGE_COMMUNICATIONS Action="NoDraw"/>
       <SYSTEM_ELECTRICAL_AVIONICS Action="0"/>
        <GAUGE_NAVIGATION_VOR1 Action="Freeze"/>
     </Failures>
  </Element>

<!--             No Nav          -->
  <Element>
     <Position X="203" Y="0"/>
<Visible>(A:NAV HAS DME:2, bool) 0 ==</Visible>
     <Text X="196" Y="14" Length="6" Fixed="Yes" Font="quartz" Adjust="Left" VerticalAdjust="Top" Color="#FF5500" Bright="YES">
        <String>---.--</String>
     </Text>
     <Failures>
       <GAUGE_COMMUNICATIONS Action="NoDraw"/>
       <SYSTEM_ELECTRICAL_AVIONICS Action="0"/>
        <GAUGE_NAVIGATION_VOR1 Action="Freeze"/>
     </Failures>
  </Element>
 
as you can see, there is only one change from the working code above, yet this simply refuse to work. WHY ??????

Hi Skip and DG,

Are you aware that (A:NAV HAS DME:1, bool) returns -1 or 0?* Not all FS bools are either 0 or 1.

I know you're doing 3D gauge modeling, but this is another example where a debugging tool like Blackbox can quickly point out whats going on and save you a lot of time and frustration - BB3 will show you those (or any) A:Vars very easily.

For the Minutes calc, depends on how quick and simple you want it, but there are A:Vars for DME distance and DME speed, so a little arithmetic will give you time, taking care to note if you are going To or From.

BTW, gotta say again how good that RMI of yours looks. Wish I could produce such great graphics.

Bob

* FS9 and FSX, so prob same for P3D
 
Last edited:
Hi Bob,

Thanks for that info. Some months back I asked on here about a 'test gauge' and so I became aware of BB3. I couldnt for the life of me get it working, it wasnt the software at all, apart from me being dumb as a stump sometimes, but with all respect to the author, I felt the instructions were very scant and assumed the user was expert level. I did get some windows up on screen showing default parameters but I hadn't a monkey's notion how to change things for my needs. I still would like to get it going sometime.

OK on the minutes calculations, I just thought there might be some additional info... the TO / FROM consideration being one :).

Thanks for your comments re the RMI render Bob, I'll put one up later of the DME unit.

SKip
 
Nav has DME, use to throw me off years ago. I do use a test window but only when i am working on my own projects. But i still forget when i am just freshly writing a script. So i always post it has not been tested on these forums.
 
I felt the instructions were very scant and assumed the user was expert level.

Hehehe, my son wrote the software, I wrote the user instructions, and up til now all the feedback I got was that the instructions were too pedantic. :p There are many BB3 users out there; not all/many are expert level.

I reviewed BB3 setup also in the pm I sent you related to your other thread (the Test Gauge one) a few months ago. And I saw your very good point about 3D gauges and BB3 (which was written with 2D in mind simply because I have never done 3D), but BB3 ships with a file called simulation variables.xml which is a list of all of the A:Vars (FS9 syntax but it works in FSX and P3D). Open that file in BB3 and choose any A:Var you want to see.

Tom's XMLTools can monitor L:Vars from 3D gauges but takes additional work to see A:Vars. That suite of tools is evolving so keep an eye out for future updates. XMLTools does a whole lot more than monitoring variables. For me, it's indispensable.

If you want more help using BB3 to see A:Vars, shoot me a pm and we can get it working.

Bob
 
This code from the VC10 places a yellow bar across the numbers if there is no signal or avionics power.
Code:
<Element>
      <Position X="26" Y="23"/>
    <Select>
         <Value>(A:CIRCUIT GENERAL PANEL ON, bool) if{ (A:NAV1 DME, nmiles) } els{ 0 }</Value>
         <Case Value="0">
            <Image Name="DME_OFF.bmp" Luminous="1"/>
         </Case>
      </Select>
   </Element>
 
Hey guys, many thanks for your help. The '-1' is what made it work (Boolean ??).

Vololiberista, thanks for that code too... I already have something like that working for the DME readout on my HSI and it worked everytime, I looked back at the code for that and I'm using... (A:NAV HAS DME:1, bool) (without a numerator).
Thanks also to Delivery Guy for your valued help.

Bob.. hahaha.. I told you I could be dumb as a stump ! I remember our PMs now ... too much going on in my head since then I guess :rolleyes: . However I will endeavour to get BB3 working today. If I have a problem I'll PM you...... again ! :)

Many thanks indeed for your help.

Skip.

Here's the DME unit......

DME_021.jpg
 
Ever since the FS9 SDK was released, one of the critical things emphasized is that for boolean token variables, the only guaranteed value is zero...

This is precisely why I never test for anything other than zero or not-zero in conditional evaluations:
Code:
(A:var,bool) 0 == if{ xxx }
(A:var,bool) 0 != if{ yyy }
 
This is precisely why I never test for anything other than zero or not-zero in conditional evaluations:

Or you can test it directly, using the pnemonic is it valid?(any number >=1 or <= -1) or is it not valid?(0)

Code:
(A:var,bool) if{ xxx }
(A:var,bool) ! if{ yyy }

Tom
 
I use Tom's approach because it is the clearest to me. Yes (nothing) and no (!).
 
Or you can test it directly, using the pnemonic is it valid?(any number >=1 or <= -1) or is it not valid?(0)
Alternatively, you can also accomplish the task with a single test:
Code:
(A:var,bool)
    if{ xxx }
    els{ yyy }
 
Here's the DME unit......

DME_021.jpg

Very impressive. Your detail and photo-realism are remarkable, Skip. Its gonna be a shame to shrink this down when zoomed out to see the whole panel.

I realize this is off topic and demonstrates my ignorance about 3D gauges, but with a panel full of high-detail 3D like this, is there a big performance trade-off?

Anyway, no answer really needed. I'm sticking with the 2D stuff.

Bob
 
I agree. What a sharp looking instrument. Awesome level of detail.

Bob, I use 2D as well, but project them on 3D parts. 2D all the way. Nice to be able to mod the gauge without having to change the part.


Bill
 
Back
Top