Archived

This topic is now archived and is closed to further replies.

taguilo

XML trim guage help

Recommended Posts

Hi folks, Maybe one of you could help me out. I'm trying to add a trim sound effect to a panel using the dsd_xml_sound3 gauge. Here's what I got so far:Gauge directory:dsd_xml_sound3.gauSound dir.:trim_sound.wavtrim_sound.ini ----[Config]MaxSounds=1ErrorFlag=0LvarStop=dsd_stop_sounds[LVars]Lvar00=Trim_Sound[sounds]Sound00=./Sound/trim_sound.wav, 100------On Window00 of my Panel.cfg I have:gauge06=TrimSound!Trimsound, 2,2,1,1gauge07=dsd_xml_sound3!dsd_xml_sound3, 2,2,5,5, ./sound/trim_sound.iniI've created a new directory in my Panel directory with the xml file:TrimSoundTrimsound.xmlNow I'm not sure how to write the logical expression to see whether the trim is being moved or not. From what I'm understanding it would be something like this:If (Trim position is moving) assign 1 to Trim_Sound If (Trim position stops moving) assign 0 to Trim_Sound I'm using the variable "ELEVATOR TRIM POSITION" which returns (obviously) the trim's current position. How can I translate this into "moving" and "not moving"? Is there a better way to do that?Thanks in advance for any help!

Share this post


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

In pseudo-code:elev_trim_pos_old = elevator_trim_position ;elevator_trim_position = ELEVATOR TRIM POSITIONvar.var_value.n ;if (elev_trim_pos_old != elevator_trim_position) { trim_active = true ; }else { trim_active = false ; }

Share this post


Link to post
Share on other sites

Hi Bill, thanks for the help. I'm a XML newbie :) and here's the code I came up with. I know there's something wrong with it, could you point me to the right direction? Thanks.(A:ELEVATOR TRIM POSITION, enum) (& gt;G:Var1)(A:ELEVATOR TRIM POSITION, enum) (G:Var1) == ! if { 1 (& gt;L:Trim_Sound, enum) } els { 0 (& gt;L:Trim_Sound, enum) }Mark

Share this post


Link to post
Share on other sites

Mark,You may want to swap the "loading variable" sequence with the "checker" sequence. Otherwise the sound will never play. Also depending on FS(8/9/X) a value tag may not be allowed inside a solely. IIRC it must reside in a tag.(A:ELEVATOR TRIM POSITION, enum) (G:Var1) == ! if { 1 (& gt;L:Trim_Sound, enum) } els { 0 (& gt;L:Trim_Sound, enum) }(A:ELEVATOR TRIM POSITION, enum) (& gt;G:Var1)RomanProud "TEAM AVSIM" RTW race member.XP Pro, FS9, FR Locked @ 23, AMD 1800+ OCd to 1900+, APIC MProc Mod (24 IRQs), Latency Mods, ECS K7S5a V1.1, 7 fans, 1 gig, 100 & 60 Gig 7200rpm HD, ASUS/NVidia GeForce 64mb AGP on 21", NVidia FX5500 vivo 256mb (CRAP) on 18", Nvidia 93.71s ( The highest can go for the GeForce3 & 5500 combined ), Savage4 32mb on 15", BV services mods.

Share this post


Link to post
Share on other sites

Also, watch the syntax... not== !but rather!=

Share this post


Link to post
Share on other sites

Thanks Bill and Roman for the help! It works fine now. Syntax and variable order were to blame. :)

Share this post


Link to post
Share on other sites

> Thanks Bill and Roman for the help! It works fine now.>Syntax and variable order were to blame. :) Well, I thought you did a pretty good job of 'translating' my sorta-C-like pseudo-code into XML... ;)The only reason my 'order' would work is because I 'updated' the variable before the comparison...

Share this post


Link to post
Share on other sites

>Also, watch the syntax... not>>== !>>but rather>>!=Actually produces the same result but with an "extra" step :-)Tom

Share this post


Link to post
Share on other sites