Lua scripting : findPathOnRoads - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 02-06-2019, 03:23 PM   #1
CougarFFW04
Member
 
Join Date: Jul 2018
Posts: 184
Default Lua scripting : findPathOnRoads

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
CougarFFW04 is offline   Reply With Quote
Old 02-06-2019, 10:58 PM   #2
Grimes
ED Testers Team
 
Grimes's Avatar
 
Join Date: Jan 2006
Location: Black Mesa
Posts: 7,763
Default

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.
__________________
You can only tie the world record for lowest flight.
Current Projects: Scripting Wiki, Something...
Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread), SLMOD for DCS 1.5/2.0, IADScript, Mission Editing Wiki!, Mission Building Forum
Grimes is offline   Reply With Quote
Old 02-11-2019, 11:33 AM   #3
CougarFFW04
Member
 
Join Date: Jul 2018
Posts: 184
Default

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
CougarFFW04 is offline   Reply With Quote
Old 02-11-2019, 09:51 PM   #4
Grimes
ED Testers Team
 
Grimes's Avatar
 
Join Date: Jan 2006
Location: Black Mesa
Posts: 7,763
Default

As long as the waypoints specify to go on road, then yes.
__________________
You can only tie the world record for lowest flight.
Current Projects: Scripting Wiki, Something...
Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread), SLMOD for DCS 1.5/2.0, IADScript, Mission Editing Wiki!, Mission Building Forum
Grimes is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 04:57 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.