Jump to content
Sign in to follow this  
riveter

Beech Model 18 (Oil Shutters event problem)

Recommended Posts

Posted (edited)

I am setting up my Stream Deck buttons for the MS Carenado Beech Model 18 (with the popular Denarq mod) in MSFS 2020.

Here are some of the unusual events I have got working. Thanks to this forum and the SDK docs I have been able to create these scripts which toggle the associated controls.

Cowl Flaps
(L:CARVAR_cowlflap_L, Number) 0 == if{16384 (>K:COWLFLAP1_SET)} els{0 (>K:COWLFLAP1_SET)}
(L:CARVAR_cowlflap_R, Number) 0 == if{16384 (>K:COWLFLAP2_SET)} els{0 (>K:COWLFLAP2_SET)}

Manifold Heat
(A:GENERAL ENG ANTI ICE POSITION:1, percent) 0 == if{16384 (>K:ANTI_ICE_GRADUAL_SET_ENG1)} els{0 (>K:ANTI_ICE_GRADUAL_SET_ENG1)}
(A:GENERAL ENG ANTI ICE POSITION:2, percent) 0 == if{16384 (>K:ANTI_ICE_GRADUAL_SET_ENG2)} els{0 (>K:ANTI_ICE_GRADUAL_SET_ENG2)}

But I am having no luck with the Oil Shutters.

This appears to be the related event. But no event is revealed when I 'Watch Simulator Events' and actuate the levers in the sim.

(>L:Denarq_OILSHUTTER_SET_1)   (Variable shows up in Behaviors, MouseRect. Does not work in AAO.)

I should be able to close the shutter by sending from the Script Editor

0 (>L:Denarq_OILSHUTTER_SET_1)   (Sim does not respond.)

And this is what some users of FSUIPC have gotten to work. They reported this in the Flight Simulator forum. Flight Simulator Forum

L:Denarq_OILSHUTTER_SET_1   (Reported to work in FSUIPC calculator code)

So my question is: Can I replicate sending this 'calculator code' in AAO? I am not familiar with FSUIPC.

 

From Dev Mode Behaviors:

pYWwEo7.png

 

From the Beech 18 Denarq mod manual:

https://i.imgur.com/gcFZbhv.png

Edited by riveter
correction

Share this post


Link to post
Share on other sites
Posted (edited)

LVars are not events. They are just variables. Changing their values may accidentally work - or not. They can be observed as the Variables that they are, but only if you know their names first. So you need to collect all LVars from the sim first (AAO Scripting menu) then you can observe their values (also in the Scripting menu). Be mindful that an LVar can have any value, not just 0 and 1. 

Are you quite certain that there are no Input Events or BVars associated with the switches/levers? Those scripts seem very complicated. (And they are syntactically incorrect in places, there are space characters missing)

In general, when you want to change the value of an LVar in the sim, you must supply a unit, at the very least the default "Number" (otherwise AAO treats it as an internal variable that is never sent to the sim - see AAO manual)
Assuming that this LVar has only the values 0 and 1 (observe it to make sure) then the scripts would be

"On"
1 (>L:Denarq_OILSHUTTER_SET_1, Number) 

"Off"
0 (>L:Denarq_OILSHUTTER_SET_1, Number) 

"Toggle"
(L:Denarq_OILSHUTTER_SET_1, Number) ! (>L:Denarq_OILSHUTTER_SET_1, Number) 

 

In general please consider this (I just wrote it in another thread, so I'm just quoting myself real quick)

Quote

Check if the button operates the MSFS default: an Input Event. If the aircraft developer chose to implement them, then you will find them in the normal Event treelist in the group "MSFS Input Events". 

If there is no Input Event, then, if you want to investigate a button or lever, use the MSFS Developer Mode -> Tools -> Behaviors. Once this dialog is open, click back into the sim, then hover the mouse cursor over the control that you are interested in and press Ctrl - G. In most cases the behavior code of that switch or lever now shows up in the dialog. First, investigate the Mouse interaction code in the components called Asobo_GT_Interaction_LeftSingle... (or Wheel, etc.). This contains the code that is executed when you perform the associated mouse action. And that is what you want to replicate in AAO. Those should be primarily K-Events, Input Events, BVars and HVars.

On said dialog there is also a tab that contains all LocalVariables (=LVars). Just be mindful that LVars are not events of any kind and that, generally speaking, they don't actually do anything. That changing an LVar can potentially trigger something in the cockpit is in most cases pure coincidence. There is even the possibility that changing the LVar will move the switch - but will not trigger the actual aircraft system that the switch operates (= when the LVar is only used for the switch animation, nothing else)

 

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites
Cowl Flaps
(L:CARVAR_cowlflap_L, Number) 0 == if{ 16384 (>K:COWLFLAP1_SET) } els{ 0 (>K:COWLFLAP1_SET) }
(L:CARVAR_cowlflap_R, Number) 0 == if{ 16384 (>K:COWLFLAP2_SET) } els{ 0 (>K:COWLFLAP2_SET) }

Manifold Heat
(A:GENERAL ENG ANTI ICE POSITION:1, percent) 0 == if{ 16384 (>K:ANTI_ICE_GRADUAL_SET_ENG1) } els{ 0 (>K:ANTI_ICE_GRADUAL_SET_ENG1) }
(A:GENERAL ENG ANTI ICE POSITION:2, percent) 0 == if{ 16384 (>K:ANTI_ICE_GRADUAL_SET_ENG2) } els{ 0 (>K:ANTI_ICE_GRADUAL_SET_ENG2) }

Be mindful of the correct application of space characters in AAO RPN code. They are VERY important.


LORBY-SI

Share this post


Link to post
Share on other sites

That did the trick.

I sent this and the shutter opened. I should have asked you sooner. Thanks!

100·(>L:Denarq_OILSHUTTER_SET_1,·Number)

 

Share this post


Link to post
Share on other sites
Posted (edited)
3 minutes ago, riveter said:

That did the trick.

I sent this and the shutter opened. I should have asked you sooner. Thanks!


100·(>L:Denarq_OILSHUTTER_SET_1,·Number)

 

Yes, looks like the thing goes from 0 to 100. Just make sure that it is actually operating the oil shutter too. It can happen that the LVar is just moving the lever through its animation.

In this case you should be fine though. And you can operate this with an axis too btw. Just type "L:Denarq_OILSHUTTER_SET_1, Number" into the "Enter Variable" box on the Axis dialog and set Axis Min to 0 and Axis Max to 100

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

I can get it working with the On and Off but not the toggle. I put this on a button as type 'S' and it does not work. I just wiggles a bit.

(L:Denarq_OILSHUTTER_SET_1, Number) ! (>L:Denarq_OILSHUTTER_SET_1, Number)

Share this post


Link to post
Share on other sites
3 minutes ago, riveter said:

I can get it working with the On and Off but not the toggle. I put this on a button as type 'S' and it does not work. I just wiggles a bit.

(L:Denarq_OILSHUTTER_SET_1, Number) ! (>L:Denarq_OILSHUTTER_SET_1, Number)

As I wrote above, my script assumes that the LVar goes between 0 and 1. But it doesn't, the range is 0 to 100. So you do the same thing as in your other scripts, use an if{

(L:Denarq_OILSHUTTER_SET_1, Number) 0 == if{ 100 (>L:Denarq_OILSHUTTER_SET_1, Number) } els{ 0 (>L:Denarq_OILSHUTTER_SET_1, Number) }


LORBY-SI

Share this post


Link to post
Share on other sites
Posted (edited)

Also I have trouble with the AAO Toggle button sometimes. If I get the green light out of sync I can never get it back in sync by changing the icon. I have to start a new button to get it back in sync. Any advice on how to get the green light back in sync?

I think I figured this out. I closed the Stream Deck and opened it and the lights had changed.

Edited by riveter

Share this post


Link to post
Share on other sites
Posted (edited)
14 minutes ago, Lorby_SI said:

As I wrote above, my script assumes that the LVar goes between 0 and 1. But it doesn't, the range is 0 to 100. So you do the same thing as in your other scripts, use an if{

(L:Denarq_OILSHUTTER_SET_1, Number) 0 == if{ 100 (>L:Denarq_OILSHUTTER_SET_1, Number) } els{ 0 (>L:Denarq_OILSHUTTER_SET_1, Number) }

That works. Thank you!

Edited by riveter
correction

Share this post


Link to post
Share on other sites
Posted (edited)
11 minutes ago, riveter said:

Also I have trouble with the AAO Toggle button sometimes. If I get the green light out of sync I can never get it back in sync by changing the icon. I have to start a new button to get it back in sync. Any advice on how to get the green light back in sync?

What is an "AAO Toggle Button"? I'm not sure about what you mean. I'm not aware of any use case called "Toggle Button" in the AAO app.

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites
6 minutes ago, Lorby_SI said:

What is an "AAO Toggle Button"? I'm not sure about what you mean. I'm not aware of any use case called "Toggle Button".

It is a button type from the AAO plugin for Stream Deck. There is a green light to show the on state.

Share this post


Link to post
Share on other sites
Posted (edited)
3 minutes ago, riveter said:

It is a button type from the AAO plugin for Stream Deck. There is a green light to show the on state.

Oh, on the StreamDeck. Right.

If the toggle gets out of sync, then your read variable is either wrong, or you are checking for the wrong value. The "problem" with the toggle is, that it uses the "native" two images from the StreamDeck software. Every time you click on the button the image changes, regardless of the read variable. If then the read variable is not 100% correct, your button will show the wrong state. Solution: make sure to use the correct variable and the correct value for "ON" (in the example above that would probably be 100, not 1). If that is not possible, use a different StreamDeck Action (MultiGauge or SliderGauge).

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

I now have all my flaps and shutters on buttons. The Denarq mod makes it so you have to manage the engine systems or you can burn the thing up. If you take off with cold oil, the engines will soon fail. Hence the need for controlling the shutters and such. I will now monitor the temperatures and make sure my buttons are actually controlling the shutters and not just the levers as you suggested.

Thanks again for you help.

Share this post


Link to post
Share on other sites

I just discovered a better way to change the Toggle button icon. Change the icon and then change Stream Deck profile and then change back to the original profile. That will show the new icon.

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