Jump to content
The simFlight Network Forums

Getting the title, model or exact type of aircraft and using LVAR to set value for GSX?


FlyingCoder

Recommended Posts

Hi Pete,

I am using your FSUIPC for my own application.

Firstly, I would like to ask, how am i able to get the exact model or type of the aircraft that user if flying or loaded. For example, Fenix A320. Fenix A320 has different liveries. How do i know if that particular user or simmer is using Fenix A320 regardless of its livery?

Secondly, i am using LVAR for fenix as an example to get the number of PAX being loaded using GSX. Lets say boarded is 50pax. I did a a short flight which is around 1hr or so. Took off, application states 50pax. Landed and deboard the pax and noticed that it reset back to 0pax. How do i prevent this from being reset?

I hope to get your answer. Thank you!

Link to comment
Share on other sites

1 hour ago, FlyingCoder said:

Firstly, I would like to ask, how am i able to get the exact model or type of the aircraft that user if flying or loaded. For example, Fenix A320. Fenix A320 has different liveries. How do i know if that particular user or simmer is using Fenix A320 regardless of its livery?

All there is is the full aircraft title from the aircraft.cfg file, available in offset 0x3D00. It is up to you how you interpret that - for example, FSUIPC uses a substring match for that in the aircraft names in a profile to match to a profile, which is why we recommend changing the aircraft name in the profile section to be a substring match to catch the same aircraft with different liveries. I also allow matching based on the folder name of the folder where the aircraft.cfg file is located (see ini parameter UseAirLocForProfiles) which should catch the same aircraft regardless of livery, but this is not held in an FSUIPC offset.

1 hour ago, FlyingCoder said:

Secondly, i am using LVAR for fenix as an example to get the number of PAX being loaded using GSX. Lets say boarded is 50pax. I did a a short flight which is around 1hr or so. Took off, application states 50pax. Landed and deboard the pax and noticed that it reset back to 0pax. How do i prevent this from being reset?

You can't. as that is created and being updated by the Fenix (or GSX), so you cannot stop it being updated. What you can do is just copy the value to your own lvar, and then it is up to you to reset it. Just execute the calculator code "L:lvarToBeSaved (>L:myLvar)" to save the value of L:lvarToBeSaved  to L:myLvar. Alternatively, you can always save it to an FSUIPC offset (using Lua).

Note that in the current official version of FSUIPC7 you will have to issue a WASM reload to get visibility of the lvar you create. In the next release, any new lvars found by the WASM will be automatically pushed out to the clients (including FSUIPC). This version is currently available as a beta release (7.3.17a) in the Announcements sub-forum.

Btw, Pete retired a few years ago now.

John

Link to comment
Share on other sites

  • 1 month later...
4 hours ago, FlyingCoder said:

For the PAX number, does it varies for different aircrafts?

Not sure what you mean by this... and probably a question on GSX not FSUIPC. To manually set the number of passengers to board in GSX, see 

Plenty off other results in google for GSX PAX number and the Fenix, so try there...

John

 

Link to comment
Share on other sites

Hi John,

Thanks and will do. I am using .netframework 4.7 for my windows app. However, after i use your latest FSUIPCclient dll, i am getting object reference not set to an object when trying to call GSX boarding.

FsLVar GSX_Getboardingstate = MSFSVariableServices.LVars["L:FSDT_GSX_BOARDING_STATE"]; // Gives the object not set reference error 
// after using latest FSUIPC Client DLL

I have also included the fsuipc-lvar module in my MSFS community folder.
Before this, there was no issue. Is it compatibility issue where the latest version of FSUIPCclient only supports .net6.0?

Also, im using your c# application sample to view the Lvars in MSFS but the app does not show any Lvars available. FSUIPC said there are 220 ish Lvars.

Do advise me if its compatibility issues or what i could have done wrong. Thank you

 

Link to comment
Share on other sites

58 minutes ago, FlyingCoder said:

i use your latest FSUIPCclient dll

That is provided by Pail Henty, and any questions on that should be directed to the support sub-forum fir this: https://forum.simflight.com/forum/167-fsuipc-client-dll-for-net/

58 minutes ago, FlyingCoder said:

im using your c# application sample to view the Lvars in MSFS but the app does not show any Lvars available. FSUIPC said there are 220 ish Lvars.

I don't provide any C# clients, so that is probably also Paul's.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.