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

FSXA 2D-XML gauges: Update Section & Events

Vitus

Resource contributor
Messages
1,480
Country
newzealand
Hello again,

next issue: some of my triggers refuse to work properly. For instance my "main battery switch":
I defined a custom variable "L:SWITCH MASTER" which is triggered through modeldef.xml code. A invisible gauge is supposed to handle all the complex events related to this variable - debugging is much easier that way, as I don't have to reprocess the hole model after changing in the code.

Here is the code for the hidden gauge:
Code:
[...]
<Update>
  <Frequency>2</Frequency>
  <Script>
    (L:SWITCH MASTER,bool) 0 ==
    if{
      (A:ELECTRICAL MASTER BATTERY,bool) 0 &gt;
      if{
        (>K:TOGGLE_MASTER_BATTERY)
      }
    }
    0 (>K:AVIONICS_MASTER_SET)

    [...]
    }
    els{
      (A:ELECTRICAL MASTER BATTERY,bool) 0 ==
      if{
        (>K:TOGGLE_MASTER_BATTERY)
      }
      1 (>K:AVIONICS_MASTER_SET)

      [...]
    }
  </Script>
</Update>

<UpdateWhenHidden>True</UpdateWhenHidden>

The strange thing is that the avionics master is set correctly, where the status of ELECTRICAL MASTER BATTERY stays "on". I have the same issue with my starter buttons. They don't work as well:

Code:
(L:BUTTON STARTER LEFT,bool) 0 &gt;
if{
  (A:GENERAL ENG STARTER:1,bool) 0 ==
  if{
    (&gt;K:TOGGLE_STARTER1)
  }
}

I hope you can help me with this.

Regards
Vitus
 
Update:
I did some experiments during the last hours and found out that if I code this:
Code:
(L:BUTTON STARTER LEFT,bool) 0 &gt;
if{
  (A:GENERAL ENG STARTER:1,bool) 0 ==
  if{
    (L:TEST,number) ++ (&gt;L:TEST,number)
    (&gt;K:TOGGLE_STARTER1)
  }
}

the L:TEST variable keeps incrementing. I thought that once the starter button is toggled (&gt;K:TOGGLE_STARTER1), the variable A:GENERAL ENG STARTER:1 will be set true. But it seems like this is not the case. If I use a structure like this:
Code:
(L:BUTTON STARTER LEFT,bool) 0 &gt;
if{
  (L:TEST,bool) 0 ==
  if{
    1 (&gt;L:TEST,number)
    (&gt;K:TOGGLE_STARTER1)
  }
}

I am able to start the engine. But that is not a solution because I don't know how and where to reset this variable.

I am sure that the same weird problem is causing the troubles with my master switch...

Suggestions are welcome!
Good night!
Vitus
 
I think I found the solution for that one!

I added every "update-gauge" I use to both, the [Window00] and the [VCockpit01] section of the panel.cfg file. The reason for that was that I don't want to build a 2D panel at all, but on the other hand use the 2D Window to give an optical feedback on whether the gauge was loaded or not.

It turns out that my code actually works if I delete the gauge entry in either section of the panel file. :idea:

Regards
Vitus
 
Back
Top