Jump to content
The simFlight Network Forums

Recommended Posts

Posted

I am not sure why the passenger load is not working. The fuel part loads fine. Here is my code. I have been testing on stock DA40NG in MSFS. Cargo variable is 0. So I am trying to load 510 which is equivalent to 3 passengers at 170lbs/pax. But the stations all remain zero. 

 

Also does the payload include the pilot station?

 

var fuelload = Math.round(plannedrecord.maxFuel * .75)
    var passengers
    if (plannedrecord.passengers === 0){
        passengers = 0
    }
    else {
        passengers = plannedrecord.passengers * 170
    }
 
    var payload = (510 + plannedrecord.cargo)
    console.log (payload)
    
    var request = {
        command: 'payload.autoload',
        volumeUnit: 'gal',
        weightUnit: 'Lbs',
        length: 'm',
        method: 'set',
        totalFuelWeight: fuelload,
        totalPayloadWeight: payload
    }
 
    // send to the server as a JSON string
    if (wsstatus !== 'null' || wsstatus !== 'error'){
        ws.send(JSON.stringify(request));
    }
Posted

I don't have MSFS so I can't test it here on the aircraft you're using.

To track down the problem can you please try:

Let me know if any of these work or not, but if they do work then the problem is somewhere in your code. You can examine the code behind the website pages (button at the bottom) to compare to your code.

Paul

Posted

Interestingly when I read back the payload after sending specific amounts I can see the stations have been loaded correctly at least data wise in MSFS:

 

payloadStations: [
    {
      index: 0,
      name: 'TT:MENU.PAYLOAD.',
      weight: 170,
      position: [Object]
    },
    {
      index: 1,
      name: 'TT:MENU.PAYLOAD.',
      weight: 170,
      position: [Object]
    }
  ],

 

But when you look in the UI it doesn't show up.

image.png.0a2dfafe3cb128ca7daf7df501641e70.png

This is the same result whether I use 'payload.autoload' or 'payload.write', using different aircraft. So it may be an MSFS issue.

 

Posted

It sounds like it could be working, but just the UI isn't picking up the changes. When you write payload is it affecting the aircraft? In FSX if I write 500kg to the pilot seat the aircraft reacts by sinking down on one side. 

The names of the payload stations you are getting back are strange though. Especially since they are the same. These are normally say things like "Pilot", "Front Passenger" etc.

It does sound like a problem with MSFS or FSUIPC7.

Paul

Posted

I added more weight and I can see the aircraft reacting to the load. So it is a UI issue of not refreshing based on weight loaded from backend.

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.