plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.


Please take a moment to read the platform’s guidelines before you get started!


question

Indiafoxtecho avatar image
Indiafoxtecho asked B21 answered

Traffic variables / information directly readable from gauges?

I was wondering if there is any plan to restore the functionality of the C:ITrafficInfo: variables used in FSX/P3D to directly access traffic information within gauges or code in general... these were quite handy in my opinion...

(C:ITrafficInfo:SelectedVehicleID, enum)

(C:ITrafficInfo:S:PLANE HEADING DEGREES TRUE, degrees)

(C:ITrafficInfo:S:PLANE ALTITUDE, feet)

(C:ITrafficInfo:S:Plane LATITUDE, degrees)

(C:ITrafficInfo:S:PLANE LONGITUDE,degrees)

(C:ITrafficInfo:S:AIRSPEED INDICATED, KNOTS)

(C:ITrafficInfo:S:PLANE HEADING DEGREES TRUE, degrees)

(C:ITrafficInfo:S:AIRSPEED TRUE, KNOTS)

(C:ITrafficInfo:S:EMPTY WEIGHT, pounds)


...or is any plan to expose equivalent traffic variables short of using SimConnect functions?



gauges
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

ericmarciano avatar image
ericmarciano answered ericmarciano commented

Reading the traffic in JS is easy. If you're using WASM, I can't tell...

2 comments
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

N6722C avatar image N6722C commented ·
Maybe easy -- when you know how .. care to share the JS method ?

Especially, how to read MP Traffic


0 Likes 0 ·
ericmarciano avatar image ericmarciano N6722C commented ·
As far as I know, there is no way to read MP traffic. The JS code I use to read traffic provides only AI traffic, unfortunately... This problem has already been reported to the dev team, I think they said they would fix it. Maybe they did, I didn't test this for a long time.
0 Likes 0 ·
B21 avatar image
B21 answered

I *think* you can get limited MP information (at least it includes the lat/lng/alt but excludes player name or tail #) from Coherent.call("GET_AIR_TRAFFIC"). The Asobo example is in

\asobo-vcockpits-instruments\html_ui\Pages\VCockpit\Instruments\Shared\Map\Svg\SvgAirplaneElement.js

The much modded Asobo 'nameplates' code also collects MP information (I forget the file location but any nameplates mod will show you the original location) but the data accessed is extremely limited, i.e. Xbox name, altitude, aircraft icao type and excludes lat/lng

But I haven't found the MP holy grail of lat/long/alt, xbox name, tail number, aircraft type. For multiplayer soaring we'd be much better off displaying the user-customisable tail number rather than the mostly anonymous and cumbersome xbox name.

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 19.1 MiB each and 23.8 MiB total.