Dabull Posted October 4, 2021 Report Posted October 4, 2021 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)); }
Paul Henty Posted October 4, 2021 Report Posted October 4, 2021 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: Another MSFS stock aircraft. Using the website example to autoload payload: http://fsuipcwebsockets.paulhenty.com/#cmdpayloadautoload Using this example to load individual payload stations: http://fsuipcwebsockets.paulhenty.com/#cmdpayloadwrite 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
Dabull Posted October 4, 2021 Author Report Posted October 4, 2021 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. This is the same result whether I use 'payload.autoload' or 'payload.write', using different aircraft. So it may be an MSFS issue.
Paul Henty Posted October 4, 2021 Report Posted October 4, 2021 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
Dabull Posted October 4, 2021 Author Report Posted October 4, 2021 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now