Accessing known Local Variables in FS2020

Help creating logic scripts for Air Manager Instruments

Moderators: russ, Ralph

Post Reply
Message
Author
Helibrewer
Posts: 20
Joined: Thu Jan 14, 2021 2:20 am

Accessing known Local Variables in FS2020

#1 Post 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

User avatar
Ralph
Posts: 7878
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Accessing known Local Variables in FS2020

#2 Post 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.

Helibrewer
Posts: 20
Joined: Thu Jan 14, 2021 2:20 am

Re: Accessing known Local Variables in FS2020

#3 Post by Helibrewer »

What does the Mobiflight wasm expose?

User avatar
Ralph
Posts: 7878
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Accessing known Local Variables in FS2020

#4 Post 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.

Post Reply