Jump to content

Can I dynamically change or create AI waypoints during mission via scripting


Pixar

Recommended Posts

Hi,

Just wanted to ask you ME gurus if it is possible to dynamically change or create AI waypoints during a mission via scripting?

During a running mission, I would like to dynamically change waypoint parameters (location, speed, altitude) or create a completely new one, and tell the AI to go there if necessary. 

Can I do that via lua scriting?

Thanks a lot for your time!

Pete

Asus TUF Gaming Z690 Plus Wifi D4 ** Intel i9-12900K ** RTX3090 Gigabyte Gaming OC ** 64 GB DDR4-3600 G.Skill Ripjaws ** Samsung 980 Pro M.2 ** Windows 11

Link to comment
Share on other sites

2 hours ago, Pixar said:

... I would like to dynamically change waypoint parameters (location, speed, altitude) or create a completely new one, and tell the AI to go there if necessary...

Hi, if you want to give AI waypoints with dynamic destination point (example : actual position during mission of an enemy group), you can use Mist "Group Orders" functions. There are several types of function, but for example you can create a path of waypoints with buildWP(groung, fixedWing or helicopter), and then order AI to follow this path with goRoute, following given examples. You can also get existing route datas with getGroupRoute, change datas values by script and order AI to follow this new path as previously.

Mission Scripting Tools Documentation - DCS World Wiki - Hoggitworld.com

If you want to be able, for example, to choose between 2 predetermined paths, at a given waypoint, you can use mission editor "switch to waypoint" (using single path of waypoints in a complex form giving two possible paths at a point, "rejoining" later, or whatever).
For more specific answer you should share an example .miz, with what you want to get, to see what is possible.

  • Like 1
Link to comment
Share on other sites

Thanks a lot for taking the time to write an answer. Much appreciated.

I give that a go and check it out. 
More or less and want to control the AI and tell it where to go whenever I like and the situation calls for that. 
 

Simple Example: A certain condition is met and I want the AI to turn 90 deg to the right. I would get the current ownship position, calculate an offset waypoint 90 deg to the right at a certain distance and tell the AI to go there, by using „switch to waypoint“. Therefore, I would need to be able to dynamically create that new offset waypoint, unless there is another way to do that. 

Asus TUF Gaming Z690 Plus Wifi D4 ** Intel i9-12900K ** RTX3090 Gigabyte Gaming OC ** 64 GB DDR4-3600 G.Skill Ripjaws ** Samsung 980 Pro M.2 ** Windows 11

Link to comment
Share on other sites

57 minutes ago, Pixar said:

...Simple Example: A certain condition is met and I want the AI to turn 90 deg to the right. I would get the current ownship position, calculate an offset waypoint 90 deg to the right at a certain distance and tell the AI to go there, by using „switch to waypoint“. Therefore, I would need to be able to dynamically create that new offset waypoint, unless there is another way to do that. 

I think your example seems to match what is described in this other thread :

 

 

Link to comment
Share on other sites

@Pixar I tested a bit the proposal from @shagrat and it works very well and is easy to settle with mission editor tools. I attached an example .miz :

At wpt1 the AI hornet get wpt action aerobatic (90° right turn and forward for 40s then resume flight) conditionned by a flag. From this wpt1 to last wpt4 you can, with F10 radio menu, order the aerobatic right turn when you want. You can watch it from map F10 view and accelerated time (x20).

test-aero-right-turn-order-then-resume.miz

Link to comment
Share on other sites

That is really cool. I will check it out. Thanks a lot for the support!

Asus TUF Gaming Z690 Plus Wifi D4 ** Intel i9-12900K ** RTX3090 Gigabyte Gaming OC ** 64 GB DDR4-3600 G.Skill Ripjaws ** Samsung 980 Pro M.2 ** Windows 11

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...