Page 1 of 1

Accessing known Local Variables in FS2020

Posted: Sun Apr 11, 2021 5:59 pm
by Helibrewer
:?: I know the names of the LVars for the aircraft I am addressing. The are in the model's xml file and I have verified them with the developer and through watching the local variable values in Developer Mode in FS2020. Now my question is, how do I access them? I have tried this:

Code: Select all

 -- Get state of softkey
            function MFDR_SK_T_1(state)
                status = state
                print("Status is:")
                return status
            end

fs2020_variable_subscribe("L:MFDR_SoftKey_Top_1","bool",MFDR_SK_T_1)
        
            if status == o then
            
                function MFDR_Top_1_click()
                    fs2020_event("L:MFDR_SoftKey_Top_1")
                    sound_play(click_snd)
                    fs2020_variable_write("L:MFDR_SoftKey_Top_1", bool, 1)
                end    
                    else
                    fs2020_variable_write("L:MFDR_SoftKey_Top_1", bool, 0)
                end
            
                MFDL_L1 = button_add(nil, "top_btn.png", 82,6,32,32, MFDR_Top_1_click)
Thanks,
Mike

Re: Accessing known Local Variables in FS2020

Posted: Sun Apr 11, 2021 6:44 pm
by Ralph
Lvars don't work at the moment because of Microsoft's shitty plugin system. But we're probably gonna work on a dirty workaround later on.

Re: Accessing known Local Variables in FS2020

Posted: Sun Apr 11, 2021 6:57 pm
by Helibrewer
What does the Mobiflight wasm expose?

Re: Accessing known Local Variables in FS2020

Posted: Sun Apr 11, 2021 7:20 pm
by Ralph
I'm not sure, I never use it. But they (Mobiflight) use this same 'dirty' workaround. I just wish Microsoft worked on their plugin system... That WASM nonsense of them is crap.