- Messages
- 242
- Country

Okiedoke, I am going to preface this by saying that I am a total novice outside of programming some basic XML animations for models in the past, but I will note that I have read the Panels SDK, Doug's documentation for dsd_fsx_xml_sound.gau, and have studied several similar gauges, along with the excellent documentation here, and I've also reviewed several previous threads here including this one. So, I have enough of a basic understanding to know that I should have the basic syntax right, but I am clearly missing something.
The intent is to create a flap handle gauge that plays one of eight samples (in a OneShot fashion) at each flap notch, so that if you were to advance the flaps all the way, for a 737, you would hear eight clicks in sequence. My thought was that this would be a simple matter of creating an element for each notch and telling the sim to play the samples as FLAPS HANDLE PERCENT becomes greater than some value (e.g., 12.5% for the first notch) for each element. I came up with this:
This did not work. I wanted to eliminate the possibility that something was wrong with the INI file, the paths to the samples, or just the way I put things in panel.cfg, so I created a duplicate version of the gauge using the altitude alert code from this thread. The result was this:
This worked perfectly, playing the indicated sample at 2,000 feet on the radar altimeter. When I use Doug's debug and LVars gauges, I can see that all variables specified in my INI file are accounted for in the list, along with all of the associated audio samples. To me, this indicates that the problem is solely in the gauge code. I tried several other iterations, such as just asking it to play when the trailing edge flap percentage passed a certain point:
This did not work either. This tells me that there is something wrong in my syntax at a foundational level. So, my questions are:
I also have plans for a few more gauges, so I might as well ask the big questions for those as well:
How would I go about multiplying volume of a looped sample by some variable? I want to create the following gauges that will require this:
My first instinct is that I would multiply the integer percentages together, one after another, in the stack, then divide by some value to convert the result to a decimal, then multiply this by 10,000, and store it as the VolumeVarIn variable somehow. Is this the right line of thinking? What's the most efficient way to operationalize this? Am I completely off my head on everything?
The intent is to create a flap handle gauge that plays one of eight samples (in a OneShot fashion) at each flap notch, so that if you were to advance the flaps all the way, for a 737, you would hear eight clicks in sequence. My thought was that this would be a simple matter of creating an element for each notch and telling the sim to play the samples as FLAPS HANDLE PERCENT becomes greater than some value (e.g., 12.5% for the first notch) for each element. I came up with this:
Code:
<Gauge Name="NAVS_JT8D_Universal" Version="1.0">
<Element>
<Select>
<Value>
<!-- This code plays Boeing_Flap_00.wav when flaps handle percent passes 12% -->
(A:FLAPS HANDLE PERCENT,percent) 12 >
if{ 1(>L:Boeing_Flap_00, number) }
(A:FLAPS HANDLE PERCENT,percent) (>A:TRAILING EDGE FLAPS0 RIGHT PERCENT,percent)
</Value>
</Select>
</Element>
</Gauge>
This did not work. I wanted to eliminate the possibility that something was wrong with the INI file, the paths to the samples, or just the way I put things in panel.cfg, so I created a duplicate version of the gauge using the altitude alert code from this thread. The result was this:
Code:
<Gauge Name="Altitude" Version="1.0">
<Element>
<Select>
<Value>
(* Play the sound when reaching 2000 feet *)
(A:Radio Height, feet) 2000 >= (L:Altitude, number) 2000 < &&
if{ 1 (>L:Boeing_Flap_00,number) }
(A:Radio Height, feet) (>L:Altitude, number)
</Value>
</Select>
</Element>
</Gauge>
This worked perfectly, playing the indicated sample at 2,000 feet on the radar altimeter. When I use Doug's debug and LVars gauges, I can see that all variables specified in my INI file are accounted for in the list, along with all of the associated audio samples. To me, this indicates that the problem is solely in the gauge code. I tried several other iterations, such as just asking it to play when the trailing edge flap percentage passed a certain point:
Code:
<Gauge Name="NAVS_JT8D_Universal" Version="1.0">
<Element>
<Select>
<Value>
<!-- This code plays Boeing_Flap_00.wav when trailing edge flaps percent passes 12% -->
(A:TRAILING EDGE FLAPS0 RIGHT PERCENT,percent) 12 >
if{ 1(>L:Boeing_Flap_00, number) }
</Value>
</Select>
</Element>
</Gauge>
This did not work either. This tells me that there is something wrong in my syntax at a foundational level. So, my questions are:
- What is preventing my code from working? My read of the code, as I wrote it originally, is that when FLAPS HANDLE PERCENT greater than 12 is TRUE ((A:FLAPS HANDLE PERCENT,percent) 12 >), the audio sample should play once (if{ 1(>L:Boeing_Flap_00, number) }).
- Is my basic idea of creating an element for each flap notch a valid one if my goal is to play a sample at each notch, including multiple samples in sequence when skipping notches? If not, what approach should I take?
I also have plans for a few more gauges, so I might as well ask the big questions for those as well:
How would I go about multiplying volume of a looped sample by some variable? I want to create the following gauges that will require this:
- Gear aerodynamic noise, with volume a function of percentage of extension
- Flap aerodynamic noise, with volume as a function of trailing edge flap position*speed*G-force
- Slat aerodynamic noise, with volume as a function of leading edge flap position*speed*G-force
- Jet exhaust, with volume as a function of throttle lever percent (when the engine is active, which seems like a simple boolean operation to me?)
My first instinct is that I would multiply the integer percentages together, one after another, in the stack, then divide by some value to convert the result to a decimal, then multiply this by 10,000, and store it as the VolumeVarIn variable somehow. Is this the right line of thinking? What's the most efficient way to operationalize this? Am I completely off my head on everything?



