Jump to content
Sign in to follow this  
dragonflightdesign

dsd_xml_sound gauge - documentation error

Recommended Posts

Guest Albatross7107

I'm so glad this gauge exsists!! Why the fruitcake MS didn't put some sort of sound support in the XML gauges is beyond me...It took some effort but I got this gauge to work.I followed everything in the documentation, but at first it didn't work.I slapped the "debug" gauge in the cockpit and finally figured it out.I was using no ini file so all the settings were default. When I edited my XML switch to add clicking sounds I used:1 (>L:dsd_xml_sound_id_00,number)No workee.... :(The debug gauge told me that it should be "dsd_xml_id_00" so I changed it to:1 (>L:dsd_xml_id_00,number)... and there was much rejoicing!! Just thought you all should know.... Although, I see posts all over using the dsd_xml_sound_id_xx and seeming to work... tis a puzzlementBTW: using dsd_xml_sound3.gau

Share this post


Link to post
Share on other sites

>I'm so glad this gauge exsists!! Why the fruitcake MS didn't>put some sort of sound support in the XML gauges is beyond>me...The reason why ACES didn't is simple enough. "XML" is not a programming language. It is simply an ASCII text based script, that must be interpreted by a parsing engine at runtime.


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Glad you got it working. I'll have to look at the docs again...Seems there are still a few flakes in the thing - see the post a little further down.I've always thought this kind of thing should be available through XML, but as Bill points out, XML itself is just a scripting language - it doesn't have any support for working directly with the hardware. The closest you can come is through another gauge, like I have done, or through a module, the way the GPS works. Something for MS to consider in future versions. They're welcome to my source code if they are looking for somewhere to start! }( Doug

Share this post


Link to post
Share on other sites
Guest Albatross7107

That's what I meant, I know it's a scripting language, I also know it's real easy to make a hook for a command and pass it's parameters off to a section of code. I used to do some programming in a former life.And all that we've said here is the exact reason I got a dumb look, scratched my head, and said "Why the He|| not??!?" when I found out you couldn't submit any sort of sound command in XML...Anyway - Yes it's great, now my toggle switches make noise!! I know it's a detail, but it bugged me.Now I just have 2 things to dope out... 1 - keep them from playing when not in 2D or 3D cockpit view, and 2 - Get the COM1 and COM2 switches to check the Ident status and NOT click again if they are already selected...*stares at you*{hopeful grin}

Share this post


Link to post
Share on other sites

There are several ways you could accomplish the goal. One would simply used the bool status of the COM1 or COM2 tokens, and play the sound only if they were set to zero (off).Another, more universal method, would be to create your own custom L:variable and track the position yourself. This is most useful when what you want to track doesn't have a stock FS token already. ;)Since you've had some programming experience already, it may be that simply having the XML prototype will be enough of a nudge:(A:token variable,unit) ! if{ action } els{ alternate action }-or-(A:token variable,unit) 0 == if{ action } els{ alternate action }


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest Albatross7107

*nods*Yep - I got that far although I did spend some time banging my head on the internal variables... (L:init,bool) == 0 if{ (A:COM1 TRANSMIT,bool) 1 == if{ 1 (>L:c1on,number) 0 (>L:c2on,number) 1 (>L:init,number) } } (L:c1on, bool) 0 == if{ 1 (>L:dsd_xml_id_00,number) 1 (>L:c1on,number) 0 (>L:c2on,number) } (L:init,bool) == 0 if{ (A:COM2 TRANSMIT,bool) 1 == if{ 1 (>L:c2on,number) 0 (>L:c1on,number) 1 (>L:init,number) } } (L:c2on,bool) 0 == if{ 1 (>L:dsd_xml_id_00,number) 1 (>L:c2on,number) 0 (>L:c1on,number) } This works, but the one thing that won't is checking the switch state at start up. The idea was to see if the switch was on and if so, set my local variable accordingly, however it doesn't seem to work...Seems that COM1 TRANSMIT and COM2 TRANSMIT aren't what I think they are... and the COM TRANSMIT which is supposed to return the transmitter state - the SDK docs are vague - seems to always be "0". I was expecting it to be 0=COM1 and 1=COM2 but that didn't work either...As a result you can click the switch that is "ON" one time and still get the sound. More to the point is finding a varible that will report what VIEW the user is in...For your entertianment - the whole "Gauge" I made, it's an invisible gauge for making sounds, I used the On Key so that mouse clicks and keyboard keys both make the sounds trigger. (AND I can still use the stock Radio Audio panel...)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_01,number)1 (>L:dsd_xml_id_02,number)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_02,number)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_00,number)1 (>L:dsd_xml_id_00,number) (L:init,bool) == 0 if{ (A:COM1 TRANSMIT,bool) 0 == if{ 1 (>L:c1on,number) 0 (>L:c2on,number) 1 (>L:init,number) } } (L:c1on, bool) 0 == if{ 1 (>L:dsd_xml_id_00,number) 1 (>L:c1on,number) 0 (>L:c2on,number) } (L:init,bool) == 0 if{ (A:COM2 TRANSMIT,bool) 0 == if{ 1 (>L:c2on,number) 0 (>L:c1on,number) 1 (>L:init,number) } } (L:c2on, bool) 0 == if{ 1 (>L:dsd_xml_id_00,number) 1 (>L:c2on,number) 0 (>L:c1on,number) }

Share this post


Link to post
Share on other sites

>More to the point is finding a varible that will report what>VIEW the user is in...>(P:ACTIVE VIEW MODE,enum)1 = 2D2 = VC3 = Tower4 = Spot;-)Doug

Share this post


Link to post
Share on other sites

The syntax for COM TRANSMIT is incorrect. It takes an "index" like this:A:COM TRANSMIT:1,boolA:COM TRANSMIT:2,boolSince they can never BOTH be set to 1 or 0 at the same time, you really need only check one or the other... ;)


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

>(P:ACTIVE VIEW MODE,enum)>1 = 2D>2 = VC>3 = Tower>4 = SpotUnfortunately dont work in FSX :-(

Share this post


Link to post
Share on other sites

>>(P:ACTIVE VIEW MODE,enum)>>1 = 2D>>2 = VC>>3 = Tower>>4 = Spot>>Unfortunately dont work in FSX :-(That's because ACES scrapped the old view system entirely. Many of us have requested that they add this back for FS11 at least.


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest Albatross7107

Ok.... I don't remember seeing anywhere that it was an array! GAAAH!Actually I still need two checks, since the checks are only run when a switch is clicked or a keypress. Which reminds me, is there a way to get a section of code to simply execute when the gauge is loaded? I tried a couple of ways to put it within the tag but it didn't *seem* to execute. Of course I didn't know about the syntax error either so....

Share this post


Link to post
Share on other sites

Hi,At gauge loading, startupTry:(L:Your Init,enum) 0 == if{ a (>L:Your Var1,enum) b (>L:Your Var2,enum) c (>L:Your Var3,enum) etc....etc....1 (>L:Your Init,enum) } Hope it helps,Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

>Ok.... I don't remember seeing anywhere that it was an array!> GAAAH!It is actually mentioned in the SDK, but......no actual example is given! One must closely examine the default XML gauge files included to determine the practical application of the syntax... :-hah "Note: Engine parameters take an index (1,2,


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest Albatross7107

Well, maybe they actually hired a technical writer....I'm reminded of an old M*A*S*H episodes....(Scene: 2 doctors are trying to defuze an unexploded bomb in the camp)CO, reading from instruction manual: "...now cut the blue wire... but first..." (everyone screams and runs)One "Hello World" can be worth a whole book of explainations. I'll take this info and see what I can come up with - :-samurai

Share this post


Link to post
Share on other sites
Guest Albatross7107

Ok - many times I have seen a thread like this, but with no final solution to help me along... So, here's what I did and it works.Note that this is NOT the gauge being "tripped", it's an invisible gauge which simple sits and monitors the sim and reacts with sounds when triggered. I listed the whole code above, so I won't repeat it all. (A:COM TRANSMIT:1,bool) 1 == if{ 1 (>L:c1on,number) 0 (>L:c2on,number) } (A:COM TRANSMIT:2,bool) 1 == if{ 0 (>L:c1on,number) 1 (>L:c2on,number) } The above code monitors the condition of COM TRANSMIT and changes my Lvars according to the condition of COM TRANSMIT. (L:c1on,bool) 0 == if{ 1 (>L:dsd_xml_id_00,number) } (L:c2on,bool) 0 == if{ 1 (>L:dsd_xml_id_00,number) }While the this code, which is between and waits for me to press a key, or click on a "gauge" to switch transmitters. When I do, it will "hit" either COM1_TRANSMIT_SELECT or COM2_TRANSMIT_SELECT depending on which transmitter I selected.At that point, my code checks to see what state "c1on" and "c2on" are in, and if they are set to "1" (on) then the sound WON'T play. This is so that if the pilot clicks on a switch that is ALREADY ON, it won't make the SNAP switch sound.Now for you fellas here who have helped me SO MUCH, that description was for the guy/gal that comes through here in 8 months hunting for answers - I ask that you double check me, that I am correct in what I wrote - the code works, but sometimes I miss the mark explaining things :DTHANKS GUYS FOR ALL YOUR HELP!! :-beerchugCheers!

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