> In the current code -- there is just the single airplane being simulated on
> the display ?? or where could I find a list/array of a/c that are being
> managed so I can register each plane with the server and have the server
> relay updates for all of them ??

Look in the src/ATC directory.  There you will find an FGAIMgr class that 
instantiates aircraft.  The aircraft themselves are derived from FGAIEntity 
via FGAIPlane.  Presently the only AI airplane in the base package is a 
cessna flying out of KEMT (in the Los Angeles basin). 


> (if its just the one plane, once I get it to fly multiplayer, my focus will
> be to add multiple/AI plane support to the code, so comments towards
> achieving that goal will be welcome also)

You can add more AI aircraft to the FGAIMgr's list:


// Activate AI traffic at an airport
void FGAIMgr::ActivateAirport(string ident) {
        ATC->AIRegisterAirport(ident);
        // TODO - need to start the traffic more randomly
        FGAILocalTraffic* local_traffic = new FGAILocalTraffic;
        //local_traffic->Init(ident, IN_PATTERN, TAKEOFF_ROLL);
        local_traffic->Init(ident);
        local_traffic->FlyCircuits(1, true);    // Fly 2 circuits with touch & go in 
between

        FGAITanker* tanker = new FGAITanker;
        tanker->Init();

        ai_list.push_back(local_traffic);
        ai_list.push_back(tanker);
        activated[ident] = 1;
}       


Here I've added another AI plane, a KC-135 called FGAITanker, that orbits over 
the LA basin.  Presently the AI traffic's FDM is contained within the class 
derived from FGAIPLane.  So the Cessna and the tanker use entirely different 
FDMs.  A more generalized approach would be to move the FDM into FGAIPlane.

I started working on a generalized and scriptable version of my tanker, but 
have been sidetracked by other stuff.  Let me know if you want the tanker 
code and I'll send it to you.


Dave
-- 
****************************
David Culp
davidculp2[at]comcast.net
****************************

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to