

This will re-enable X-Plane traffic or allow other plugins, like a real world traffic provider, to then take over traffic from you. When you are done providing traffic (the user has disconnected from the online network) set the override_TCAS dataref to 0 and call XPLMReleasePlanes.There is no need to set a lower XPLMSetActiveAircraftCount because X-Plane will drop TCAS targets that haven’t been updated in 10 frames. X-Plane will forget the target (and forget its unique ID). If you have fewer targets than anticipated, you can simply stop writing the positional data to a target slot.If you are doing that, set sim/operation/override/override_multiplayer_map_layer to 1 to stop X-Plane from drawing its own icons. Optional: Provide a map layer to the X-Plane map with icons for the planes you are providing.This way, you can keep X-Plane and other plugins updated about the state of up to 63 other planes. Optional: Fill in more information than just the position into the new sim/cockpit2/tcas/targets/position/ datarefs.Only the plugin who has acquired the AI planes can write these datarefs! Tell X-Plane about the traffic targets by writing to the existing relative_bearing_degs, relative_distance_mtrs and relative_altitude_mtrs datarefs or to the new sim/cockpit2/tcas/targets/position/double/ datarefs.This will be the mode S ID of the target and is used to track your target even if you move it between slots. Assign each target a unique 24bit number between 7215 and set it to sim/cockpit2/tcas/targets/modeS_id.In fact, TCAS override works even if the user has 0 AI planes configured. It is not necessary for the user to increase AI aircraft count or provide special models to be loaded as AI.
#X plane world traffic 3 enable afre real traffic update#
Note that you will get to update all 19 multiplayer planes then, even if the user has a lower AI aircraft count setting. Tell X-Plane how many planes you want to fill in with TCAS override (up to 63) by calling XPLMSetActiveAircraftCount.Only the plugin that has successfully acquired the AI planes can set this dataref! Activate TCAS override by setting the sim/operation/override/override_TCAS dataref to 1.That is, an online network plugin should not acquire planes before it is actually connected to the network! Since acquiring planes with no model load is fast, this should be deferred until the user is actually connected to a server. You should only call this when you are ready to supply planes right now. Acquire the AI planes with XPLMAcquirePlanes – This should be done with a null pointer for the desired model paths, so it is fast.Using the new TCAS override requires that the plugin does the following: Sim/cockpit2/tcas/indicators/relative_altitude_mtrs float Sim/cockpit2/tcas/indicators/relative_distance_mtrs float Sim/cockpit2/tcas/indicators/relative_bearing_degs float It uses the following, well known datarefs, simply expanded in array size: sim/operation/override/override_TCAS int The new supported and recommended variant of the “TCAS hack”, now called “TCAS override”, relies entirely on datarefs and existing XPLM functions, so it requires no SDK update. override_TCAS: Existing datarefs made useful It is therefore necessary to adopt the new TCAS override, which provides an official and compatible way to notify both X-Plane and third-party plugins of traffic. With Vulkan and Metal, the 3D callback that was previously used to change the AI plane count for the “TCAS hack” no longer works. Some plugins also get around this by providing “invisible” aircraft to be moved by X-Plane. Various techniques have been used by authors, which are commonly known as “TCAS hack” that involve taking control of X-Plane AI aircraft, but not drawing them, by inhibiting drawing from a 3D callback. Drawing with XPLMInstance places the 3D object in the world, but does not actually tell X-Plane or other interested third parties, such as EFBs, about the existence of another aircraft in the airspace around the user. With X-Plane 11.50, plugins that display traffic in X-Plane, whether auto-generated or from an online multiplayer network, have to use the XPLMInstance API to draw these aircraft in X-Plane’s world.
