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

Auto-open panel

Messages
7
Country
us-texas
I would like to automatically open a panel when an aircraft is loaded. I'm almost successful, except for one condition. When I initially start a flight the panel is not automatically displayed. However, the panel is automatically displayed when I reload the aircraft and when I change aircraft (i.e. initial display of changed aircraft results in successful panel display). So I'm missing the piece that causes the auto-display script to run when I initially start a flight.

The panel I want to display is MISC_POPUP_10.

The trigger gauge is:

Code:
<?xml version="1.0" encoding="utf-8"?>
<Gauge Name="AutoDisplay" Version="1.0">

<Size X = "1" Y = "1"/>

<Update Hidden = "Yes">
  (L:LoadPanel,bool) 0 ==
    if{
      269 (>K:PANEL_ID_OPEN)
      1 (>L:LoadPanel,bool)
      }
</Update>
</Gauge>

In [Vcockpit01] in panel.cfg I have:

Code:
gauge08=AutoDisplay!AutoDisplay, 0, 0

I also tried including the gauge in [Window00] and also tried including the gauge in both [Vcockpit01] and [Window00] at the same time. It works reliably in all circumstances, except for when the flight is initially loaded from the aircraft selection window. Changing aircraft while the sim is running works OK.

Does anyone know what I am missing?

Thanks!

Rick
 
Looks like the update section in the gauge is being evaluated before the sim actually gets around to drawing anything on the screen. When the simulation first starts, you really don't get any promises about the order in which things will start working.
If you wanted, you could give this gauge a try:
http://www.douglassdawson.ca/files/dsd_window_status2.zip
It will tell allow you to know that your add-on window is in fact open.
Alternatively, you could count off some number of gauge updates before you threw the PANEL_ID_OPEN event. A little experimentation would give you a reasonable number that would likely work for most people.
 
Isn't there a setting in panel.cfg that indicates that a window should always open upon load?
 
Visible= 1 only works when loading an a/c in 2D panel mode. For "standard" VC mode starts, AFAIK there is no way to force a 2D subpanel to auto open upon load through panel.cfg property.

Tom
 
Success! Using the suggested solution this script works every time:

Code:
<Update Hidden = "Yes" Frequency="1">
  (L:LoadPanel,bool) 0 ==
    if{
      269 (>K:PANEL_ID_OPEN)
      (>K:CABIN_SEATBELTS_ALERT_SWITCH_TOGGLE)
      (A:CABIN SEATBELTS ALERT SWITCH,bool)
      if{
        1 (>L:LoadPanel,bool)
      }
    }
</Update>

I suspected it was a timing issue. This solution eliminates timing from the equation because instead of counting time it simply waits until it recognizes that it successfully completes an action. Perfect!

Thank you all for taking time to lend your expertise to my question.

Rick
 
Hi,

Thanks, great job.

I've modified it so it doesn't use a K: command (it just waits for one second) and it only opens when in 2D or VC cockpit view (not in spot or tower view). This P: variable doesn't work in FSX; it does work in FS9. You would need to substitute a technique from this thread:

http://www.fsdeveloper.com/forum/threads/detect-cockpit-or-external-view.436149/#post-732741

Code:
<Gauge Name="AutoOpen_10070" Version="1.0">
<Size X="5" Y="5"/>

<Update Hidden = "Yes" Frequency="1">
  (L:LoadPanel_FP,bool) 0 ==  (P:ACTIVE VIEW MODE,enum) 1 == (P:ACTIVE VIEW MODE,enum) 2 == || &amp;&amp;
    if{
      (L:Load_Panel_Counter_FP, number) 1 + (&gt;L:Load_Panel_Counter_FP, number)
      (L:Load_Panel_Counter_FP, number) 1 &gt;
      if{
        10070 (&gt;K:PANEL_ID_OPEN) 1 (&gt;L:LoadPanel_FP,bool)
      }
    }
</Update>

</Gauge>

Hope this helps,
 
Last edited:
Back
Top