Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Read LVars from sim fails

Featured Replies

Hi,

As ist says in the title - I try to read the LVars from the BKSQ TBM850, but it keeps failing. My version is 4.10b51, and lorbysi-content-hooks is present in Community.

I'm trying to find the variable for a specific button.

Boris

 

Edited by borisvp

  • Commercial Member
17 hours ago, borisvp said:

but it keeps failing

What does that look like? Are you flying in MSFS Beta or the normal production version?

17 hours ago, borisvp said:

I'm trying to find the variable for a specific button.

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". The BKSQ TBM850 has a few of those.

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. 

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)

What button are you looking for exactly?

Edited by Lorby_SI

LORBY-SI

  • 3 months later...

I’m having same issue. Specifically the cabin light switch and access button right under it.

  • Commercial Member
29 minutes ago, joker20001911 said:

I’m having same issue. Specifically the cabin light switch and access button right under it.

Sorry, but what exactly is "the issue"? I never got an answer from the OP.

Did you look at the behavior code of that switch and button in MSFS developer mode?

Edited by Lorby_SI

LORBY-SI

I found the behavior. 
15 16 (>K:2:ELECTRICAL_BUS_TO_BUS_CONNECTION_TOGGLE)

but I don’t know how to program that into streamdeck or find as a receiving event

I’m very new at scripting and computering lol. I was able to get basic stuff (landing lights, etc) that use the basic events. But it’s these more complicated ones I don’t know what to do with that code once I find it.

  • Commercial Member
9 minutes ago, joker20001911 said:

I found the behavior. 
15 16 (>K:2:ELECTRICAL_BUS_TO_BUS_CONNECTION_TOGGLE)

but I don’t know how to program that into streamdeck or find as a receiving event

Are you sure that this is it? Seems odd.

Anyway, one option is this: on the Streamdeck, select Type "S:" (for "script"...) and paste the code from above into the box, exactly like it is.
Put "0" into the value box, do not leave it empty (even if it doesn't make sense in this context)

The other option is to paste the code into an AAO script and call that script from the SD.

I'm having trouble starting MSFS currently, but I will look at it too as soon as it is working again.

Edited by Lorby_SI

LORBY-SI

  • Commercial Member

The script for the access light button is this

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

To query the value (=see if the light is on or off), just use the LVar (every button press makes it alternate betwenn the values 0 and 1)
(L:var_AccessLights_Button, Number)

Edited by Lorby_SI

LORBY-SI

  • Commercial Member

What does that CABIN switch actually do? I can't see any effect?

Here is how you query it (you would have to use type "S:" again for the read variable on the SD Action)

16 (>A:BUS LOOKUP INDEX, Number) (A:BUS CONNECTION ON:15, Bool)

 

Edited by Lorby_SI

LORBY-SI

6 minutes ago, Lorby_SI said:

What does that CABIN switch actually do? I can't see any effect?

Here is how you query it (you would have to use type "S:" again for the read variable on the SD Action)


16 (>A:BUS LOOKUP INDEX, Number) (A:BUS CONNECTION ON:15, Bool)

 

It allows the cabin lights to be able to illuminate once the buttons are pushed. The access lights are the 2 lights with one button on the roof of cabin, cabin lights are the 2 lights with a switch for each

  • Commercial Member
4 minutes ago, joker20001911 said:

It allows the cabin lights to be able to illuminate once the buttons are pushed. The access lights are the 2 lights with one button on the roof of cabin, cabin lights are the 2 lights with a switch for each

OK, thanks.

So that is why the CABIN switch only makes the electrical connection for the lights circuit, it isn't the actual lights switch.

Edited by Lorby_SI

LORBY-SI

No problem. Yes it seems that way. The read variable for the cabin only seems to work if a cabin light is on, not when you flip the cabin switch. Hmm

  • Commercial Member
41 minutes ago, joker20001911 said:

The read variable

You mean this:

16 (>A:BUS LOOKUP INDEX, Number) (A:BUS CONNECTION ON:15, Bool)

Isn't that what it says in the behavior code? What controls the animation (=the switch position)?

Edited by Lorby_SI

LORBY-SI

Yes. You are right. I am using a onoff toggle in SD. The switches now work just don’t light up green on SD using default picture when switched on

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.