#Longitude

1 messages · Page 1 of 1 (latest)

final swift
#

I'm trying to work out the MF Input codes for the Fuel Boost Pump, and Fuel Transfer (L Tank, Transfer, R Tank). I retrieved the following from Dev Mode / Behaviours, neither varation works. What should be the correct syntax to type them into the MF preset code box? I'm not sure how to read the correct codes from the Behaviours window in MSFS.

WT_LNG_FUEL_PUMP_1_ON

(0:FUEL_Boost_Pump_1_Position) : 0.0000

royal ermine
final swift
#

Thanks Jamie. So, if I don't see a KVAR under the Set tab within the Preset ID panel (in Behaviours), then can I assume we can't actually assign a code for this? For example, for the Longitude Fuel Transfer Selector, I get the following:

#

p0 2 min 0 max (>O:FUEL_Transfer_Selector_Position) (O:FUEL_Transfer_Selector_Position) s0 l0 0 == if{ -1 (>L:WT_LNG_FUEL_TRANSFER_DIRECTION) g1 } l0 1 == if{ 0 (>L:WT_LNG_FUEL_TRANSFER_DIRECTION) g1 } l0 2 == if{ 1 (>L:WT_LNG_FUEL_TRANSFER_DIRECTION) g1 } :1

#

... so I guess I'll have to forget about coding a switch for that one (and a few others such as the Fuel Boost Pump) and move on to the next item???

royal ermine
#

Not correct in your assumption

#

We cannot access O: or I: variables or B: events, but we do have access to A: E: L: variables and K: events.

In this code you posted, the logic to decide the switch position is controlled by an O: var, but the action is to set an L: var. The action is what you want to take because in most cases, you only want to program one specific switch position at a time.

#

So in Mobiflight you would want three events each with separate code :
Pos 0
-1 (>L:WT_LNG_FUEL_TRANSFER_DIRECTION)

Pos 1
0 (>L:WT_LNG_FUEL_TRANSFER_DIRECTION)

Pos 2
1 (>L:WT_LNG_FUEL_TRANSFER_DIRECTION)

final swift
#

Thanks again, wow - I'm gradually learning this material. So, I just copy and paste those 3 lines separately for my 3 switch positions and I'll let you know how it goes. Is there meant to be a space between the -1, 0 and 1 ... and the opening bracket?

royal ermine
#

Yes

#

Space is required

final swift
#

Ta. Also, on a completely different query, I understand that keyboard commands are not possible from MF to MSFS. I had a switch setup on my overhead to toggle VR on and off. Am I still able to code that somehow via MF? If not, I could try and use my Elgato ... but that's a whole new challenge.

royal ermine
#

No direct keyboard input from MF to MSFS2020. You might be able to do it from MF to Vjoy to MSFS.

#

There is no Simconnect access to switch for VR?

final swift
#

Not sure what you mean by 'Simconect access to switch VR'?

royal ermine
final swift
#

Hi Jamie, I tried those 3 codes for the fuel selector in the Longitude, but unfortunately they did nothing - I got no response in MSFS.

royal ermine
#

Show the Input config you used please

#

@final swift

final swift
#

I tried:
-1 (>L:WT_LNG_FUEL_TRANSFER_DIRECTION)

#

and on another pin setup I tried:
1 (>L:WT_LNG_FUEL_TRANSFER_DIRECTION)

royal ermine
#

Yes, I want to see a screenshot of the Input config

final swift
#

The action type was MSFS2020, and I just chose custom code, and copied and pasted this inot the preset code box and the lower section.

#

Thanks ...

royal ermine
#

That looks ok

#

I just adapted the code you posted. I can take a look later, maybe 2 hrs from now.

final swift
#

No worries, many thanks.

royal ermine
#

Meanwhile, verify your switch action is detected by Mobiflight in the log mode.

royal ermine
#

ok, I had a look in the Longitude.

#

@final swift

#

The switch animation is controlled by an O: var, so there isn't much we can do to move the switch, but the sim function does work with the L: variable. You can check the PFD status says

#

when the Lvar is changed from 0 to 1

#

For the fuel pump switches
(L:WT_LNG_FUEL_PUMP_1_ON) ! (>L:WT_LNG_FUEL_PUMP_1_ON)

#

will toggle the pump 1 on and off

#

just change 1 to 2 for pump 2

royal ermine
#

I have added the new events in Hubhop for Boost pumps, gravity Xflow, and Transfer selector.

final swift
#

Gee, that's interesting Jamie, thanks. I hadn't thought to check the PFD for executed actions - so I'll run a test on that tonight ... and perhaps that applies to several items I thought I couldn't encode. So, if I see the LVAR code when using the Behaviour, I can pretty much copy and paste the syntax exactly as it, and it'll probably work??? I'll then need to find 'where' in the sim I can verify if my switch execution actually did work or not - seeing as the OVAR may not trigger the visual.

royal ermine
final swift
#

Thanks, yes it works! I'm wondering though why the ! in the middle of the repeated code (why doesn't just having the first string work - why is it repeated with the ! in the middle)?

#

I've taken it a step further and made it a switch instead of a toggle, with the following:
ON Event:
(L:WT_LNG_FUEL_PUMP_1_ON) 0 == if{ 1 (>L:WT_LNG_FUEL_PUMP_1_ON) }

OFF Event:
(L:WT_LNG_FUEL_PUMP_1_ON) 1 == if{ 0 (>L:WT_LNG_FUEL_PUMP_1_ON) }

for the record, I found this example to turn a toggle into a switch, and not sure whether it was on Discord or not, but I think what was posted had a typo, as the OFF Event had (excerpt) ... 1 == if{1 (>K:TOGGLE ... and I had to change it to ... 1 == if{0 (>K:TOGGLE ... (because we're asking if it's on, then turn it off, and if it's off, then turn it on).

Have I got that right (it works for both L and R, and as a switch rather than as a toggle, so all good!)? Thanks again :).

royal ermine
final swift
#

Just wondering why you'd written it up to be coded as:
(L:WT_LNG_FUEL_PUMP_1_ON) ! (>L:WT_LNG_FUEL_PUMP_1_ON)
(with the ! in the middle of the two identical strings)???

royal ermine
#

Because "!" is the NOT operator. It inverts boolean values. So the statement reads the variable, inverts it and writes it back.

#

They are not identical strings

#

The ">" is for setting a value

final swift
#

Ah, got it thanks ... READ, invert, WRITE it back. I'm assuming with these ones you can't just do a direct command by putting a 1 or 0 up front (but I don't know it's ok to do that and when it's not).

royal ermine
#

You put a 0 or 1 in front of setting a boolean variable value.

final swift
#

Thanks, not quite quite sure of what you mean by setting a boolean variable value. Should it work to simply put:

#

0 (>L:WT_LNG_FUEL_PUMP_1_ON), or

#

1 (>L:WT_LNG_FUEL_PUMP_1_ON)

royal ermine
#

Yes, it should work