Jump to content
Sign in to follow this  
snomhf

Trying to convert toggle event to on/off

Recommended Posts

I'm wanting to create C172 Fuel Valve OPEN and C172 Fuel Valve CLOSE buttons.  I've been at this for several hours and am close but just can't get it working.  Here's what I have:

C172 Fuel Valve CLOSE --

(A:GENERAL·ENG·FUEL·VALVE:1,·Bool)·if{·(>K:TOGGLE_FUEL_VALVE_ENG1)·}

C172 Fuel Valve OPEN --

(A:GENERAL·ENG·FUEL·VALVE:1,·Bool)·!·if{·(>K:TOGGLE_FUEL_VALVE_ENG1)·}

 

I'm watching GENERAL ENG FUEL VALVE variable change from 0 to 1 in the Observe Variables in Simulator tool so I know I'm referencing the right variable.   TOGGLE_FUEL_VALVE_ENG1 works fine too if I simply use it as a toggle.   These scripts sort of work for several switch iterations but then get out of sync and/or stop working altogether.  Weird!  Some help getting this figured out would sure be appreciated.

-mark


Aficionado of MSFS, X-Plane12, Aces High, Wings Over Flanders Fields

i7-9700k@5.0GHz, Nvidia RTX 4070ti(12GB), Z390 AORUS MB, 64GB DDR4, 2TB SSD(560MB/s), Windows 10 Home 64-bit, Honeycomb Alpha and Bravo, CH Pro Pedals, TrackIR5

Share this post


Link to post
Share on other sites

Well, this is downright scary!  I powered off to eat dinner and when I powered back on,  the scripts are working fine!   I guess something got screwed up inside the sim and rebooting cleared it up.   All is not lost though,  I got rather intimate with Watch AAO script processing and Watch simulator variables/events.   I'm much more equipped now to debug this crazy RPN stuff (always hated those HP calicaulators the geeks used in engineering school).

  • Upvote 1

Aficionado of MSFS, X-Plane12, Aces High, Wings Over Flanders Fields

i7-9700k@5.0GHz, Nvidia RTX 4070ti(12GB), Z390 AORUS MB, 64GB DDR4, 2TB SSD(560MB/s), Windows 10 Home 64-bit, Honeycomb Alpha and Bravo, CH Pro Pedals, TrackIR5

Share this post


Link to post
Share on other sites
Posted (edited)

I can't check it right now, but in all likelyhood these are MSFS Input Events or BVars.

- IEs can be seen in the normal Event list in the group "MSFS InputEvents". They are loaded for each individual aircraft when you are sitting in the cockpit - if the developer saw fit to implement them

- BVars and HVars are related to the IEs (=when there is a B/H Var there is a good chance that you will find an IE with the same name)

The general procedure for non-IE stuff is to activate the MSFS developer mode, "Tools->Behaviors". Then click back into the sim window, hover the mouse over the button/lever you are interested in, and press Ctrl & G. In most cases this will bring up the behavior code of that control. In there you will find the "inteaction/LeftSingle/Wheel..." components which describe what happens when you use the mouse - and that is (in general) what you want to replicate in AAO.

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

Thanks Oliver!

I hope to at some point wrap my X-Plane-FlyWithLua brain around what you've said.  

Actually,  dealing with these panel lights,  I have indeed run into what you're talking about with these IEs.  I've gotten lucky I guess so far as I have gotten most of them to work but there is still a giant cloud of mystery hanging over me as I do this stuff.   I'm getting there slowly.   Thanks so much for a great tool.   Love that Event Viewer.  I was using SimVars out of the VisualStudio SDK but this is much more convenient.  The more I use AAO, the less I'm relying on outside tools.

-mark


Aficionado of MSFS, X-Plane12, Aces High, Wings Over Flanders Fields

i7-9700k@5.0GHz, Nvidia RTX 4070ti(12GB), Z390 AORUS MB, 64GB DDR4, 2TB SSD(560MB/s), Windows 10 Home 64-bit, Honeycomb Alpha and Bravo, CH Pro Pedals, TrackIR5

Share this post


Link to post
Share on other sites

Wow!  Behavior mode is the ticket!!  Shows me the exact code I was struggling to write.   Worked perfectly!   Thank you Oliver.  I was ready to give up.  Maybe there's hope for me yet!


Aficionado of MSFS, X-Plane12, Aces High, Wings Over Flanders Fields

i7-9700k@5.0GHz, Nvidia RTX 4070ti(12GB), Z390 AORUS MB, 64GB DDR4, 2TB SSD(560MB/s), Windows 10 Home 64-bit, Honeycomb Alpha and Bravo, CH Pro Pedals, TrackIR5

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