• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

MSFS24 GSX, LVARS & Some basic questions

Messages
12
Country
germany
Hello everyone,

I’m currently working on integrating GSX into one of my projects.
After some research and prototyping, I’ve come across a few questions and issues that I’d like to clarify.

As far as I know, it wasn’t possible to read or write LVARS from a SimConnect executable prior to SU2-2020. Please correct me if I’m wrong.
Reading GSX LVARS isn’t a problem, for example, I’m able to retrieve the Boarding State without any issues using my SimConnect executable.

Now, my first question is:
Can LVARS only be written to from within WASM modules, or is it also possible to set them from external SimConnect executables?
The reason I ask is that while debugging a prototype, I attempted to set the following:

SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1, "L:FSDT_GSX_DEBOARDING_CARGO", "Number");
Since I’m relatively new to more complex SimConnect programming and C++ in general, I’m not entirely sure if I approached this correctly. For other use cases, such as writing to SimObjects, I’ve used SimConnect_SetDataOnSimObject, and that worked flawlessly.

I tried to set the GSX LVAR to 1 using SimConnect_SetDataOnSimObject, hoping it would trigger GSX to start deboarding cargo, based on my interpretation of the GSX documentation.
However, nothing happened.

I’ve spent quite some time researching this online, but couldn’t find a clear answer. I’d really appreciate any advice or clarification on whether it’s even possible to interact with LVARS using an external .exe that relies on SimConnect.

Thanks a lot!
 
Hi, yes, it's possible to set L vars with SetDataOnSimObject(). Basically L vars work the same as Sim Vars with SimConnect, just using the "L:" prefix in the name when adding to definition. You can also create/set/read your own L vars just by creating a definition for one (with some unique name).

I don't know about GSX, so not much help there. If you're not getting errors or any other obvious issues with SetDataOnSimObject then the simplest answer is that setting the FSDT_GSX_DEBOARDING_CARGO variable just doesn't work as you expect it to, or maybe even at all... don't assume it's your code. Try setting a test L var to verify your process, and if that works then setting any other L or Sim var will also work (whether that produces a desired reaction from the sim is another matter).

HTH,
-Max

PS. You can see all current Local vars and their values, including any you add yourself, in the Dev Mode Behaviors Inspector window.
 
Last edited:
Hi, yes, it's possible to set L vars with SetDataOnSimObject(). Basically L vars work the same as Sim Vars with SimConnect, just using the "L:" prefix in the name when adding to definition. You can also create/set/read your own L vars just by creating a definition for one (with some unique name).

I don't know about GSX, so not much help there. If you're not getting errors or any other obvious issues with SetDataOnSimObject then the simplest answer is that setting the FSDT_GSX_DEBOARDING_CARGO variable just doesn't work as you expect it to, or maybe even at all... don't assume it's your code. Try setting a test L var to verify your process, and if that works then setting any other L or Sim var will also work (weather that produces a desired reaction from the sim is another matter).

HTH,
-Max

PS. You can see all current Local vars and their values, including any you add yourself, in the Dev Mode Behaviors Inspector window.
Hey Max,

thanks a lot!
SimConnect inspector didn´t showed any exception during runtime while setting the LVAR, so I guess my implementation works after reading your answer.
I will try to see what happens in the Behaviors Inspector, this is a great adive!

Thanks and enjoy your weekend :)
 
Back
Top