• 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 v4 Gauge Search Priority

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
I received a confirmation from the P3D team that they were not aware that the search priority for gauges had been reversed from ../gauges first, then ../panel.

Now that they know, they have said they will investigate and fix this.
 
As a developper (from a well know company !) , you have access to LM dev team. Could you suggest them to add a simulation variable like "P:Sim_Ready, bool".

As a user with default flight VERY cold, too frequently, I have problems due to initialisation routines running too early !
Most of the time adding one of the suggested trick (from the Wiki) fixes the issue (as long as it is located in an XML gauge).
But would be great to have an officially supported method.

Code:
AIRCRAFT LOAD AND RE-LOAD ISSUES
When an aircraft loads or is re-loaded, gauge script begins running slightly before the sim’s event and trap handling system is operational.  
Consequently, if events are fired as part of an <Update> initialization sequence, event and trap 
errors may occur where the events are apparently not processed, or may seem to be processed incorrectly.

Thanks for reading.

Gérard
 
Osprey has this priority problem, for specific at @rcbarend VTOL gauge that some user put VTOL gauge (old) in gauge folder while new VTOL gauge came with aircraft in panel folder. new VTOL in panel folder not loaded instead load VTOL gauge on gauges folder that make Osprey can't do VTOL
 
That is correct Maryadi. Everyone is so used to the 'old FSX' way of doing things where the ..\panel folder's gauges had priority over the same gauges in the global ..\gauges folder. This paradigm makes sense!

L-M managed to break this and never knew that they did! I now wish I'd asked them several years ago about this issue... :ziplip:
 
That is correct Maryadi. Everyone is so used to the 'old FSX' way of doing things where the ..\panel folder's gauges had priority over the same gauges in the global ..\gauges folder. This paradigm makes sense!
L-M managed to break this and never knew that they did! I now wish I'd asked them several years ago about this issue... :ziplip:
Good to hear that L-M will address this isssue now.
If I read correctly ("" ...I now wish I'd asked them several years ago "" ...) this priority issue isn't specific to P3Dv4, but older (32-bit) P3D versions too ???

Because it would explain a VSTOL gauge problem I had with another user (with P3Dv2) two years ago.
Being unaware of this search order reversal back then, I accidentally discovered that renaming the XML gauge solved the problem for him. (Expecting it to be a "long-filename" problem).
But if this reversal issue (if also applicable to 32-bit P3D version), might very well be the explanation.

Rob
 
Rob... hopefully I've got your attention! :D I read your thread here:

https://www.fsdeveloper.com/forum/threads/fsx-ignores-events-at-flight-loading.429672/

which got me thinking as I don't do XML. However, I think that SimConnect FLIGHT_LOADED should achieve the same... yes/no? Otherwise converting your code to C shouldn't be a problem, although I'm not looking forward to adding the check to each gauge on this project. What I'm finding is that the first couple of ctrl+; during testing work okay, then it all goes to hell in a handcart after that.
 
Rob... hopefully I've got your attention! :D I read your thread here:

https://www.fsdeveloper.com/forum/threads/fsx-ignores-events-at-flight-loading.429672/

which got me thinking as I don't do XML. However, I think that SimConnect FLIGHT_LOADED should achieve the same... yes/no?
I wouldn't know, since I can't program SimConnect directly from XML.
So IF SimConnect (P3Dv4 ??) has such a control, I wonder what it does exactly.
And I'm not even sure if the "initialisation" problem in P3DV4 still exists.
Because what it all boils down to do a proper initialisation for gauge or mdl code: we need a criterium that says that all other gauges and saved-flight data are loaded, all Lvars created (and initialised to 0) and FSX/P3D is ready, before you do your own gauge/mdl initialisation code.
Rob
 
Ummm... the SDK (FSX or P3D) doesn't exactly specify at what point the FLIGHT_LOADED event is put on the data stream. I'm using it to trigger the loading of all saved-flight data, but it doesn't necessarily mean that the gauges haven't already started up. Guess it's time to convert your XML to C and use it as a check before loading/starting anything.
 
That is correct Maryadi. Everyone is so used to the 'old FSX' way of doing things where the ..\panel folder's gauges had priority over the same gauges in the global ..\gauges folder. This paradigm makes sense!

L-M managed to break this and never knew that they did! I now wish I'd asked them several years ago about this issue... :ziplip:

For the same reason, it would also be very useful to know in what order (what is the "priority" rule) the (numerous) gauges (and effect and sound) folders are scanned !
 
My crude method has been to add a thirty second delay in my sound module before it starts 'working' then setting a flag variable indicating that the sound module has completely loaded and that the XML flag variable is set TRUE so that other XML gauges can do their init routine(s).
 
Okay... the C-code version of Rob's XML code. The timer is needed because _TOGGLE calls bounce as if KEY_DOWN is followed immediately by KEY_UP. The timer stops the bounce.

Code:
// Global variable
loadComplete = 0;

--------------------
// Variable lookups
MODULE_VAR sblights = { CABIN_SEATBELTS_ALERT_SWITCH };
MODULE_VAR currtick18 =    { TICK18 };

//---------------------------------------------------------------------------
// Gauge callback
//---------------------------------------------------------------------------
void FSAPI    aircraft_config_update(PGAUGEHDR pgauge, int service_id, UINT32 extra_data)
{
    static double checkTimer = -1;

    switch (service_id)
    {
        case    PANEL_SERVICE_PRE_UPDATE:

            // Check for startup complete
            lookup_var(&sblights);
            if (!sblights.var_value.n && checkTimer==-1)
            {
                send_key_event(KEY_CABIN_SEATBELTS_ALERT_SWITCH_TOGGLE, 0);
                checkTimer = currtick18.var_value.n + 9;
            }
            else loadComplete = 1;

            if (currtick18.var_value.n >= checkTimer)checkTimer = -1;
            (...)

Bill/Arno: is there any point in putting Rob's XML code and this into the Wiki?
 
Bill/Arno: is there any point in putting Rob's XML code and this into the Wiki?

Rob's XML solution is already in the Events and Traps wiki. Scroll down to "Let FS tell you when it’s ready". Your code could be added there, however, it is otherwise an XML wiki, so C users might not find it. Nonetheless, if added to that wiki, at least the code is saved in a topic-related wiki.

Of course, you can always add a C specific wiki, and given the interest shown in this thread, others should find it very useful.

Bob
 
Hello Dai,

I took the liberty of editing the Events and Traps wiki to mention your C version of Rob's method and link it to your post #13, above.

I hope you don't mind, but let me know please.

Bob
 
I don't mind at all. It will be in sd2gau37 too - I wrote it up at about 06.30 this morning, then incorporated into my latest project to be sure it worked! :)
 
LM P3D v4 FIX.

LM P3D version 4.3 now released .
Listed in the fixes is the following
  • Aircraft panel folders will now take priority over global gauges folders.
 
LM P3D v4 FIX.

LM P3D version 4.3 now released .
Listed in the fixes is the following
  • Aircraft panel folders will now take priority over global gauges folders.
L-M were quite surprised when I brought this up a few months ago and emphasized the problems that their inadvertent switch in priority scanning engendered! They promised it would be fixed in v4.3, but of course I was under an NDA and couldn't make the announcement that it was fixed until v4.3 was released. :ziplip:

It is terrific that it has been reverted to proper priority! :cool:
 
Back
Top