Jump to content
The simFlight Network Forums
FlyingCoder

How can i track number of passengers ?

Recommended Posts

Hello, is there a way for me track the number of passengers boarding the plane? I'm trying to integrate how gsx track the number of passengers boarding the planes but no idea how

Share this post


Link to post
Share on other sites

FSX and P3D do not simulate passengers.

If you have GSX and want to track GSX passengers then I think there are L:Vars you can access. I don't have GSX so you'll need to ask in their support forums. Or they may have an SDK you can download.

Paul

Share this post


Link to post
Share on other sites

Yes you can use offsets 0x3380 and 0x32FA. See the offsets documentation for details, but in summary:

  1. Declare an offset for 3380 (string with length 128)
  2. Declare an offset for 32FA (Short)

It's important they are in this order. 3380 must be declared first.

Mark them both as write only and put them in their own group (e.g. SendText).

When you want to write text:

  1. set the text in 3380.
  2. Set 32FA depending on how to want the text displayed (see the docs).
  3. Process the "SendText" group.

Paul

Share this post


Link to post
Share on other sites

Paul, I badly need an example code for visual basic which shows reading an Lvar value and then assigning to an offset value. Can you simply give me an example code block which sends PMDG 738's seatbelt switch LVar value to an offset? I've created a great application by your marvellous dll, it works on standart offsets so far, but I'd like to start improving it by making some special dll s for some specific aircraft.

Share this post


Link to post
Share on other sites

Hi,

First you need to decide which Offset you are going to write to. There is a block of unused offsets starting at 0x66C0. Also decide how many bytes you need for the value and what data type you want. Then declare this offset.

For the seat belt status we only need one byte so we'll declare it like this:

Private pmdgSeatBelt As Offset(Of Byte) = New Offset(Of Byte)("PMDG", &H66C0, True)

Then, to read the LVAR and copy the value into that offset you do this: (I don't know that the actual LVAR name is - I've just made something up here).

       ' Read the LVAR
        Dim seatBeltSwitch As Double = FSUIPCConnection.ReadLVar("L:SeatBeltSelector")

        ' Write value to user offset
        pmdgSeatBelt.Value = CByte(seatBeltSwitch)
        FSUIPCConnection.Process("pmdg")

However, do you really need to copy it into an offset? You already have the LVAR value when you execute the first line (value is in seatBeltSwitch).

Also, reading LVARs is very very slow compared to offsets. You should only use LVARs as a last resort.

The PMDG 737 (and other PMDG aircraft) have a special set of offsets. You can find these in the PDF file in the "Modules\FSUIPC Documents" folder. e.g. "Offset Mapping for PMDG 737NGX.pdf".

The offset for the 737 seatbelt selector would be declared as:

Private PMDG_737_FastenBeltsSelector As Offset(Of Byte) = New Offset(Of Byte)("PMDG_737", &H649F)

See the document for how to enable these offsets.

I recommend using these offsets instead of LVARs where available.

Paul

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • 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.