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

FSX Park brake set and Signs on

Messages
31
Country
germany
Hi,

as I cannot convince FSX with any trick to start the simulation with Park brake set and Signs on, I like to create a gauge that does it in all planes.

Unfortunately, I could not find any key that commands what I want.

(>K:PARKBRAKE_SET), (>K:SIGNS_ON), (>K:NO_SMOKING_ON) (>K:SEATBELT_ON) etc. does not exist and therefore doesn't work. I tried (>K:CABIN_SEATBELTS_ALERT_SWITCH_TOGGLE) and (>K:CABIN_NO_SMOKING_ALERT_SWITCH_TOGGLE) with no success.

Any suggestions?

Thanks and regards, Fritz
 
This is the very most basic trick in the book. Load your favourite aircraft, configure it as cold and dark as you need, then save the flight as the default flight. Any airplane will from then on be loaded according to the configuration in your new default flight.
 
For the seat belt and smoking signs, if the panel maker's gauges don't use the default FS variables (but instead use custom L: variables) there is no way to have these preset using a saved flight short of recoding the gauge. The only way I know to do that is to use Doug Dawson's CFG gauge (assuming you can find the L: variables used).
 
Fritz,

In general, you can load ANY aircraft in ANY state that you want for ANY feature; meaning it's in the state you prefer after a flight/aircraft is loaded and ready to fly.
By means of an initialisation gauge.

But there's a lot a things you need to understand about initialisation of a flight/aircraft ...

1. You need to make a distinction beween features controlled by a custom event/var or standard FSX events/vars.
A feature controlled by an (non-standard) Lvar always starts up with the Lvar set to 0; Lvars are NOT stored in saved flight files, so (if other then 0) you need to initialise them to a specific value. See also Tom's reply.
The rest below applies to the standard FSX features (events/vars).

2. The state of some standard FSX features are saved in a saved (or default) flight file, some others are not.
Examples:
- The state of ParkingBrakes IS saved in a saved flight; so if you load an aircraft (in a current flight), or load a previously saved flight, the actual (c.q. saved) state is set.
- Features like NoSmoke, Seatbelt, Exit, etc have NO saved state; meaning that after flight/aircraft load their state is always 0 (Closed, Off, etc).
But in all cases you can initialise them as you like, by means of using the proper FSX events/vars in an initialisation gauge.

3. If you are using an initialisation gauge to force a feature in a certain state, be aware that some standard FSX features have _ON and _OFF event variations, some only have a _Toggle event (meaning you first have to test the current state before issueing a _Toggle event.).
AND: realise that some events only exist in FSX_Accell, NOT in FSX-SP2 or earlier. You need to check the SDK for that and for their existance at all (like (>K:NO_SMOKING_ON) is simply a non-existing event, as you already stated)

4. If the above is clear:
There's an initialisation-timing problem in FSX, causing events issued from an initialisation gauge NOT to be acted upon by FSX.
See this thread ....
http://www.fsdeveloper.com/forum/threads/fsx-ignores-events-at-flight-loading.429672/
Meaning that FSX may simply ignore an event issued from an already initialised and running gauge during initialisation of the aircraft/flight.


Now, to give you an example how to force the ParkingBrakes ON at aircraft/flight load, irrespective how you start FSX and which flight/aircraft you load (provided ParkingBrakes are enabled in the aircraft.cfg of course), add this gauge to the panel.cfg for all aircraft you want:
Code:
<Gauge Name="Initialisation" Version="1.0">

<Update Frequency="6"/>

<Element>
  <Select>
    <Value>
(* Uses the SeatBelt feature, always 0 at load,  to detect if FSX is ready to receive events *)
      (L:FSXReadyToReceiveEvents,bool) !
       if{
          (&gt;K:CABIN_SEATBELTS_ALERT_SWITCH_TOGGLE)
          (A:CABIN SEATBELTS ALERT SWITCH,bool)
          if{ 1 (&gt;L:FSXReadyToReceiveEvents,bool) }
       }
       els{
(* aircraft initialisation, executed once only *)
          (L:AircraftInitialisation,bool) !
          if{
             (A:BRAKE PARKING POSITION,bool) ! if{ (&gt;K:PARKING_BRAKES) }
              (* other things to initialise *)
              1 (&gt;L:AircraftInitialisation,bool)
          }
        }
      </Value>
  </Select>
</Element>

</Gauge>

You can now use Lvar (L:AircraftInitialisation,bool) in any gauge (code) in the panel.cfg, to make sure that all aircraft features (under your control) are in a defined state after load....
No matter in what situation the flight/aircraft is loaded ....

Rob
 
Okay guys, thanks for your thoughts and code.

My FSX is installed in C:\FSX. Is that an issue?

@Heretic: The very most basic trick in the book doesn't work with my installation. I researched and tried all options, but FSX will not start with parking brake on.

@tgibson (Tom): You refer to the DSD xml config - right? How could this help (which code)?

@rcbarend (Rob): Thanks a lot for your explanations and code. Unfortunately, your code is not recognized by my FSX and I don't know why.

I put your input in three little gauges:

Code:
<Gauge Name="Seatbelt on" Version="1.0">
    <Update Frequency="2"/>
    <Element>
        <Select>
            <Value>
            (L:FBH_FSX_INIT,bool) !
            if{
            (>K:CABIN_SEATBELTS_ALERT_SWITCH_TOGGLE)
            (A:CABIN SEATBELTS ALERT SWITCH,bool)
            if{ 1 (>L:FBH_FSX_INIT,bool) }
            }
            </Value>
        </Select>
    </Element>
</Gauge>

Code:
<Gauge Name="No Smoking on" Version="1.0">
    <Update Frequency="2"/>
    <Element>
        <Select>
            <Value>
            (L:NO SMOKING,bool) !
            if{
            (>K:CABIN_NO_SMOKING_ALERT_SWITCH_TOGGLE)
            (A:CABIN NO SMOKING ALERT SWITCH,bool)
            if{ 1 (>L:NO SMOKING,bool) }
            }
            </Value>
        </Select>
    </Element>
</Gauge>

Code:
<Gauge Name="Park Brake set" Version="1.0">
    <Element>
        <Select>
            <Value>
            (A:BRAKE PARKING POSITION,bool) !
            if{
            (>K:PARKING_BRAKES)
            (A:PARKING_BRAKES,bool)
            if{ 1 (>L:BRAKE PARKING POSITION,bool) }
            }
            </Value>
        </Select>
    </Element>
</Gauge>

The test results are:
1. Seat belts and No smoking signs turn on for about a second and go off again.
2. The flight (plane) starts with Park Brake set, but I cannot release the parking brake any more.

I'm keen to receive your feedback.
 
The very most basic trick in the book doesn't work with my installation. I researched and tried all options, but FSX will not start with parking brake on.

It certainly does for me on my default flight.

You refer to the DSD xml config - right? How could this help (which code)?

XMLConfig comes with a readme which explains everything. It's not hard to use.


Also, you must have misunderstood Rob about what his code is supposed to do. The seatbelt switch is just present because of item #4 in his post (code not being executed during aircraft load). So...

Code:
<Gauge Name="Init" Version="1.0">
<Update Frequency="2"/>
<Element>
<Select>
<Value>
(L:FBH_FSX_INIT,bool) !
if{ 
(>K:CABIN_SEATBELTS_ALERT_SWITCH_TOGGLE)
(A:CABIN SEATBELTS ALERT SWITCH,bool)
if{ 

(A:CABIN NO SMOKING ALERT SWITCH,bool) !
if{ (>K:CABIN_NO_SMOKING_ALERT_SWITCH_TOGGLE) }
(A:PARKING_BRAKES,bool) !
if{ (>K:PARKING_BRAKES) }


1 (>L:FBH_FSX_INIT,bool) } }
</Value>
</Select>
</Element>
</Gauge>
 
Heretic

I don't know why, but this is my 4th FSX installation on the 4th gaming PCs in the row and I was never able to get the start flight up with parking brake on. I have FSX Professional with SP 1 and SP2. I have given in with this installation now.

But now, with your INIT gauge this has changed!!! The flight comes up with parking brake set and I can release it.

The flight also starts with seat belt on for about a second and than off. The Non smoking sign gets illuminated after that and stays on. I cannot see really why - looking at your gauge, but could the if - if might be the cause?

Thanks for helping me so much!
 
For your seat belt problem, try moving the ! from this line:

(A:CABIN NO SMOKING ALERT SWITCH,bool) !

to the line with the same variable without the !. So instead of not ! and then !, make it ! and then not !.
 
For your seat belt problem, try moving the ! from this line:

(A:CABIN NO SMOKING ALERT SWITCH,bool) !

to the line with the same variable without the !. So instead of not ! and then !, make it ! and then not !.
...or:
Code:
(A:CABIN NO SMOKING ALERT SWITCH,bool) 0 ==
 
Hi Fritz,

To make sure you fully understand my Initialisation gauge example... (it DOES work)....
The first part just keeps toggling the seatbelt, untill the gauge reads a change to 1 in its var .
Because the seatbelt var always starts up as 0, so when 1 is read, you are sure fsx is actually ready to process events.
By the way,you can use any other function in fsx to do this, as long as it has a defined startup state (so independant how the aircraft is loaded or the state in a previous ,flight or saved flight. The seatbelt function is just a convenient one, and is only temporarily used to establish fsx readiness for events.
After that, you can use the sealbelt function again for its normal purpose.

The second part is executed only once, and contains those things you want to force on/off/set when the aircraft loads.
Of course you can split the gauge into multiple gauges if you want, but I usually dont, because most of my gauges run at the max schedule frequency.
For the Init gauge there is no need to; in fact its better to run it at a low schedule frequency (1 or 2 tmes per sec).
See next point ...

Its also good to realise the following limitation in fsx....
Normally, if you issue an event in a XML gauge, you can read the result in the related a:var in the next schedule of the gauge.
However, this is not guaranteed ...! And depends o.a. on the framerate of fsx when flying.
Especially when you run the gauge at the max freq. (every 55 msec, 18.2 times per sec) and framerate drops below 16 or so, this limitation becomes apperant.

Rob
 
Last edited:
Thanks again for your input!

@tgipson (Tom): I read your feedback several times, but I couldn't find a line with the same variable without the !.

@dave hoeffgen (Dave): I tried your code, but it has the same effect: The seat belt sign stays off.

@rcbarend (Rob): I fully understand what your gauge is doing, but in my configuration it doesn't work. The following code should switch on park brake, seat belt sign and no smoking sign upon loading the plane/flight:

Code:
<Gauge Name="Initialisation" Version="1.0">
    <Update Frequency="6"/>
    <Element>
        <Select>
            <Value>
            <Comment(* Uses the SeatBelt feature, always 0 at load, to detect if FSX is ready to receive events *)/>
            (L:FSXReadyToReceiveEvents,bool) !
            if{
            (>K:CABIN_SEATBELTS_ALERT_SWITCH_TOGGLE)
            (A:CABIN SEATBELTS ALERT SWITCH,bool)
            if{ 1 (>L:FSXReadyToReceiveEvents,bool) }
            }
            els{
            <Comment(* aircraft initialisation, executed once only *)/>
            (L:AircraftInitialisation,bool) !
            if{
            (A:BRAKE PARKING POSITION,bool) ! if{ (>K:PARKING_BRAKES) }
            (A:CABIN SEATBELTS ALERT SWITCH,bool) ! if{ (>K:CABIN_SEATBELTS_ALERT_SWITCH_TOGGLE) }
            (A:CABIN NO SMOKING ALERT SWITCH,bool) ! if{ (>K:CABIN_NO_SMOKING_ALERT_SWITCH_TOGGLE) }
            <Comment(* other things to initialise *)/>
            1 (&gt;L:AircraftInitialisation,bool)
            }
            }
            </Value>
        </Select>
    </Element>
</Gauge>

I tested it and nothing happens, even after 45 minutes of waiting. Non of the to be initialised item are turned on by the gauge.

Until I get a code that works, I will continue to operate @Heretic 's gauge, so I have at lest park brake set and no smoking on.

Looking forward to receiving more input. Have a great day all together!
 
I tested it and nothing happens, even after 45 minutes of waiting. Non of the to be initialised item are turned on by the gauge.

Hi,
Nothing happens because the gauge is not being loaded by the sim.

This :

<Comment(* Uses the SeatBelt feature, always 0 at load, to detect if FSX is ready to receive events *)/>

is not a valid command id. Tags like <Element>, <Gauge>,<Update>,<Comment>, etc must be written straight on, with first char in caps. Notice however that (* any comment *) is supported within a text script.

It is a good practice to test that a gauge will be loaded just by dragging the xml file in any browser explorer (Google, MS Explorer, etc). Errors, if any, are going to be displayed by the browser.

Tom
 
Code:
<!-- Blahblahblah, blah, blah
More blah
Less blah
Still blah
-->

This is the way I'm writing comments.
 
Good advice Tom, on how to check the syntax of an xml gauge.
And yes, you are right about the word "comment" in the code, shouldn't be there.

But I guess Fritz never tried a copy/paste of my original example which didn't have that ...;)
And to be sure, just tried my example gauge myself (copy/pasted it) and it DOES work....

Rob
 
Last edited:
I only noticed that the gauge won't load with the comment error. Never checked whether the scripts are valid or not :rolleyes:

Anyway, <Comment> </Comment> structs may be present in any part of the gauge, providing XML syntax rules are respected.

For example:

<Element> <Comment>Any</Comment> <Select>....</Element>
or
<Value/Update> <Comment>Any</Comment> 20 5 * (>L:MyVar,number)</Value/Update>
or even
<Value/Update>20 5 <Comment>Any</Comment> * (>L:MyVar,number)</Value/Update>

Sidenote
----------
When testing gauges, sometimes I use straight on text to remark critical snippets of code, which I remove once tests are finished. I find this method quicker to manage than having to permantly write and delete <!-- --> comments.

For example:

<Value> 20 5 * (>L:MyVar,bool) **should give a positive result** </Value>
or
<Value> 20 5 * (>L:MyVar,bool) should give (100) </Value> (*)
or
<Size X="23" Y="30"/> prev 35 55

(*) Care must be taken writing numbers in brackets or similar to avoid being placed on the stack


Tom
 
Hey Guys,

I'm a beginner in XML programming and still learning. Therefore your input is much appreciated!

@taguilo (Tom): The hint with the browser test is really valuable! In this particular case (initialisation in my version) there is nothing displayed in the browser at all. This is obviously a clear signal for garbage.

@rcbarend (Rob): Sorry I didn't cut and paste it. I did it now and you are fully right, it works! THANK YOU!

@Heretic: Your new code doesn't work either... ;-) Any idea why in your gauge the seat belt sign does not stay on?

Have a great evening all together!
 
I didn't post any new code.

And your seatbelt sign isn't staying on because it's used for checking that the code is ready.
If you had thorougly read Rob's posts on that matter, you would have realized that.

So to have the seatbelt sign siwtch on, you have to add another condition for the seatbelt light switch.

Code:
<Gauge Name="Init" Version="1.0">
<Update Frequency="2"/>
<Element>
<Select>
<Value>
(L:FBH_FSX_INIT,bool) !
if{
(>K:CABIN_SEATBELTS_ALERT_SWITCH_TOGGLE)
(A:CABIN SEATBELTS ALERT SWITCH,bool)
if{

(A:CABIN NO SMOKING ALERT SWITCH,bool) !
if{ (>K:CABIN_NO_SMOKING_ALERT_SWITCH_TOGGLE) }
(A:PARKING_BRAKES,bool) !
if{ (>K:PARKING_BRAKES) }
(A:CABIN SEATBELTS ALERT SWITCH,bool) !
if{ (>K:CABIN_SEATBELTS_ALERT_SWITCH_TOGGLE) }

1 (>L:FBH_FSX_INIT,bool) } }
</Value>
</Select>
</Element>
</Gauge>
 
Heretic,

I have read and fully understood Rob's remarks. Try and test your gauge by your own. The seatbelt sign doesn't stay on, even if called again as in your last update. Maybe it's better to use another condition for the initialization?

Best, Fritz
 
Well, you can still delay gauge initialization with a timer.


Code:
(G:Var1) 90 &lt;=
if{ (G:Var1) ++ 90 min (>G:Var1) }

(G:Var1) 90 ==
if{

(A:CABIN NO SMOKING ALERT SWITCH,bool) !
if{ (>K:CABIN_NO_SMOKING_ALERT_SWITCH_TOGGLE) }
(A:PARKING_BRAKES,bool) !
if{ (>K:PARKING_BRAKES) }
(A:CABIN SEATBELTS ALERT SWITCH,bool) !
if{ (>K:CABIN_SEATBELTS_ALERT_SWITCH_TOGGLE) }

100 (>G:Var1)
}

This will start counting as soon as the plane is loaded and after 90/18 = 5 seconds will run the initialization script.
 
Well, you can still delay gauge initialization with a timer.
......
This will start counting as soon as the plane is loaded and after 90/18 = 5 seconds will run the initialization script.
Sorry, not correct.
This counting in the gauge code starts way before the aircraft is fully "loaded" .
That's the whole problem in aircraft/flight initialisation; one can't predict it because this completely depends on load conditions: starting FSX after a PC reboot (no MS-Windows cache), after loading a new flight within FSX, or re-loading a flight, or (re-)loading an aircraft.

Rob
 
Last edited:
Back
Top