Jump to content
Sign in to follow this  
Guest RoAM

K Event Toggle Every 3 Click

Recommended Posts

Guest RoAM

Im tryin to switch the Anti Ice on using a 3 way toggle switch, when it is up i want it to be on, when its middle and down i want it to be off. Below is were i am at teh moment it toggle every mouse click but i cant figure out how to make it toggle every 3rd.Cheers for the Help. (K:ANTI_ICE_TOGGLE_ENG1,bool) ! (>K:ANTI_ICE_TOGGLE_ENG1,bool) (L:OnOff Switch, enum) ++ d 2 > if{ 0 } (>L:OnOff Switch, enum)

Share this post


Link to post
Share on other sites

Hi,You could try to make three click spots: Down, middle and up.Give that area's the code:Down(off):0 (>L:OnOff Switch,enum)(A:General eng1 anti ice position,bool) if{ 0 (>K:ANTI_ICE_SET_ENG1) } Middle(off):1 (>L:OnOff Switch,enum)(A:General eng1 anti ice position,bool) if{ 0 (>K:ANTI_ICE_SET_ENG1) } Up(on):2 (>L:OnOff Switch,enum)(A:General eng1 anti ice position,bool) ! if{ 1 (>K:ANTI_ICE_SET_ENG1) } The switch moves according:(L:OnOff Switch,enum)To add a sound you need Doug Dawson's sound gauge.Then you can give all clickspot a different sound.Hope it helps, Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites
Guest RoAM

Thanks for your Reply Jan, i stil lcant get it to work, i think i may be misunderstanding your post, i have inserted the full guage code below. Many Thanks for Your Help. Im thinking i shouldnt have up as the default on as when you load the sim it will load the default but i dont think it will automatically turn on the De-Ice.(L:TLM Switch,bool)(L:OnOff Switch,bool)(L:Test Switch,bool)(A:Circuit general panel on, bool) (A:ELECTRICAL MAIN BUS VOLTAGE,volts) 10 > &&@visib(L:TLM Switch, bool)(L:Test Switch, bool)(L:TLM Switch, bool)@visib(L:OnOff Switch,bool)(L:OnOff Switch,bool)@visib(L:Test Switch,bool)(L:TLM Switch, enum) ++ d 2 > if{ 0 } (>L:TLM Switch, enum) 0 (>L:OnOff Switch,enum) (A:General eng1 anti ice position,bool) if{ 0 (>K:ANTI_ICE_SET_ENG1) } 1 (>L:OnOff Switch,enum) (A:General eng1 anti ice position,bool) if{ 0 (>K:ANTI_ICE_SET_ENG1) } 2 (>L:OnOff Switch,enum) (A:General eng1 anti ice position,bool) ! if{ 1 (>K:ANTI_ICE_SET_ENG1) } >((L:Test Switch, enum) ++ d 4 > if{ 0 } (>L:Test Switch, enum) Eng1 de-ice switch

Share this post


Link to post
Share on other sites

Hi,had a small look1. I think the click events of the OnOff Switch need each there own area definition.2. Use enum instead of bool.3. Not sure the needles will rotate.Try to use something like:"Rotate Down":

Share this post


Link to post
Share on other sites

Hi RoAm,I think the problem is you are using 3 within a single . Personally, I would use something like this: (L:OnOff Switch,enum) ++ 2 min d (>L:OnOff Switch,enum) 2 == if{ (A:General eng1 anti ice position,bool) ! if{ 1 (>K:ANTI_ICE_SET_ENG1) } } (L:OnOff Switch,enum) -- 0 max d (>L:OnOff Switch,enum) 2 < if{ (A:General eng1 anti ice position,bool) if{ 0 (>K:ANTI_ICE_SET_ENG1) } }There are two click areas. The upper one makes the switch travel from Off (0 down-default) to On (2) passing through middle (1); and the lower makes the opposite. Notice that a real switch similar to this one works alike.Regards,Tom

Share this post


Link to post
Share on other sites
Guest RoAM

Brilliant i got it to work, using your help of course, many thanks Tom and Jan.

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