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!


question

Mr_LiamT avatar image
Mr_LiamT asked DA40CGDFQ commented

Can you use persistent variables with RPN?

Is there a way to use persistent variables with RPN code? Maybe by accessing StoredData variables from JavaScript panels.

I have a toolbar panel where users can change settings. The settings are used by a mission calculator, but it can only get the settings if the toolbar panel is active. This means the user has to open the toolbar panel to load their settings. I would like to have the mission calculator access storedData directly, so it can load the settings independent of the toolbar panel.

missionhtml
10 |10000

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

1 Answer

·
Ariebaba avatar image
Ariebaba answered DA40CGDFQ commented

In every .FLT file you can add a section [LocalVars.0] where you can put variables to use with RNP code. These text file can be accessed through your javascript program.

But be careful .FLT and .cfg files are not forgiving. You can make a small mistake in your xml files but a mistake in the .FLT files will CTD MSFS.

Hopefully this points you in the right direction. Maybe there are more elegant solutions?

2 comments
10 |10000

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

Mr_LiamT avatar image Mr_LiamT commented ·
Thanks, that could be handy for missions. Unfortunately my application is in freeflight, so I can't set the data in the .FLT file. Hopefully there is another way that works using only RPN
0 Likes 0 ·
DA40CGDFQ avatar image DA40CGDFQ Mr_LiamT commented ·

review the SDK [localvars] section in the systems.cfg - can your app write to LVars?da40cgdfq-03-20220904-12h45m34s.png

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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