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

FS2004 Visibility Click Zones Issue in FS9 Code

Messages
10,088
Country
us-arizona
Hey all,

I have some popup windows in a PFD and MFD set of gauges.

The popups have click zones on them, (touch face screen or TTL's).
But... My 'click zone visibilities arent working. Can you see why? What am I missing?

Code:
     <!-- LIGHTS PAGE -->
      <Area Left="420" Right="470" Top="10" Bottom="80">
       <Visible>(L:3307LIGHTS2 Screen,enum) 0 == </Visible>
         <Tooltip>LIGHTS CONTROL CONSOLE</Tooltip>
            <Cursor Type="Hand"/>
             <Click Repeat="Yes">
        (L:LIGHTS2 PAGE WAKEUP Switch,bool) ! (>L:LIGHTS2 PAGE WAKEUP Switch,bool)
             </Click>
      </Area>

     <!-- LIGHTS PAGE TERMINATE //////////////////////////////////////////// -->
      <Area Left="1385" Right="1450" Top="1" Bottom="74">
          <Visible>(L:3307LIGHTS2 Screen,enum) 1 == </Visible>
         <Tooltip>CLOSE LIGHTS CONSOLE</Tooltip>
            <Cursor Type="Hand"/>
             <Click Repeat="Yes">
        0 (>L:LIGHTS2 WAKEUP Switch,bool)
        0 (>L:3307LIGHTS2 Screen,enum)
        0 (>L:3307LIGHTS2 Time,enum)
             </Click>
      </Area>


     <!-- BATTS PAGE TERMINATE -->
      <Area Left="670" Right="770" Top="10" Bottom="50">
        <Visible>(L:3307BATTS Screen,enum) 1 ==
                      (L:3307FANS Screen,enum) 0 == and
                      (L:3307DRIVES Screen,enum) 0 == and
        </Visible>
         <Tooltip>TERMINATE BATTS PAGE</Tooltip>
            <Cursor Type="Hand"/>
             <Click Repeat="Yes">
        0 (>L:BATTS PAGE WAKEUP Switch,bool)
        0 (>L:3307BATTS Screen,enum)
        0 (>L:3307BATTS Time,enum)
             </Click>
      </Area>

I also have some other visibilities that are under these that bleed through, no matter the visibility on them. If the popup is 'on' the underzone is set to be 'off'.

Perhaps having a visibility with a 0 == on it will not work?? Could that be it? I havent heard of this if this is so.

Sample of a multiple 'off' blocker for a bottom layer click zone with multiple click zones that pop up over it...

Code:
     <!-- AI WINDOW //////////////////////////////////////////// -->
      <Area Left="550" Right="931" Top="0" Bottom="80">
        <Visible>(L:3307BATTS Screen,enum) 0 ==
                      (L:3307DRIVES Screen,enum) 0 == and
                      (L:3307FANS Screen,enum) 0 == and
                      (L:3307LIGHTS2 Screen,enum) 0 == and
       </Visible>
         <Tooltip>SYROS AI</Tooltip>
            <Cursor Type="Hand"/>
             <Click Repeat="Yes">
                  (L:AI WAKEUP Switch,bool) ! (>L:AI WAKEUP Switch,bool)
             </Click>
      </Area>

I have tried this with and without the 'and' inclusions on the visibilities. Do you need 'and' on these?

The popup windows work fine, but the visibility controls that work the click zones are not. Like as though I didnt have them in there.

On the above, the 'Terminate' click zone doesnt show up. All click zones that are supposed to be 'off' if this is 'on' still show through the clickzone of the 'active layer'. :(
 
Messages
1,564
Country
thailand
Yeap... try working with "number" units for custom variables


That won't make a difference in this case. L:Vars are double precision regardless of units, and enum and number units are both associated with a 1:1 conversion factor (no conversion). So for Bill's Screen L:Vars, it wouldn't make any difference to <Visible> if the units were number or enum.

All of these are the same to the sim:

XML:
123.45678 (>L:Var, number)
123.45678 (>L:Var, enum)
123.45678 (>L:Var, bool)
123.45678 (>L:Var, puppies)
123.45678 (>L:Var)


The correct choice of units is important when the L:Var represents one of the Sim's unit categories associated with a non-1:1 conversion factor (e.g., Volume, Frequency, Time, etc), which is most of them. For a variable like that, it's better to use the specific unit rather than 'number'.

Additional discussion here and here.

Bob
 
Last edited:

Heretic

Resource contributor
Messages
6,830
Country
germany
1) Are your mouse areas wrapped in a single "<Mouse>" tag?

2) Try <Click Kind="LeftSingle">. This defines the mouse button(s) to use. "<Click Repeat="Yes">" is not needed for simple toggle switches anyway.
 
Messages
10,088
Country
us-arizona
1) Are your mouse areas wrapped in a single "<Mouse>" tag?

2) Try <Click Kind="LeftSingle">. This defines the mouse button(s) to use. "<Click Repeat="Yes">" is not needed for simple toggle switches anyway.

Its a PFD gauge (tons of gauges in it, and click zones on the face screen)
Multiple layers of click zones in the overlapping area's. Visible zones required. Visible zones not working.
Multiple layer Visible zones.


This is the first time I have used 'multiple' click zones in single Area click zone code blocks., such as 4 and 5 'Visibles' requiring to be off and one on for the click zone to be 'visible' by Meeshki.
 
Messages
1,564
Country
thailand
Its a PFD gauge (tons of gauges in it, and click zones on the face screen)
Multiple layers of click zones in the overlapping area's. Visible zones required. Visible zones not working.
Multiple layer Visible zones.


This is the first time I have used 'multiple' click zones in single Area click zone code blocks., such as 4 and 5 'Visibles' requiring to be off and one on for the click zone to be 'visible' by Meeshki.

See if this discussion applies to your gauge.

Bob
 
Messages
10,088
Country
us-arizona
Additional discussion here and here.

Bob

Bob, I read through both those posts. I tried the ! over the 0 and that didnt work with Visible's in click zones. Just experimented with it.

I have a bottom layer click zone that should turn off when the above layer click zone (2nd) becomes active. The bottom should be awake when its off, but when the upper becomes active, it should go dormant. I have tried different ways to do this. The system is on a timer. (That might be a reason also, timers are used).

Code:
     <!-- GPS CENTER //////////////////////////////////////////// -->
      <Area Left="320" Right="400" Top="0" Bottom="75">
                <Visible>(L:3307LIGHTS2 Screen,enum) 0 == </Visible>
         <Tooltip>GPS</Tooltip>
            <Cursor Type="Hand"/>
             <Click Repeat="Yes">
        (L:GPS CENTER WAKEUP Switch,bool) ! (>L:GPS CENTER WAKEUP Switch,bool)
             </Click>
      </Area>

If I use 0 it shows up. If I use ! it renders the click zone invisible always on the above click block.


So I have an idea... I'll create a 'system' that is a layers flag system. 1 set of Enums for the ENTIRE bunch of pages/layers.

(L:CLICK ZONES ACTIVE LAYER SYSTEM,enum) 0 // First level click zones, main surface of PFD
(L:CLICK ZONES ACTIVE LAYER SYSTEM,enum) 1 // Second layer, 1st page of all pages
(L:CLICK ZONES ACTIVE LAYER SYSTEM,enum) 2 // Third Layer (etc) of 2nd pages of all pages... weather GPS or Weather or Lights or Messages, etc. All second pages would use this visibility. This way there is only '1' enum for Visible to rely on in the gauge.

Pray for me...
 
Messages
10,088
Country
us-arizona
See if this discussion applies to your gauge.

Bob

Close, but no. I need on/off, not area (realestate). Good find though. I could never understand those. I need to learn it.

By the way, Bill, you're ahead of the curve with your Blade and Syros. I assume you're adding wheels to them?

Bob

Thanks. The reason I got into this (making planes for FS) was to see what my designs look like in 3d. Its been great fun. I have so many I want to do. But I need to make a living. I need to get that Fokker 100 done. Still need to make the gauges for her.
 
Messages
10,088
Country
us-arizona
scroll down to #7 in that thread

That explains why mine crashed back on the Kodiak / Epic LT PFD. What a mess.

For me, I need Visible to work with enums and in the same zones. No alternative zones. They overlap, so they are shared zones. Meaning, I have a totally different page with gizmo's show up over the surface layer that have all new click zones. And I have several of those. Presently I have a stack of Visible calls. If this is on but this and this and this and this are off, then you can click. Tons of those. Well not tons.. But a lot.

You did say 3 though.. That you found you might be able to do more then 3 nests, that it was formerly known as a limit. I am using 4+, so that might also explain it, but even with 2, I am only reading one visible.
 
Messages
10,088
Country
us-arizona
The ongoing mystery continues... More research...

I tried my idea on a primary 'Layer' enum system that goes off as a flag for all other first layer and second layer click zones and pages.

Didnt work.

Example;

Code:
// below, primary first layer screen, enum is 0, clicks fine.
<!-- LIGHTS PAGE -->
      <Area Left="420" Right="470" Top="10" Bottom="80">
       <Visible>(L:TIER CLICK LAYER,enum) 0 == </Visible>
         <Tooltip>LIGHTS CONTROL CONSOLE</Tooltip>
            <Cursor Type="Hand"/>
             <Click Repeat="Yes">
        (L:LIGHTS2 PAGE WAKEUP Switch,bool) ! (>L:LIGHTS2 PAGE WAKEUP Switch,bool)
             </Click>
      </Area>

// below, secondary layer, popup page is active, enum = 1, this click zone doesnt show up.  The above click zone shows up (can tell by the tooltip).
So its not working in both above and below.  Could this be a V4 issue?
     <!-- LIGHTS PAGE TERMINATE //////////////////////////////////////////// -->
      <Area Left="390" Right="430" Top="1" Bottom="74">
          <Visible>(L:TIER CLICK LAYER,enum) 1 == </Visible>
         <Tooltip>CLOSE LIGHTS CONSOLE</Tooltip>
            <Cursor Type="Hand"/>
             <Click Repeat="Yes">
        0 (>L:LIGHTS2 WAKEUP Switch,bool)
        0 (>L:3307LIGHTS2 Screen,enum)
        0 (>L:3307LIGHTS2 Time,enum)
             </Click>
      </Area>

// this code below the above ones should turn off when the above is active.  It doesnt.  If a layer is a
active, then its enum,1.  The below code should only be visible when its enum,0.  It
is clickable through the above popup layer.  Same for the above popup layers start
up button...
// enum = 0 means its a first tier, first layer 'active'.  Doesnt work.
     <!-- GPS CENTER //////////////////////////////////////////// -->
      <Area Left="320" Right="400" Top="0" Bottom="75">
                <Visible>(L:TIER CLICK LAYER,enum) 0 ==</Visible>
         <Tooltip>GPS</Tooltip>
            <Cursor Type="Hand"/>
             <Click Repeat="Yes">
        (L:GPS CENTER WAKEUP Switch,bool) ! (>L:GPS CENTER WAKEUP Switch,bool)
             </Click>
      </Area>

I dont know if I put this out there already, that ! will not work (on my rig, in FSX/P3D) with enum's. I also took out the 'and' in the visible stacks.

Out of idea's... :(

Bill
 
Messages
10,088
Country
us-arizona
oops... I forgot a line. Working. I was testing in Drives page and now Lights page, forgot my activator for Tier control.

Going well now. :D Will report back.
 
Messages
10,088
Country
us-arizona
Ok... Got it working....

This is what needs to be done when you are having issues with mouse layer click zone visibilities. At least for me, this is what was needed.

I had a stack of all these different strings for visible codes, all different names, 1 to 5 or more in a stack in each Visible section for click zones.

So what I did is implement an extra on/off L:Var that is a enum Layer system. Meaning, I made one single string for all visible click zones. Unified single click zone ident system. I'll call it the Layer Ident system. (Pages are Layers where click zones are referred to. The page 'above' the original base page is a 'new' click zone. Page 4 above page 0 would be a new click zone, etc, etc).

At first this didnt work as I had only one main Layer number for ALL click zones. When I had one single Layer number (enum) for everything in the PFD screen, then 'everything' that was Layer 2 was 'active' to click, (all pages that were level 2). Couldnt use that... Worthless... So I changed it to enum 1, 2, 3, 4, 5, 6... Then when you close out the click (a terminate button), then you also include the shut down of the Layer enum.

Samples....

Code:
// timer activated page, disappears after a while

     <!-- Start timer and increment when both battery and avionics are ON -->
    <Element>
       <Select>
        <Value>
        (L:DRIVES PAGE WAKEUP Switch,bool) 1 == (L:3307DRIVES Time,enum) 250 &lt;= and
        if{ (L:3307DRIVES Time,enum) ++ (>L:3307DRIVES Time,enum) 1 (>L:3307DRIVES Screen,enum)
                             7 (>L:TIER CLICK LAYER,enum) } // this is the layer activater
        </Value>
       </Select>
    </Element>

// above, 7 is the Layer for this pages click zone code or ident

// note below, your main turn on for Drives page is Layer 0 ident, this opens the page
     <!-- DRIVES PAGE -->
      <Area Left="650" Right="900" Top="120" Bottom="370">
        <Visible>(L:TIER CLICK LAYER,enum) 0 == </Visible>
         <Tooltip>DRIVES PAGE</Tooltip>
            <Cursor Type="Hand"/>
             <Click Repeat="Yes">
        (L:DRIVES PAGE WAKEUP Switch,bool) ! (>L:DRIVES PAGE WAKEUP Switch,bool)
             </Click>
      </Area>

// below, note that visible is Layer 7 ident
     <!-- DRIVES PAGE TERMINATE -->
      <Area Left="950" Right="1075" Top="10" Bottom="50">
        <Visible>(L:TIER CLICK LAYER,enum) 7 == </Visible>
         <Tooltip>TERMINATE DRIVES PAGE</Tooltip>
            <Cursor Type="Hand"/>
             <Click Repeat="Yes">
        0 (>L:DRIVES PAGE WAKEUP Switch,bool)
        0 (>L:3307DRIVES Screen,enum)
        0 (>L:3307DRIVES Time,enum)
        0 (>L:TIER CLICK LAYER,enum)
             </Click>
      </Area>
// note in the bottom of the code, Layer 7 ident is changed to 0 turning off that click zone


My list (so far) of pages with Layer idents is;
LIGHTS2 Screen........1
CHECKLIST CENTER Screen........2
AIScreen........3
MESSAGE1 Screen........4
BATTS Screen........5
FANS Screen........6
DRIVES Screen........7

My Updates to make sure they flip back to zero (just in case) is
<Update>
(L:3307LIGHTS2 Screen,enum) 0 ==
(L:3307CHECKLIST CENTER Screen,enum) 0 == or
(L:3307AIScreen,enum) 0 == or
(L:3307MESSAGE1 Screen,enum) 0 == or
(L:3307BATTS Screen,enum) 0 == or
(L:3307FANS Screen,enum) 0 == or
(L:3307DRIVES Screen,enum) 0 == or
if{ 0 (>L:TIER CLICK LAYER,enum) }
</Update>

I probably do not need the update. I added it when I had a issue and didnt test to remove, leaving it there as its working fine.

Hope that helps others. Click zone visibilities seem to be moody. :S
 
Messages
10,088
Country
us-arizona
So that you see how the entire page 'boots up' and remains on for a timed session (totally different from the subject of click zones, but shows you why I have these odd other codes in there), this is how it is shown in the gauge.

Code:
  <!--  DRIVES MOTORS PAGE  ========================================= -->
  <!--  DRIVES MOTORS PAGE  ========================================= -->
  <!--  DRIVES MOTORS PAGE  ========================================= -->
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

<!-- DRIVES SCREEN -->
     <!-- Initialize all variables when power is OFF -->
    <Element>
       <Select>
        <Value>
        (L:DRIVES PAGE WAKEUP Switch,bool) 0 == if{
        0 (>L:3307DRIVES Screen,enum)
        0 (>L:3307DRIVES Time,enum) }
        </Value>
       </Select>
    </Element>

     <!-- Start timer and increment when both battery and avionics are ON -->
    <Element>
       <Select>
        <Value>
        (L:DRIVES PAGE WAKEUP Switch,bool) 1 == (L:3307DRIVES Time,enum) 250 &lt;= and
        if{ (L:3307DRIVES Time,enum) ++ (>L:3307DRIVES Time,enum) 1 (>L:3307DRIVES Screen,enum)
                             7 (>L:TIER CLICK LAYER,enum) }
        </Value>
       </Select>
    </Element>

     <!-- Stop timer after 20 seconds -->
    <Element>
       <Select>
        <Value>
                            (L:3307DRIVES Time,enum) 160 > if{ 0 (>L:3307DRIVES Screen,enum) }
        </Value>
       </Select>
    </Element>

     <!-- Reset Wakeup when timer is turned off -->
    <Element>
       <Select>
        <Value>
                            (L:DRIVES PAGE WAKEUP Switch,bool) 1 ==
        (L:3307DRIVES Time,enum) 160 > and
                                  if{ 0 (>L:DRIVES PAGE WAKEUP Switch,bool) }
        </Value>
       </Select>
    </Element>

     <!-- While the "bootscreen" variable is ON and battery is ON, display the bootscreen bitmap -->
    <Element>
        <Visible>(L:3307DRIVES Screen,enum) 1 == </Visible>
                               <Position X="0" Y="0"/>
        <Image Name="BackgroundPopUpFullScreen.bmp" ImageSizes="1500,681" Bright="Yes">
        </Image>
    </Element>
    <Element>
        <Visible>(L:3307DRIVES Screen,enum) 1 == </Visible>
                               <Position X="409" Y="0"/>
        <Image Name="DrivesPage.bmp" ImageSizes="681,681" Bright="Yes">
        </Image>
    </Element>


And this is the mouse click zones;

Code:
     <!-- DRIVES PAGE -->
      <Area Left="650" Right="900" Top="120" Bottom="370">
        <Visible>(L:TIER CLICK LAYER,enum) 0 == </Visible>
         <Tooltip>DRIVES PAGE</Tooltip>
            <Cursor Type="Hand"/>
             <Click Repeat="Yes">
        (L:DRIVES PAGE WAKEUP Switch,bool) ! (>L:DRIVES PAGE WAKEUP Switch,bool)
             </Click>
      </Area>

     <!-- DRIVES PAGE TERMINATE -->
      <Area Left="950" Right="1075" Top="10" Bottom="50">
        <Visible>(L:TIER CLICK LAYER,enum) 7 == </Visible>
         <Tooltip>TERMINATE DRIVES PAGE</Tooltip>
            <Cursor Type="Hand"/>
             <Click Repeat="Yes">
        0 (>L:DRIVES PAGE WAKEUP Switch,bool)
        0 (>L:3307DRIVES Screen,enum)
        0 (>L:3307DRIVES Time,enum)
        0 (>L:TIER CLICK LAYER,enum)
             </Click>
      </Area>


Now, the page turns off automatically, but you can turn it off ahead of time using the 'Terminate' button zone. To change the timer section, in this sample, you change '160'. I have no idea how many seconds that is. 220 is a while, 160 seems like 5 long seconds. You do not need the Terminate button. I wanted that as a feature and option.
 
Messages
10,088
Country
us-arizona
Now, excuse me as I go climb up on my desk and disco dance for a bit in celebration of getting this dang thing working... lol.. .
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
To change the timer section, in this sample, you change '160'. I have no idea how many seconds that is. 220 is a while, 160 seems like 5 long seconds. You do not need the Terminate button. I wanted that as a feature and option.
Bill, the gauge updates at approximately 18 Hz, so 220 / 18 = ~12 seconds. Similarly, 160 / 18 = ~9 seconds.

Normally I will work the other way around, and simply calculate the number needed for a given number of seconds. For example, 5 x 18 = ~90... :teacher:
 
Top