plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.


Please take a moment to read the platform’s guidelines before you get started!


Idea

Fragtality avatar image
Fragtality suggested ericmarciano commented

Clear Aircraft Lvars after unload of that Aircraft

Currently when a User switch from one Aircraft to another, all Lvars from the previous Aircraft are still present.

This causes Issues with Addons like FSUIPC and Applications which build upon that (like my StreamDeck-Plugin). The Issue being that some Lvars can't be accessed.

See: https://forum.simflight.com/topic/97132-missing-lvar-after-3066-lvars-loaded-since-su11/

The Lvars should be cleared after the Aircraft was unloaded - they are not usable anymore anyway!

simconnectwasm
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

4 Comments

·
runshotgun avatar image
runshotgun commented runshotgun edited

LVars are not assigned to a specific aircraft, they are globally accessible and can be read/write by anything in-sim without the need for a context. We (//42) use it for various things that aren't even related to an aircraft.

That makes it near impossible to track and remove when an aircraft is switched.

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

N6722C avatar image
N6722C commented

So it becomes up to the "New loaded aircraft" to Initialize any critical Lvars it uses to an appropriate know state ? Good to know .

1 comment
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

runshotgun avatar image runshotgun commented ·
Yep!


Not only do we initialize some vars when the aircraft is loaded, We also use unique var names (P42_FF_*) to ensure it doesn’t conflict with anything else

0 Likes 0 ·
Fragtality avatar image
Fragtality commented

Well it comes down to the internal Handling of MSFS - it can correlate the Creator with the L-Var, it could know when to clear it.

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

ericmarciano avatar image
ericmarciano commented

Another way to solve this problem would be to clear the Lvars when the aircraft is "unloaded", that is when the user switches to another aircraft or ends the flight. So the question is: Is there a way to detect this? I knew how to do it with FSX but not with MSFS :)

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Write a Comment

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.