PDA

View Full Version : AI aircraft in managed code


Tom@FlagMountain
10 Aug 2007, 11:28
I am attempting to create an AI aircraft in managed code (VB.NET).
The "create" process is straightforward:

fsxSimConnect.AICreateNonATCAircraft("Mooney Bravo", "N1701", InitPos, DataRequestID7.REQUESTMOONEY)
fsxSimConnect.RequestDataOnSimObjectType(DataReque stID7.REQUESTMOONEY, DefineID.ID1, 0, Microsoft.FlightSimulator.SimConnect.SIMCONNECT_SI MOBJECT_TYPE.AIRCRAFT)

BUT... I need the objectID for the Mooney to use when setting waypoints, etc. and I am having trouble getting this information back from SimConnect. I have tried to set up an event handler of the type:

AddHandler fsxSimConnect.OnRecvAssignedObjectId

However, there doesn't seem to be a matching SimConnect event which has the correct matching signature. The closest I can find is:

SimConnect.RecvAssignedObjectIdEventHandler(Addres sOf fsxSimConnect_OnRecvSimobjectDataBytype)

and Visual Studio is complaining that the signature on this function doesn't match the OnRecvAssignedObjectId signature.

Any assistance would definitely be appreciated.

Thanx

Tom

FlapsOut
14 Aug 2007, 22:21
Hi Tom,

Search on posts by FlapsOut...we've examined and detailed much of this, including source-code :)

Flaps ;)

Tom@FlagMountain
15 Aug 2007, 15:25
Thanx for the reply. I have gotten past this question, and have hit another snag. I am getting a SimConnect Exception 3 when I try to send an array of waypoints. I have done the search on FlapsOut as you suggested, but there are very few code samples, and none I saw relate to waypoints. Could you provide a pointer, please?

Regards

Tom

FlapsOut
17 Aug 2007, 01:43
um...If you wanna send me some source? I'll be more than happy to figure out where the Booger is.

I'm a Pro, so I keep everything sent to me privately as Confidential...

If anyone asks? I already lost the source you sent me, k?

Remember, We talking C# and .Net here? For C++ or 'C' or even Java? We got other very good experts available here :)

Thanks,
Flaps