Sign in to follow this  
Guest grb

Can someone help me with this XMS gauge problem?

Recommended Posts

Hi all,Can anyone take the time to shed some light on what I do not understand and or am doing wrong in the below things?What I am attempting to do is produce a sound based on when the aircraft exceeds MACH 1. I am using this as a test plateform in order to see if I can reach a point where I understand all that is required to produce a functional XML guage. The original Sonic_bang XML gauge I downloaded simply does not work. Further the download zipfor that gauge included the XMLSoundv1.zip file. That XMLSound.gauwould not load into FS2K2. I got an error message saying that the Simulator could not load the "Third Party Software". So that will explain somewhat why I am doing the below things.Also, it will be interesting if I can get it to work, to evaluate all the various MACH gauges that all appear to register different values. What ones are close to at least sensing what the simulator feels is MACH 1...........etc..OK. I decided to download the original XMLSound.gau which included instructions that indicate it would work for one of four wav fileswhich I place into Sounds directory. And further.......I modifythe original K: entry ID in the sonic-bang gauge to reflect one of thefour possible K: entry Id's (KEY_TOGGLE_AFTERBURNER1,2,3 or 4) according to the XMLSound gauge documentation.OK as you will see below I have included both gauges in my PANEL.CFG.Here are the steps I have taken:STEP 1) IN MY PANEL.CFG............... gauge47=XMLSound, 0,0,5,5 gauge48=Cazas!Sonic_bang, 0,10,5,5STEP 2)CONTENTS OF Sonic_bang XML gauge from the original. Original had used a differentK event, it did not work. ALSO, original XML gauge came with XMLSoundv2.gau file, IT would not load into FS2K2......simulator said it could not load "third party software".So that is why I am using Bill Morad's original XMLSound.gau.(A:Circuit general panel on, bool) Sonic bang (A:AIRSPEED MACH, MACHS) 1 >= (G:Var2)0==&& if{ 0 (>K:KEY_TOGGLE_AFTERBURNER4) 1 (>G:Var2) } (A:AIRSPEED MACH, MACHS) 1 < if{ 0 (>G:Var2) } STEP 3)DOWNLOADED XMLSound.gau BY the late Bill Morad......then placed it into Gauge Folder.Now based on the documentation I found on the XMLSound.gau, I have the choice of using four sounds that would be triggered when using one the following KEY EVENTS ID's:TOGGLE_AFTERBURNER1,2,3,4.I also have the appropriate four wav files that go with the XMLSound.gau package. As seen in the XML gauge code I am triggering on the fourth wav file, which the XMLSound.gau should recognize as "KEY_TOGGLE_AFTERBURNER4". Of course the four wav files where put into the main FS2K2 Sound directory. And I know they produce a given sound.___________________________________________________________OK. Any ideas as to what is wrong with what I am attempting to do?I suspect the RPN logic is simply not right in the Sonic_bang gauge but if that is the case, I am not quite on board in knowing how to produce some code that would make it work correctly.Thank you in advance for any help. I realize I put a lot here, butit shows each step I took and explains why I did certain things, so that the reader will see that I completed the basic placment of files etc.. I am assuming that if the logic is correct in the sonic gauge thenthe K:KEY_TOGGLE_AFTERBURNER4 should trigger the XMLSound.gauthat is loaded in the sim to procduce the given sound associated withKEY_TOGGLE_AFTERBURNER4. Is this correct?take care all,George

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi,I have the same problems with xml-sound.Found out having 2 engines, only 2 sounds work.This line must be in the panel.cfg:gaugexx=XMLSound!XML-Sound, 0,0,10,10This line must be in the fs9.cfg:{OLDMODULES} (with brackets!)FSSound.dll=1In the xml gauge (>K:TOGGLE_AFTERBURNER1) and (>K:TOGGLE_AFTERBURNER2) will work and trigger the whm-sound1.wav (can be any sound) and whm-sound2.wav, not more.With 4 engines you will have 4 sounds.The synthax should be (tested and operable): (A:Circuit general panel on, bool) (A:AIRSPEED MACH, MACHS) 1 > (G:Var2) 0 == && if{ (>K:TOGGLE_AFTERBURNER1) 1 (>G:Var2) } (A:AIRSPEED MACH, MACHS) 1 < if{ 0 (>G:Var2) }Of course you must rename the "sonic bang" sound.wav(?) to whm-sound1.wav!Hope this helps,Jan"Procul Negotiis"

Share this post


Link to post
Share on other sites

Jan,Thank you for your help. I noticed that the syntax for the Panel.cfgfile you show is a bit different then what I have. I was aware of the suffix portion of the gauge name not being present BUT did not know what to put there. Where you show:gaugexx=XMLSound!XML-Sound, 0,0,10,10 I obviously did not have the XML-Sound part..............So I will add that to the config file,and add the Modules include as you indicate. {OLDMODULES} (with brackets!)FSSound.dll=1I think I already have the module declaration/include whatever. Because I am using downloaded gauges that had included the FSSound.dll in the zip file and had as instructed copied that dll to the module directory. However I did not do what you say here. But the guage sounds worked ok for those XML gauges. At any rate I will verify that the dll is included in the OLDMODULES.Thanks again for the help,George

Share this post


Link to post
Share on other sites

Hallo.May be you didn't notice, but i tested the xml gauge synthax, i showed before, in my panel and this code will give a "BHWAMM" after exceeding a certain speed.Jan"Procul Negotiis"

Share this post


Link to post
Share on other sites

Jsn,I did not notice the few changes you made to your code as shown in this thread and the code I exhibit from the original. I will try what you show here. For instance in the first line you do not have a greater then or equal sign, only a = sign. Other then that it looks the same as what I showed. But I will give it a try.Also, I searched through the SDK Doc for Events and Parameters,AND NEITHER TABLE SHOWS "machs" ONLY MACH in various places which weunderstand that mach/MACH should show up in those tables.So I obviously am still missing something here. Also at this point I have no problems with the sound(s) when using the XMLSound.gau that Bill Morad created. If I click on the After Burner Throtte control in lets say the T38 Talon (the universal one we see in AVSIM download library, or hit a SHIFT F4 Key sequence in other planes such as a F18, that does not have AFB gauge assigned to the panel...............I hear the correct sound. So the issue is not with the sound not being produced, only withthe sound not being produced when the aircraft exceeds MACH 1.Thanks again for your feedback. Hope your code version works!chow for now,George

Share this post


Link to post
Share on other sites

Well Jan,The verdict on your piece of XML code..........IT WORKED.BUT NOT AS YOU HAD IT IN THIS THREAD. I had cut your code out of the thread and put it into my sonic_bang.xml gauge. But when starting the sim, I got a:FS2002 has caused an error FS2002 will now stop.OK, I noticed in your code that you where using greater then signs (>), where in my original code, it used ( &gt ), similiarly where you used ( < ) , my code used ( &ltz).The fix that makes the gauge now work was to:replace the ( < and > signs) with ( < and > ).Perhaps you are using FS2004 which allows those signs in the code,I don't know. All I know is once I made those changes, the simulator loaded up the game and I was able to hear the choosen sound whenflying both my T38 Talon and a souped up version of Dale Reamer's F18.So thank you very much for taking the time to dianose my problem and provide a solution. I hope this thread will help some other "budding"XML Gauge designers. I now have a piece of code that I know works and it will allow me to use it as a test bed to create new code and experiment around a bit.Only one other thing. And obviously you have no control over this, butfor some reason, when flying the T38, I can no longer activate theAfterburner control (once I have the throttle set to maximum) this used to work. So for some reason this sonic_bang gauge code is messing with the T38's afterburner gauge control. All it will do is produce a sound for KEY_TOGGLE_AFTERBURNER1 when I try to activatethe afterburner. Perhaps I will ask the designer of that aircraft why this may be happening. The sound wav file I am using for thesonic_bang is KEY_TOGGLE_AFTERBURNER4. And I obviously over-wrote the original whm-sound4.wav file to have the boom sound.At any rate, thanks again for helping me out.best regards,George

Share this post


Link to post
Share on other sites

Aha! After sending the last reply I noticed that when typing a ampersand followed by a letter "g" then a letter "t" then a semi-colon sign,that it shows up in the forum reply as a < or >.So your code you sent me, pasting it in from your machine probably did have the correct syntax, and it is the html parser that is making it look like it did!chow again,George

Share this post


Link to post
Share on other sites

.......................>Also, I searched through the SDK Doc for Events and Parameters,>AND NEITHER TABLE SHOWS "machs" ONLY MACH in various places>which we understand that mach/MACH should show up in those tables.>So I obviously am still missing something here. ...............>George You seem to have your gauge working, but this gives Mach Number:(A:Airspeed Mach,number) (>L:Mach,number) I set "(L:Mach,number) to the A: variable so I only needed to read it once. The 'greater than' sign can be set in the xml file as displayed in this message. Both for FS2K2 and FS9.Ron

Share this post


Link to post
Share on other sites

btw.My code was tested in fs9.When you have 1 engine, only 1 sound will work,..pity,leider...etc.Jan"Procul Negotiis"

Share this post


Link to post
Share on other sites

Ron,Thank you for an alternate way to obtain mach number. I was planning on asking your help eventually if I could not get the gauge to work.It appears you have done quite a bit of XML qauge development work,and are willing to help others out in this area.Jan,Thanks again for the feedback. I did think you might have tested the code in FS9 as indicatd in my earlier statement. I misnamed it FS2004. At this point I am trying to understand just how the stack operations work in assembling (parsing) the lines of code in this gauge. After reading Arne's Document concerning XML stuff that came with the package he offers for download (Dragonfly stuff and lots of C code),I realize one must gain a working knowledge of how RPN works in relation to this XML code generator (or whatever it should be called.Not so easy when one is starting from scratch. Like most things that one is not familiar with, I guess I just have to bite the bullet,and learn how the RPN operations work. Perhaps it will reach a point where I can help some folks in this forum on this stuff.Thanks both again for offering me help.take care,George

Share this post


Link to post
Share on other sites

George,When i started xml about a year ago, the first thing i did was looking at the different xml gauges delivered with fs2002 and making some alterations in it, examining the effects, color of text, size of bitmaps etc.Later, with more confidence and a lot of help of all the people in our forum, just asking and asking, the skills improved.I am convinced that everyone in here is willing to help and advice.Lot of good guys!I just left "primary school".Jan"Procul Negotiis"

Share this post


Link to post
Share on other sites

Greetings,Now that you have the sonic boom resolved, why not a hard landing BOOM? This will move you into use of the boolean AND function. Look at vertical fpm at the instant the flag for being on the ground is set. If the fpm is greater then 700fpm (?) AND the ground flag is TRUE, sound a BOOM! Even us GA pretenders will get a BANG from this one!Another way that might work is by the use of the fireworks fx effect. One of the effects is an aerial bomb, attach it to a "light" switch, with the location of the effect right in the cockpit and you will certainly wake pilots up who land hard. :-)Regards,BobSIf you want to learn xlm, go buy an old HP calculator manual on ebay. Search on HP calculator manual. Probably about 10 - 20 dollars. Besure and get one of the early "Scientific" versions unless you are a bean counter.

Share this post


Link to post
Share on other sites

Jan,Hang in there, Sounds like you got a ways to go. I am trying to keep my mind sharp (oh really) as I get a bit older. I keep coming back to FS2K2 over trying to program with some success Medal of Honor and Soldier of Fortune missions. This gauge development may turn out to be a lot of fun designing both XML and C type guages. I yet to set up my Borland Compiler to be able to actually try to write then compile code in C for a gauge. I figured since XML is a bit easier to get started in, I would give it a try. I have not programmed anything of any signifance in C for at least four years. Did not evenhave a C/C++ compiler package on any of my current windoze systems for the past three years or so. Thanks to JeanLuc, Arne, I found free compilers to install on my ME box. Bobs,I am a newbie, and quite frankly am still absorbing how to enter correct syntax for the RPN code. I will keep in mind what you suggest but that might be a bit off. I do want to attempt next to create a XML gauge (like a slider type) which I can see and changethe Barametric Setting in Hg. Some of the mil planes have such smallAltitude gauges that it is hard to see what the pressure setting is in those little windows. To me that will be a usefull XML gauge for my personal use. But thanks for the suggestion. I may bite once I am better on board with RPN.cheers,George

Share this post


Link to post
Share on other sites

>Ron,>Thank you for an alternate way to obtain mach number. I was>planning on asking your help eventually if I could not get the>gauge to work.>It appears you have done quite a bit of XML qauge development>work, and are willing to help others out in this area. About all I've done with XML is to program some Test Gauges. They use a lot of XML Parameters. I had to fool around a lot to find what give me the correct values. I may display the raw (A:var,number) value since that may be already converted to what I want. Other times I display some calculated L:Var to see if it looks right. Or, even has a value other than 0.00. ;)>Jan,>Thanks again for the feedback. I did think you might have ...>At this point I am trying to understand just how the stack>operations work in assembling (parsing) the lines of code in>this gauge. After reading Arne's Document concerning XML stuff>that came with the package he offers for download (Dragonfly>stuff and lots of C code),>I realize one must gain a working knowledge of how RPN works>in relation to this XML code generator (or whatever it should>be called.>George Many of us have HP RPN calculators; this helps a lot. It IS confusing to figure out many of my XML calculations; especially a few days after I wrote them. There are also free HP style PC calculators one could install and practice on to get a feel of RPN. I find it intuitive for hand calculations, but confusing for program source code. I was wondering why MS didn't use VBScript, or something else aready deveolped instead of XML. I think the RPN stuff added to XML (it is only used in XML guages) was used because is faster to interpret and run than some other interpreted code. Ron

Share this post


Link to post
Share on other sites

Ron,I to have used HP calculators over they years but I like many of uswhen it comes to putting eall the stacks (pushing and popping them,storing (S(X)) loading (L(X)) stacks, and whatever on paper or on the fly while trying to code it is a real bear.I having problems just keeping each element straight in my head as I peer at many of the XML gauges people have made. AND WHAT I AM FINDING OUT ABOUT SOUND OPTIONS DOES NOT LOOK TO GOOD.As you are probably aware, there are a limited number of K:AircraftEvent ID's that have standard sounds attached to them within the simulator. And as of today, I do not have the experience to createXMLsoundxxx.gau's that would key in on a particular simulator event so that one can have a sound produced from some aircraft condition.............Plus what I found was, that when I installed the sonic_bang.xml gauge and associated XMLSound.gau and changed one of the four wav files that would be triggered when Mach 1 was exceeded and in the code as you see, eventually activates (for lack of a better word) the EventID TOGGLE_AFTERBURNER4....... the sonic boom wav file I substituted for one of the original wav files assigned for use with the XMLSound.gau .............makes the boom.----------------------------OK great. But how many Event ID's can be used in XML gauge code, to trigger various type sounds? Very few as I detect after looking through the Event ID list file. Very few in deed.OK IF YOU ARE STILL WITH ME AT THIS POINT. With the above being the case..... depending an an Event ID ............Could one use something other then an Event ID to then be sensed by a XMLSound.gau file that would then produce a given sound?Whew....not sure if my grammer is adequate to bring out the point I amtrying to make. PUT ANOTHER WAY..........must we use Events seenin the K:blah...blah sections of the code to produce some final result, such as triggering some text window on the sim screen or acting as a call back so to speak that triggers a sound module that eventually plays a given wav file?Any feedback would be appreciated on this subject. And do not feel obligated etc., if you do not feel up to attempting an answer.Lastly wish I could have used an example in the above ....but as I indicated I am still struggling with just getting the RPN syntax correct and knowing when to realize that something will get pushed onto or popped of the stack based on if statements and operators etc..take care,George

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