Jump to content
Sign in to follow this  
nubbin77

Nearest Enemy (detect)

Recommended Posts

Hello,

Is there a way to detect a groups nearest enemy?

I want to make an AI script that loops every 5-10 minutes.

Basically I want something like this:

East Group - getpos of nearest west unit.

east group domove to the getpos above

loop every 5 minutes or so.

Since it loops every 5-10 minutes, they may not actually meet up with the west unit (if the west unit is moving then the east group will goto the spot they detected originally, not necessarily the west units current pos). I want to mix groups like this in with regular waypoint groups. I think It would simulate the enemy getting intelligence on friendly units and reacting to them.

Unfortunatley it doesn't appear that you can detect your nearest enemy. You can detect markers and objects but not enemies (unless I am mistaken - which I hope). I want to combine this with CoC missions to make it seem somewhat like the AI is counter acting your moves.

Any thoughts on this? There are a couple similar scripts based on if an East unit detects a west unit, then they react (along with the other linked groups). The problem with this is, they will react to the first detected group - regardless of how far away the group is. I want to have action take place all over a large map and have the AI react locally.

Any thoughts guys or am I SOL?

Share this post


Link to post
Share on other sites
Quote[/b] ]Posted on Feb. 22 2005,23:56

--------------------------------------------------------------------------------

use a GUARD waypoint...

That would work for units that enter the detection range of the enemy. I want somethat will make the AI seek out its nearest enemy (even if it is very far away).

Share this post


Link to post
Share on other sites

thanks again for your answers blanco.

Guard does not do what I am asking. Guard works if the AI group is aware of the enemy. The AI does nothing if it doesn't know about the enemy.

Group link is fantastic and I use it in almost all my missions now. However it is limited to chasing after one group. Ideally I would like to modify this script so it interacts with multiple groups, but I haven't figure out how to do that and Keycat thinks it requires a complete re-write. I'm not up to that just yet.

Anyway, I'm out of time for now.

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
Sign in to follow this  

×