February 13, 200719 yr Hi,For the past week, I have been adding GA traffic for the region I live in based on the AI Traffic working sample in the FSX SDK. One bit of info I seem to be missing is how make the flightplans roundtrip. I have searched this forum, the SDK and all over the internet looking for info, but have found none so far.1. I have tried ammending the flightplans to include a trip back to the original departure point with no success. Aircarft would take off, but circle the field???2. I cannot find anything "clear" in the api's that would suit these needs.I am not looking for someone to tell me exactly how to do this, just looking for a little direction as to the generic method used by others to generate round trip ai traffic.Thanks in advanceJohn
February 14, 200719 yr Hi John,As you stated, there doesn't appear to be a parameter to make flights "round trip". However, as flight plans are in XML format, you could try setting up your program to read the flight plan, reverse the order of the waypoints, write a new temporary flight plan file to the "Flight Simulator X Files" directory, then load that flight plan for the AI aircraft that just landed. For maximum realism, you'd probably want to watch the AI UNIT MODE variable, as it will set itself to "TAXI". I'd check to see if the state changes (perhaps to ZOMBIE or WAITING) when it reaches the gate, and that could be your trigger to load the new flight plan.I haven't tried it, but that's the approach I would go for. I'll add it to my wall of projects I'm working on.
February 15, 200719 yr That was exactly the kind of creative thinking I was looking for. I am new to the FS SDK so it will be a while before I figure out some of the better ways to manipulate data. I hope it is sooner rather than later. I appreciate in a very big way your assistance. I owe you one!John
Create an account or sign in to comment