Jump to content
Sign in to follow this  

Recommended Posts

Hi,Is it possible, and how to program!!, to play different sounds with toggle Afterburner?I mean, when you click a switch on, you must hear "Afterburner1" and when you click the switch off, "Afterburner2"When i program, both sounds are played by clicking on and off.Here is my wrong! code:L:ub1, bool) ! (>L:ub1, bool) (>K:TOGGLE_AFTERBURNER1) !(>K:TOGGLE_AFTERBURNER2)Any advise or help is very welcome.And when i'm not posting anything before 2003,i whish you all a merry Christmas and a happy new year!Janhttp://community.webshots.com/storage/1/v4...75aouncN_th.jpg

Share this post


Link to post
Share on other sites

Hi Jan,The XMLsound gauge just monitors the state of the Toggle_Afterburner state; when this changes, it plays the .wav file coupled to it.What you need to program is something like: (L:ub1,bool) ! (>L:ub1,bool) (L:ub1,bool) if{ >K:TOGGLE_AFTERBURNER1 } els{ >K:TOGGLE_AFTERBURNER2 }So, toggle the state of ub1 and, depending on the new state, play one sound or the other.Rob

Share this post


Link to post
Share on other sites
Guest Matthias Lieberecht

Hi Jan,I'm sure it's not an elegant way and a programmer could write the code much more professional but it should work:(L:ub1, bool) 1 == if{ 0 (>L:ub1, bool) (>K:Toggle_Afterburner1) } els{ 1 (>L:ub1, bool) (>K:Toggle_Afterburner2) }The code switches ub1 to 0 if the actual position is 1 and to boolean 1 if the actual position is 0. When switching to boolean 0 Afterburner 1 is played and when switching to 1 Afterburner 2 would be played. Haven't tried it yet.Best RegardsMatthias

Share this post


Link to post
Share on other sites

Thanks for your efforts Matthias and Rob!I applied it in the APU of Roman and now you can hear the APU start etc. and when you switch it off you hear only the click.Of course i use a large WAV-file for the APU (1820kb) and the wellknown clicksound.Here is the working code:(G:Var1) 0 == if{ 3 (>G:Var1) + (P:Local Time, seconds) 0.65 + (>G:Var2) 1 (>K:TOGGLE_AFTERBURNER3) } els{ 0 (>G:Var1) } 1 (>K:TOGGLE_AFTERBURNER1)Greetings,Janhttp://community.webshots.com/storage/1/v4...75aouncN_th.jpg

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