June 13, 200817 yr 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!
June 13, 200817 yr Moderator 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 ; } Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
June 13, 200817 yr 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
June 13, 200817 yr 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. FS RTWR SHRS F-111 JoinFS Little Navmap
June 13, 200817 yr Moderator Also, watch the syntax... not== !but rather!= Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
June 13, 200817 yr Thanks Bill and Roman for the help! It works fine now. Syntax and variable order were to blame. :)
June 13, 200817 yr Moderator > 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... Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
June 13, 200817 yr Author >Also, watch the syntax... not>>== !>>but rather>>!=Actually produces the same result but with an "extra" step :-)Tom
Create an account or sign in to comment