#Found vars but how do I use them?

1 messages · Page 1 of 1 (latest)

umbral basin
#

I have found the following in dev mode:
When the end value is 1 it's a switch set to auto and when 0 it's manual. How do I implemetn this into Mobiflight?

noble heart
#

O: vars are not accessible from outside.

umbral basin
#

ok, cheers Jamie, it was to be an answer for somebody asking about the fuel switch.

#

are they part a templete

noble heart
#

show me what the dev mode, input events code for that

umbral basin
noble heart
#

put the set event in the control panel

umbral basin
#

bugger just took that off 🙂

noble heart
#

Come on Steve, you need to uncheck Minimize and press the reload user container button

umbral basin
#

oh fiddle,l forgot

noble heart
#

No code is shown while the sim is in optimized mode

umbral basin
#

have I done that right?

odd flax
#

Mmm, doesn't look quite right, that code isn't setting the value at all

#

make sure to follow the steps in the link the bot's about to send, it'll have info on how to display the right part

pale whaleBOT
umbral basin
#

This is with the dev mode, if you set the values and use execute, the switch does move. Jamie has been helping a little, it's now a long day for me and I need to sleep soon

#

somebody else was asking about this switch but nobody had answered earlier and thouight it would be as easy as the Vulcan inputs I found but it's not. Incidentaly, this switch is on the TBM930

umbral basin
#

Hi Jamie, looking on Hubhop and I see you did all the fuel switches apart from this one, that should have given me a clue.

noble heart
umbral basin
#

Hi Jamie, cheers, I didn't look at selector 1 at all with the other function being auto/manual and the execute from that operating the switch, it is a switch not a knob. Didn't you say you couldn't use O vars? The function for the switch is lowerdown in that list, in the VC it's on the upper panel on the RHS half.

noble heart
#

You still can't use O: vars from outside, but the action is really done by (>K:FUEL_SELECTOR_SET)

#

With prefixed values of 0 for OFF, 2 for LEFT and 3 for RIGHT

#

The toggle event in Hubhop works ok. I tested it.

#

Toggling between 2 and 3

#

is this not what you were looking for?

umbral basin
#

I've used that and yes it woks but it's for the fuel control below the throttle, the switch I was looking at was for somebody else and it's on the upper panel, I did try K, L etc but didn't get it working. I may have to go off line. I didn't sleep last night.

noble heart
#

ahh I see it now.

#

Unfortunately, the code only uses o: vars so not much we can do from outside.
The only way would be to access the B: event through an xml file hack.

#

It involves hooking a custom Lvar that we can control to call the B: event.

spice cipher
#

that B: event should work in msfs2024 , but unfortunately not in 2020

umbral basin
#

The hacking then is going to be similar to what we did with the Lancaster, I was hoping to help somebody else with this tbm930.

weary beacon
#

don't know if it works still as its a couple of years old but you could try this - https://flightsim.to/file/57918/tbm930-lvars-for-bleed-inert-and-cabin-lights

noble heart
#

Interesting, I think this addon uses the xml file hack I was referring to.

umbral basin
#

Have tried these: on press 2 (>L:TBM930_FUEL_SELECTION_SET) and on release 1(>L:TBM930_FUEL_SELECTION_SET) and they didn't work.

#

Can see where if I'm reading it right, it tries to write to the B var

noble heart
#

If this is like the xml hack, you set the Lvar value one higher than what you want to send to the B: event.

#

The code will auto reset the variable to 0.

umbral basin
#

either way, 1 or 2 it doesn't move.

#

these are 1 higher than what the Dev mode shows.

noble heart
#

1 will send 0 to the b:event

#

Only use on Press

#

Unless it is a latching switch

umbral basin
#

I have on press and on release

#

latching

noble heart
#

OK. Show me.

umbral basin
#

awkward, I'm on a low level like I did in the jet. give me a min

noble heart
#

OK you are missing a space after the number

umbral basin
#

no movement at all of the switch

#

I've already tried that

noble heart
#

Also you can check that the Lvar auto resets to 0 confirming the code is working.

umbral basin
#

I setup 2 controls one, without space and one with and only enabled 1 at a time

#

you mean watch the var in dev mode?

#

or in the values in MF?

noble heart
#

Both ways can work

umbral basin
#

I saw no change when running dev mode

#

was 1st thjing I did when it didn't work

#

let mje reload the tbm.

noble heart
#

If there is no auto reset I would suspect the xml code is not working

#

Are you sure the addon is in the Community folder? Did you restart msfs after installing the addon?

#

Full restart of msfs is required.

#

The VFS is only created once at start.

umbral basin
#

I didn't have the sim running when I put it there and I have already restarted at least once just in case.

#

lol. you've missed the screen shot i did earlier of the community folder

noble heart
#

Right now, since there is no auto reset to 0, I would suspect either the addon is not running or the Lvar name is not correct.

umbral basin
#

Is it worth chnage set to position?

#

I'll have a look at the xml file for names

#

could it be (L:TBM930_FUEL_SELECTION_SET, Number)

#

or is that just setting a number to be passed to the B var

noble heart
umbral basin
#

number was the problem

#

Number was the problem 🙂

#

I looked at the xml file

noble heart
#

Lack of the units "number"?

#

I would have never thought it was required.

umbral basin
#

2 (>L:TBM930_FUEL_SELECTION_SET, number)

#

not that, that's from the xml which works.

#

this was from the mod on flightsim.tom

#

so changing set to number fixed it

noble heart
#

You mean adding number?

umbral basin
#

This is all I did

#

typo above, added number

noble heart
#

Ok

umbral basin
#

There's a slight delay but that could be my gear

#

I'm using a switch on my radio control gear.

noble heart
#

There is probably a one second poll rate

umbral basin
#

well it's my radio control in emulation of joystick mode so more processing. On that line above must it have the 2 or 1 at the beginning.

noble heart
#

Yes, you need to set a value different from 0

umbral basin
#

ok cheers. I'll pass this onto the other gut that had originally asked about it, think you had a chat with him.

#

I'll have a quick test with none latching then let them know.

#

none latching ok.

#

but I would prob swap press to release and vice versa

noble heart
#

Any method to set an Lvar value ought to work

umbral basin
#

leaving Auto as the un pressed condition