Jump to content
Sign in to follow this  
Guest

XML Help == operators..?

Recommended Posts

Guest

I am using the below to try and trigger an event at Gforce 1.I want the event to trigger when 1 is passed on the up or down.here is the code(A:G FORCE,Gforce) 1; if{ (>K:TOGGLE_WATER_RUDDER) } I have tried replacing the &gt with == but it has had no effect.How could I restructure this to get the desired effect.ThanksAl

Share this post


Link to post
Share on other sites
Guest Matthias Lieberecht

Hi Al,I've never worked with G Force variables so I do not know if the variable itself is correct. However there's a bug in your code. Try this one:(A:G FORCE,Gforce) 1 == if{ (>K:TOGGLE_WATER_RUDDER) }Best RegardsMatthias

Share this post


Link to post
Share on other sites
Guest

Tried it but it didn't trigger the event.the code below works, but it triggers the event constantly over 1g I need it only to trigger once per 1g pass.(A:G FORCE,Gforce) 1 > if{ (>K:TOGGLE_WATER_RUDDER) }Thanks for the help.Al

Share this post


Link to post
Share on other sites
Guest Matthias Lieberecht

Hi Al,Well, Toggles just know two positions On or Off. In my or your code (doesn't matter which one) the Water Ruder Switch will be set to On when it was Off after passing 1g or it will be set to Off when the Toggle was on after passing 1g. However if your aircraft holds more than 1g the Toggle will also stay in it's switched position and will be switched back when the aircraft is below 1g. If you would like just a short event (for example the Water Ruders should just be on for about 1 second) you should use a timer. Also it would be good if you scan the position of the switch before it will be set by the code (could be done easy with a second If question).Best RegardsMatthias

Share this post


Link to post
Share on other sites
Guest

Thanks for all your help.The problem is that the switch is toggling on/off repeatedly while it is above 1g as apposed to just switching once.I tried adding a second if statement, and it works soso.Will keep trying..ThanksAl

Share this post


Link to post
Share on other sites
Guest Matthias Lieberecht

Okay, now I understand the problem. The solution should be very easy. Try this one:(A:G FORCE,Gforce) 1 > if{ 1 (>K:TOGGLE_WATER_RUDDER) } els{ 0 (>K:TOGGLE_WATER_RUDDER) }This code switches and holds the Water Ruder ON (1) when you're over 1g and switches back to Off (0) when you're below 1g.Hope it works.Best RegardsMatthias

Share this post


Link to post
Share on other sites
Guest

Thanks that is the one..!Now on to my next project.... Engine failures.....Al

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