Lagaffe
Resource contributor
- Messages
- 994
- Country

Hi,
On one of my previous projects, I had adapted Ismail Hakki Güzel's Damage Mod to my C150K TiBush (2014).
It was composed by a set of XML gauges which calculated the wear of the elements and which via a 2D panel allowed to display the state of the plane, and even to repair the damaged elements.
The display of the maintenance panel was a 2D panel called by the SHIFT+Fx keys. This panel allowed to influence the state of the elements (failure => repaired) by inter action with the mouse.
Local variables storage was managed via the sound gauge of Doug Dawson (a *.gau for FSX and a *.dll for P3D/64b).
When I wanted to port this development to MSFS, I was confronted with a big problem : 2D panels are no longer managed by MSFS so we have to find another display mode. I want to try to describe in this post all my researches, tests and conclusions to this problem, at least I hope so.
Storage management for local variables can only be done via JS script and for the display, there are two possibilities:
- create a 3D element in the VC on which we display an XML gauge via the VCockpit0x tag
or
- add via the toolbar at the top of the interface an icon that would call an InGamePanel, which would be managed by HTML/JS code
At first, I chose the HTML/JS solution via an ingamepanel because it was easier to call the persistent data storage script directly via the display module.
To add a icon on the toolbar, first I have use a template found on : https://github.com/bymaximus/msfs2020-toolbar-window-template.
This one provide a "MSFS Project" structure, with you can compile a SPB file and join an icon which be display by MSFS in the toolbar and the files structure managed by HTML/CSS to display an additional window . This HTML code call the JS script to manage datastorage for persistent local variables between two flights (if you finish cleanly your flight using "QUIT TO DESKTOP" functionnality and not by cancelling MSFS with X icon).
Instead of going back and forth between the editor and MSFS, and after reading this MoMadenU thread: https://www.fsdeveloper.com/forum/threads/getting-started-with-fs2020-html-gauges.449513, I begin to build a local test environment, which recreates a "MSFS's VFS system" structure.
To do this, in a working directory you need to :
- copy all the directories and files present under ...Microsoft Flight Simulator\Content\Packages\fs-base-ui\html_ui (331Mb) which is in the launcher part of MSFS (Store version)
- copy in a directory at the same level the HTML/CSS/JS files
- modify in the HTML file, the paths allowing to reach the JS directory in the VFS
Before:
(to follow ...)
On one of my previous projects, I had adapted Ismail Hakki Güzel's Damage Mod to my C150K TiBush (2014).
It was composed by a set of XML gauges which calculated the wear of the elements and which via a 2D panel allowed to display the state of the plane, and even to repair the damaged elements.
The display of the maintenance panel was a 2D panel called by the SHIFT+Fx keys. This panel allowed to influence the state of the elements (failure => repaired) by inter action with the mouse.
Local variables storage was managed via the sound gauge of Doug Dawson (a *.gau for FSX and a *.dll for P3D/64b).
When I wanted to port this development to MSFS, I was confronted with a big problem : 2D panels are no longer managed by MSFS so we have to find another display mode. I want to try to describe in this post all my researches, tests and conclusions to this problem, at least I hope so.
Storage management for local variables can only be done via JS script and for the display, there are two possibilities:
- create a 3D element in the VC on which we display an XML gauge via the VCockpit0x tag
or
- add via the toolbar at the top of the interface an icon that would call an InGamePanel, which would be managed by HTML/JS code
At first, I chose the HTML/JS solution via an ingamepanel because it was easier to call the persistent data storage script directly via the display module.
To add a icon on the toolbar, first I have use a template found on : https://github.com/bymaximus/msfs2020-toolbar-window-template.
This one provide a "MSFS Project" structure, with you can compile a SPB file and join an icon which be display by MSFS in the toolbar and the files structure managed by HTML/CSS to display an additional window . This HTML code call the JS script to manage datastorage for persistent local variables between two flights (if you finish cleanly your flight using "QUIT TO DESKTOP" functionnality and not by cancelling MSFS with X icon).
Instead of going back and forth between the editor and MSFS, and after reading this MoMadenU thread: https://www.fsdeveloper.com/forum/threads/getting-started-with-fs2020-html-gauges.449513, I begin to build a local test environment, which recreates a "MSFS's VFS system" structure.
To do this, in a working directory you need to :
- copy all the directories and files present under ...Microsoft Flight Simulator\Content\Packages\fs-base-ui\html_ui (331Mb) which is in the launcher part of MSFS (Store version)
- copy in a directory at the same level the HTML/CSS/JS files
- modify in the HTML file, the paths allowing to reach the JS directory in the VFS
Before:
After:<script type="text/javascript" src="/JS/coherent.js"></script>
<script type="text/javascript" src="/JS/common.js"></script>
<script type="text/javascript" src="/JS/dataStorage.js"></script>
<script type="text/javascript" src="/JS/buttons.js"></script>
As this when you clic on the HTML file, you can obtain in a web browser, the display of that you have programmed since calls to included files like basic JS scripts and HTML templates can be resolved without error.<script type="text/javascript" src="../JS/coherent.js"></script>
<script type="text/javascript" src="../JS/common.js"></script>
<script type="text/javascript" src="../JS/dataStorage.js"></script>
<script type="text/javascript" src="../JS/buttons.js"></script>
(to follow ...)
Last edited:


