Jump to content
Sign in to follow this  
taguilo

XML trim guage help

Recommended Posts

Guest SimulatorPilot

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

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

Share this post


Link to post
Share on other sites
Guest SimulatorPilot

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.


20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

Share this post


Link to post
Share on other sites

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


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 SimulatorPilot

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


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

>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

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