Jump to content
Sign in to follow this  
Guest Captain Geoff

dsd_xml_sound3 help

Recommended Posts

Guest Captain Geoff

I'm a newbie at gauge development. I know how to write XML, and am generally fairly profient in panel layouts.I came across the dsd_xml_sound3 package and it looks really neat. But I have not found any information on it - and in particular where do the LVARs come from? Are they made up names? Where are they put in a guage ?I have FSPanelStudio and I've download a couple of aircraft that have the dsd_xml_panel3 in the panel.cfg, but I can find no reference to what the LVARS are in the accompanying cab or xml files.I am trying to something very simple as a first step: I want to install a switch on the main panel of helo, and have the switch active a motor sound for a winch. Seems very simple, but after spending many hours searching and reading I'm still completely confounded.Any help will be greatly appreciated!Senior Captain, Pier Glass Aviation

Share this post


Link to post
Share on other sites
Guest EnGauged

As the "Creating XML Gauges" doc in the FSX SDK states:Local Parameters (L:)When a local parameter is declared, its value is set to zero. Use your own names for these parameters, but care should be taken that these names are unique. Use unit names when declaring them, for example:(L:Stopwatch Toggle Position: bool) So yes, you can create your own names. The Stopwatch example that comes with the SDK uses L: vars; I'd recommend looking at its XML:SDKSimObject Creation KitPanels and Gauges SDKXML Gauge samplesstopwatch.xmlHope this helps.

Share this post


Link to post
Share on other sites

The gauge uses a configuration file to establish the relationship between the sounds being played and the L:Vars used to control them. That's where the L:Var's 'come from.' The names can certainly be anything you wish.This might give you an idea. Apologies for the FS8 XML syntax...(L:winch_sound, enum)(L:winch_sound, enum) 2 == if{ 0 (>L:winch_sound, enum) } els{ 2 (>L:winch_sound, enum) }Doug

Share this post


Link to post
Share on other sites
Guest Captain Geoff

Ah, Excellent. Guess I was on the right track. So in the above example the L: is defining a local variable and winch_sound is the variable name I assign it. And that is then the name used in the sound.cfg file, in which the actual sound file is then attached to the variable name. Seems too simple to be true.I'm glad I asked. Can't wait to get it working!Senior Captain, Pier Glass Aviation

Share this post


Link to post
Share on other sites

"" ...Seems too simple to be true ...."It IS that simple :-)A few tips to prevent clashes with other gauges (made by other people) in the panel that might use Dougs sound gauge.- Give your L:variables a unique name (like add your initials in the name) to prevent name clashes. SInce L:vars must be unique panel-wide.- For the same reason, make sure that the sound.cfg has a unique name (or location); you can give it any name/location you like since that is defined in the gauge definition.- And if this is a generic gauge that can be added to more aircraft: you can rename the dsd_...gau to another name, which allows to have multiple instances of the gauge in the panel.cfg, since each instance will have its own config file defined.Of course the latter is only needed if you foresee the gauge being used combined with gauges from others that also use this sound-player gauge; because it's better (performance-wise) to have all the sounds in one cfg file. Cheers, Rob

Share this post


Link to post
Share on other sites
Guest Captain Geoff

Thanks for the advice - I will keep it in mind. I certainly see this gauge being put in a whole myriad of helos. No more silent winches. The aircraft I'm working on is an SH-2F which has two winches with slightly different sounds - one for the rescue hoist and one for the MAD gear with differing lengths of cable and runout times.Helicopter Composite Squadron Five, VUSN.orgSenior Captain, Pier Glass Aviation

Share this post


Link to post
Share on other sites
Guest Captain Geoff

OK, after fiddling with this now for a couple of days, I actually got the sound to work exactly once. The switch does not switch between bitmaps and no sound is forthcoming now. I'm using the FS Panel Studio and editing the xml in notepad. I have found that the xml file is *extremely* sensitive to spaces between items. Note for example that in the the first if is written ==if. If I put a space between the == and if the switch will not show on the panel.Here's the gauge's xml:-----------------------------------------(L:gmm_winch_sound, enum)(L:gmm_winch_sound,enum)2 ==if{ 0 (>L:gmm_winch_sound,enum)} els{ 2(>L:gmm_winch_sound,enum) } ----------------------------------------here's the Panel.cfg relevant part:gauge43=dsd_xml_sound3!dsd_xml_sound3, 2,2,20,20,./Sound/SH-2/SH-2sounds.cfggauge44=hoist!hoist, 950,620,33,34---------------------------------------here is the SH-2sounds.cfg[Config]MaxSounds=30LvarStop=dsd_stop_sounds[LVars]Lvar00=gmm_winch_sound[sounds]Sound00=./Sound/SH-2/hoist.wav,85So my question is, obviously what's wrong? But equally important is how does the dsd_xml_sound3 gauge know that it is supposed to play a sound - and why don't I see the alternating bitmaps. Other folks have asked about a good reference on proper syntax - but in following the links they all seem to go to pages that no longer exist. I hate to ask, but I'm at wits end.Many thanks in advance if you can show me the error of my ways.Senior Captain, Pier Glass Aviation

Share this post


Link to post
Share on other sites

Hi,As I see it there are a lot of spaces missing. Try:space is:_(L:gmm_winch_sound,enum)_2_==_if{_0_(>L:gmm_winch_sound,enum)_} els{_2_(>L:gmm_winch_sound,enum)_}Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites
Guest Captain Geoff

OKAY-----I went back and reformatted the line - the entire line of and now everything works - the sound and the bitmaps. So a lesson learned here is that XML/RPN is *extremely* sensitive to proper spacing. Are there any guidelines online with valid links to them?Senior Captain, Pier Glass AviationSenior Captain, Pier Glass Aviation

Share this post


Link to post
Share on other sites

Hi,>So a lesson learned here is that XML/RPN is *extremely*>sensitive to proper spacing. Are there any guidelines online>with valid links to them?>Actually it's not a big deal. Each value/variable/operator placed on the stack must be separated from its preceding with AT LEAST one space (ascii 32).Here you can find additional info on the subject: http://forums.avsim.net/dcboard.php?az=sho...ing_type=searchTom

Share this post


Link to post
Share on other sites
Guest Captain Geoff

I've successfully attached the dsd_xml_sound3 to my three position switch and the switch works, playing the audio when the switch is in the up or down position and turning off when the switch is in the off position. Woo Hoo!One minor probem remains - and that is the duration of the sound - if the switch is up (1) the sound plays one iteration, stops, and the switch moves to the off position. If the switch is down (2) the sound plays continuously until the switch is manually moved to off (0).Is this behaviour because of the value that I am setting my internal gmm_winch_sound variable?here's the code just in case it helps....(L:gmm_winch_sound, enum) 0 == (L:gmm_winch_sound, enum) 1 == (L:gmm_winch_sound, enum) 2 == 1 (>L:gmm_winch_sound, enum) 0 (>L:gmm_winch_sound, enum) 2 (>L:gmm_winch_sound, enum) Thanks!Senior Captain, Pier Glass Aviation

Share this post


Link to post
Share on other sites

What you describe is expected behaviour. Setting the control variable to a value of 1 results in a "play once" sound. Setting the value to 2 results in a looping sound. You may end up needing separate variables for the switch display and for sound control.Doug

Share this post


Link to post
Share on other sites
Guest Captain Geoff

Thanks Doug - I wondered if that wasn't the case.Senior Captain, Pier Glass Aviation

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...