1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

AI aircraft in managed code

Discussion in 'SimConnect' started by Tom@FlagMountain, 10/8/07.

  1. Tom@FlagMountain

    Tom@FlagMountain

    Joined:
    10/8/07
    Messages:
    6
    Country:
    us-newmexico
    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(DataRequestID7.REQUESTMOONEY, DefineID.ID1, 0, Microsoft.FlightSimulator.SimConnect.SIMCONNECT_SIMOBJECT_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(AddressOf 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
  2. FlapsOut

    FlapsOut

    Joined:
    29/5/07
    Messages:
    75
    Country:
    us-texas
    FlapsOut reply

    Hi Tom,

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

    Flaps ;)
  3. Tom@FlagMountain

    Tom@FlagMountain

    Joined:
    10/8/07
    Messages:
    6
    Country:
    us-newmexico
    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
    Last edited: 15/8/07
  4. FlapsOut

    FlapsOut

    Joined:
    29/5/07
    Messages:
    75
    Country:
    us-texas
    Thomas

    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

Share This Page