CougarFFW04 Posted February 6, 2019 Posted February 6, 2019 Hi DCS scripting Gurus I would be interested to "inject" a path to a ground unit that would move from A to B. I found that the DCS findPathOnRoads can return a table with the path from A to B. But what is the scripting function to assign this path to a ground unit ? Can't find it and there is no related function that would do the job in the wiki... Thanks
Grimes Posted February 6, 2019 Posted February 6, 2019 Use the mission task. Worth noting that you can just create waypoints with just waypoint A and B, you don't need to make one for the whole path returned via findPathOnRoads. That function is more useful to know the exact path that is taken. Distance from A to B as the crow flies might be 10km, but the on road path might be considerably more. You can use that information to figure out how long it might take the AI to reach their destination. Maybe try to choose alternative routes if the shortest route generated forces the AI to go someplace you don't want them to be. A big problem with that function is that it is "expensive" in terms of how long it can take to run and how much data is returned. If the distance is large enough there can be several thousand points returned for their path. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
CougarFFW04 Posted February 11, 2019 Author Posted February 11, 2019 Hi Grimes, So if I understand correctly, I have just to define A and B positions and assign the task and they will go from A to B following the theater road path. Right ? Thanks
Grimes Posted February 11, 2019 Posted February 11, 2019 As long as the waypoints specify to go on road, then yes. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Recommended Posts