• 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 Gauges to trigger playing sounds

No

<Keys> and </Keys> are tags like mouse-tags.

Code:
  <Keys>
    <On Key="602">
  
       Code
    </On>

<!-- next Key --
    <On Key="612">
  
       Code  <!-- you can also call a macro -->
    </On>

    <On Event="BRAKES">   <!-- using an event -->
        code
    </On>
  </Keys>
 
Only one program can "own" a keystroke. If another program owns it, FS probably won't see it.
 
Edi thanks! It works :)... yet it won't when FSPassengers is active to which I tried to link the seat belt switch with a FSPassengers seat belt shortcut key.
You can use ANY (unused) Event/A:var combo to check if FS actually ready to execute events.
Like NoSmoking, or Exit events.

A few warnings though about using OnEvent and OnKey trapping:

1. Difference between OnEvent and OnKey
- OnEvent only "monitors" the specified Event; meaning the Event is still executed by FS if you define it in an OnEvent.
- While OnKey actually "intercepts" the keystroke; meaning that if you have tied an Event to that Keystroke in your setup, it won't execute the Event if you define that Keystroke with OnKey.

2. Not all (unused) Event/A:var combo's can be used to check FS ready-ness to receive events at aircraft/flight initialisation.
Example:
Event TOGGLE_AFTERBURNER will only have effect on the A:vars TURB ENG AFTERBURNER:index for the defined engines.
So if the aircraft one has one engine defined, (A:TURB ENG AFTERBURNER:*,bool) will only affect the Avar with *=1; not *=2,3,4

3. Gauge visibility:
- In FS2004, OnKey trapping only works if the xml gauge that implements this OnKey code, is in the currently visible view.
So even if the gauge is defined in a VCockpit** window, OnKey does nothing if you are in e.g. Spotplane view.
Solution: define the gauge in a 2D-window with size 0,0 , and open that window (and keep it forced open) at aircraft/flight load.

- In FSX/P3D, this also applies to OnEvent code.

Rob
 
They are using custom variables for parking brakes so my panel based on the standard won't work.
So they probably use their own Lvar(s) for ParkingBrakes, and act upon that.
To find out which Lvar: download Dougs tool XML-VARs from his website; that displays all Lvars used in the panel/model.

Might be a bit cumbersome to trace: you need to step to the pages of with 20 Lvars each, and note which one changes when you set the Pbrakes in the FSL aircraft.

Rob
 
Thanks guys! It appears Flight Sim Labs also use custom for Exit Open so the standard won't work,

I am using an additional 2D panel to choose from up to 4 available landing and 2000/10000 feet announcements that depend on the knob position. I could also use these knob position LVARS instead of the standard Exit Open & BRAKE PARKING POSITION but it would bring some confusion if one forgets to switch the 2D panel knobs. So I'd better find what FSLabs are using for doors and parking brake. :stirthepo
 
In the Tu-134 aircraft by SCS for FS9 all switches in 2D/VC including Spoilers Handle (L:Interceptor Switch) have the same sound Switch.wav that is enabled through the Sound configuration:

Code:
[Sound]
Enable=true
MasterVolume=0
FilesIni=soundfiles.ini
CTokens=ctokens.lst
XMLTokens=xmltokens.lst
KeyID=keyid.lst

The settings are in the soundfiles.ini as follows:
Code:
[Switch]
file        = Switch.wav
type        = 0
logic        = true
token1        = TURB_ENGINE_1_AFTERBURNER
NumOfTokens     = 1

The INI Help:
Code:
[Section]
Some unique name

File:
      filename.ext

Type:
0     - C token
1     - XML token
2     - L: var

Token[n]:
name of token (see CTokens and XMLTokens in config.ini)

NumOfTokens:
self explain

Expr[n]:
&eq     - equalent
&gt     - greate than
&lt     - lower than

Loop:
      true     - loop sound
      false     - play once (default)

Play:
0    - plain (default)
1    - once
2    - stop

Volume:
      0          - maximum volume (default)
      -10000     - minimum volume

Logic:
      true    - boolean (expr ignore)
      false     - Expr using (default)

External:
      true    - play at external camera view
      false    - play only in cockpit and virtual cockpit (default)

NameOfFlag:
Name of L:var to set then sound played

ResetFlag:
Name of L:var to reset then sound played

CheckFlag:
Name of L:var to check if it already played. If not, sound not be play
Also used are: checkflaginv and stopfile (stops playing a specified ,WAV )

I;d like to add my own sound for the 3 position Spoilers Handle only and disable Switch.wav for it. I added the sound with Doug Dawson's Sound Gauge but I'm out of ideas how to disable the Switch.wav,

It's possible to re-work all the switches & buttons etc. using Doug's gauge but I would like to leave the old sound configuration and change the Spoilers Handle only. Any help would be much appreciated.
 
Last edited:
Could anyone please help me with this expression:
XML:
(A:Gear left position,percent) (A:Gear right position,percent) + near s0 200 == s1 l0 0 == l1 || ! (>G:Var1) 0
What does it mean? It is from a Gear handle 2D panel, 0 is for the center position, -1 gear up, and 1 gear down.
 
If the units are percent, then the value goes from 0 to 100.

I think this says if the opposite (!) of: left gear = 100 and the right gear = 100 or the left gear = 0 and the right gear = 0. So only when the gear is in transit. Then put the value of this logic statement, false = 0, true = nonzero (I don't know what value will be used for true) into the G:Var1 local variable. I assume that a test whether is it equal to 0 will be made later. Then put a 0 onto the stack.
 
Thanks Tom! The code is for 3 gear handle bitmaps values 0 (center) -1 (up), and -1 (down):
XML:
(A:Gear left position,percent) (A:Gear right position,percent) + near s0 200 == s1 l0 0 == l1 || ! (>G:Var1) 0
(A:Gear handle position,percent) 50 &gt; (G:Var1) &amp;&amp; if{ 1 }
(A:Gear handle position,percent) 50 &lt; (G:Var1) &amp;&amp; if{ -1 }
Need to put sounds for the handle in VC/2D same for UP & DOWN and another one for the CENTER. UP & DOWN seem to work:
XML:
(A:Gear handle position,percent) 50 &gt; (L:HandlePrevious,number) 50 &lt; &amp;&amp; if{ 1 (&gt;L:Sound1,enum) }
(A:Gear handle position,percent) 50 &lt; (L:HandlePrevious,number) 50 &gt; &amp;&amp; if{ 1 (&gt;L:Sound1,enum) }
(A:Gear handle position,percent) (&gt;L:HandlePrevious,number)
Don't know how to put it for the CENTER with Sound2. Any tips would be greatly appreciated.
 
Back
Top