Jump to content
Sircl

How to get an AI squad to avoid an area when moving to a randomly placed waypoint

Recommended Posts

I am attempting to write a script where the AI will surround an objective before attacking it. I have been able to tell the AI to move to a random position (what I guess I will call the "staging area") inside of an area that excludes the objective itself. But what I need to do is make sure the AI don't walk through the objective to get to their "staging area" before the attack. Is there any way I can tell the AI to take a long route around the objective when moving to the staging area in order to minimize the chance of the attack being compromised before it even starts?

 

Sorry if my explanation isn't good or if I'm asking in the incorrect area, This is my first time asking for help via the bohemia forum. Thanks for all the help in advance!

Share this post


Link to post
Share on other sites

Hi Sircl

 

In cases where AI would walk through the objective, you can give them extra waypoints located between their current position and your staging area but away from the objective (off to one side).

Share this post


Link to post
Share on other sites
20 hours ago, _foley said:

In cases where AI would walk through the objective, you can give them extra waypoints located between their current position and your staging area but away from the objective (off to one side).

How via scripting could I detect if they were going to walk through the objective, and if so have them walk a path around it? Sadly I can't script multiple preset waypoints because I need the script to work at any random place on the map, with a random starting position, and a random staging area.

 

I have been able to make sure it doesn't create a waypoint inside the objective area, but can't find a way to make sure the route doesn't go through. Is there a way I can make an invisible area marker representing the route they would take (a thin area going from their starting position all the way to the staging area) and then test to see if the area marker "collides" with the area representing the objective?

 

Thanks again for the help

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×