[RESOLVED] Can you dynamically create waypoints in P3D
[RESOLVED] Can you dynamically create waypoints in P3D
Hello
I am just wondering if it is possible to dynamically create waypoints in P3D. Without having to access the flight planner menu option.
Basically I have a c++ console application which takes coordinates from another external application
I want my application to update a gps.xml with those coordinates and create two waypoints based on those coordinates.
Is this possible?
Regards,
Barney
I am just wondering if it is possible to dynamically create waypoints in P3D. Without having to access the flight planner menu option.
Basically I have a c++ console application which takes coordinates from another external application
I want my application to update a gps.xml with those coordinates and create two waypoints based on those coordinates.
Is this possible?
Regards,
Barney
Re: Can you dynamically create waypoints in P3D
Yes look at the waypoint example in the SDK. This is how I made my livingworld program.
Look in ver 3 of the SDK and the v4 only has a C# version.
See Reference samples AI Objects and Waypoints Managed AI Waypoints
Look in ver 3 of the SDK and the v4 only has a C# version.
See Reference samples AI Objects and Waypoints Managed AI Waypoints
Ron
Re: Can you dynamically create waypoints in P3D
Awesome!
Are there any tutorials on how to do this?
Regards,
Barney
Are there any tutorials on how to do this?
Regards,
Barney
Re: Can you dynamically create waypoints in P3D
And what is the.cs program called again?
Regards,
Barney
Regards,
Barney
Re: Can you dynamically create waypoints in P3D
look at
Managed AI Waypoints
in the samples area of the SDK v4
tutorials: look at the SDK Simconnect API overview. It's right there ;-)
Managed AI Waypoints
in the samples area of the SDK v4
tutorials: look at the SDK Simconnect API overview. It's right there ;-)
Ron
Re: Can you dynamically create waypoints in P3D
Awesome
I have followed these tutorials.
I have created the appropriate waypoint data and can connect to P3d and receive messages using SimConnect. I can get lat, lon and altitude of my aircraft as well as the destination of my waypoint.
However I am not sure which sim connect function I use in order to see the waypoints in my instance of P3d that is open.
Is it simConnect.SetDataOnSimObject? Or is there another function that I use?
Regards,
Barney
I have followed these tutorials.
I have created the appropriate waypoint data and can connect to P3d and receive messages using SimConnect. I can get lat, lon and altitude of my aircraft as well as the destination of my waypoint.
However I am not sure which sim connect function I use in order to see the waypoints in my instance of P3d that is open.
Is it simConnect.SetDataOnSimObject? Or is there another function that I use?
Regards,
Barney
Re: Can you dynamically create waypoints in P3D
Don't follow ... you said you created the waypoints. Then list them out?
Ron
Re: Can you dynamically create waypoints in P3D
Yes I have created the data for the waypoints.
However when I run p3d and the c# application I created I cannot see the waypoints on my gps or flight planner
Regards,
Barney
However when I run p3d and the c# application I created I cannot see the waypoints on my gps or flight planner
Regards,
Barney
Re: Can you dynamically create waypoints in P3D
In other words
I have created the waypoints for my own aircraft (not ai)
I have passed them to my aircraft.
However when I run p3d I cannot see my waypoints.
Code:
SIMCONNECT_DATA_WAYPOINT[] waypoints = new SIMCONNECT_DATA_WAYPOINT[2];
// vehicle pos
waypoints[0].Flags = (uint)SIMCONNECT_WAYPOINT_FLAGS.SPEED_REQUESTED;
waypoints[0].ktsSpeed = 100;
waypoints[0].Latitude = s1.latitude;
waypoints[0].Longitude = s1.longitude;
waypoints[0].Altitude = s1.altitude;
// destination pos
waypoints[1].Flags = (uint)SIMCONNECT_WAYPOINT_FLAGS.SPEED_REQUESTED;
waypoints[1].ktsSpeed = 100;
waypoints[1].Latitude = 50.95;
waypoints[1].Longitude = 1.35;
waypoints[1].Altitude = s1.altitude;
Object[] objv = new Object[waypoints.Length];
waypoints.CopyTo(objv, 0);
simConnect.AddToDataDefinition(DEFINITIONS.Struct1, "AI WAYPOINT LIST", "number", SIMCONNECT_DATATYPE.WAYPOINT, 0.0f, SimConnect.SIMCONNECT_UNUSED);
simConnect.SetDataOnSimObject(DEFINITIONS.Struct1, dwRequestID, SIMCONNECT_DATA_SET_FLAG.DEFAULT, objv);
Regards,
I have created the waypoints for my own aircraft (not ai)
I have passed them to my aircraft.
However when I run p3d I cannot see my waypoints.
Code:
SIMCONNECT_DATA_WAYPOINT[] waypoints = new SIMCONNECT_DATA_WAYPOINT[2];
// vehicle pos
waypoints[0].Flags = (uint)SIMCONNECT_WAYPOINT_FLAGS.SPEED_REQUESTED;
waypoints[0].ktsSpeed = 100;
waypoints[0].Latitude = s1.latitude;
waypoints[0].Longitude = s1.longitude;
waypoints[0].Altitude = s1.altitude;
// destination pos
waypoints[1].Flags = (uint)SIMCONNECT_WAYPOINT_FLAGS.SPEED_REQUESTED;
waypoints[1].ktsSpeed = 100;
waypoints[1].Latitude = 50.95;
waypoints[1].Longitude = 1.35;
waypoints[1].Altitude = s1.altitude;
Object[] objv = new Object[waypoints.Length];
waypoints.CopyTo(objv, 0);
simConnect.AddToDataDefinition(DEFINITIONS.Struct1, "AI WAYPOINT LIST", "number", SIMCONNECT_DATATYPE.WAYPOINT, 0.0f, SimConnect.SIMCONNECT_UNUSED);
simConnect.SetDataOnSimObject(DEFINITIONS.Struct1, dwRequestID, SIMCONNECT_DATA_SET_FLAG.DEFAULT, objv);
Regards,
Re: Can you dynamically create waypoints in P3D
So I misunderstood what your ultimate goal was. Creating waypoints is more for AI than the user aircraft. I would create a FlightPlan and do a loadflightplan. Create a template flightplan, and use that to dynamically add the waypoints. But that the same functionality as the flight planner in P3D.
You can even add/load a flightplan to an AI and have them follow it.
You can even add/load a flightplan to an AI and have them follow it.
Ron
Re: Can you dynamically create waypoints in P3D
Awesome! Thank you!
Re: Can you dynamically create waypoints in P3D
It was more about me creating a flight plan dynamically which I could then see on the gps. My bad!