Ok, for anyone following my convoluted brainâŠ
This is where I am in making aircraft save their states:
I believe I can use DataStore.js to create L:Vars which I can save in between sessions? If thatâs the case I can then read SimVars for switches, tank levels etc. and write them to my custom variables and read back on aircraft loading
So as I understand so far, to use the DataStore.js I need to use this in a glass cockpit gauge. The only gauges available in the G36 are the NXi.
I have added the following folder structure to the G36 Improvement Project
In AS1000_PFD.html I have the following code (this loads the NXi PFD and then my own on top?
Code:
<script type="text/html" import-script="/Pages/VCockpit/Instruments/NavSystems/WTG1000/PFD/WTG1000_PFD.html"></script>
<script type="text/html" import-script="/Pages/VCockpit/Instruments/NavSystems/G36XG1000/PFD/G36XG1000_PFD.html"></script>
In G36XG1000_PFD.html I have the following code - which I am assuming loads before the NXi?
Code:
<script type="text/html" import-script="/JS/dataStorage.js"></script>
<script type="text/html" import-script="/JS/coherent.js"></script>
<script type="text/html" import-script="/Pages/VCockpit/Instruments/NavSystems/G36XG1000/PFD/G36X_Utils.js"></script>
G36X_Utils.js I have:
Code:
console.log('Hello World');
1 (>L:XMLVAR_TEST_FUEL)
I can see the hello world console log which is a real win! (well for me anyway!) When I try and set a simple L: var I get errors in the console. When I use an arbitrary L: Var from somewhere else like:
Code:
console.log('Hello World');
1 (>L:XMLVAR_GPS_Approach)
it doesnât error, so Iâm obviously missing something here.
What I need to do now, is understand the best way to write in G36X_Utils.js and create a simple L: variable that I can display in the NXi; iâm obviously not initiating the L: Var correctly in my mind.
If I can get it to work, from there that gives me a foundation to build on for using DataStore in the JS file.
As ever, many thanks for any pointers or thoughts from anyone.
@kaosfere4829 & @Bishop398 Realise you guys extremely busy but if you have any thoughts Iâd really value them!