Jump to content
Sign in to follow this  
NaveReyem

Nearest Enemy?

Recommended Posts

Hello and good day dudes, ive been stumped on this problem for a few days now and would kindly request some help from these forums here...

Ive got an AI in this script right, and he is civilian side,

I want to be able to tell who is the nearest unit to him that is not on the civilian side.

any help?

ps. the civlian side thing i can do, i just need to know how to find nearest unit.. yay.gifyay.gifyay.gifyay.gifyay.gifyay.gif

edit : hey i just realized this is 8000 post on here, lol

Share this post


Link to post
Share on other sites

ive searches for 4 days, ive found many scripts but i cant decipher them, too many variables involved...

ive not seen any Tuts on it either

Share this post


Link to post
Share on other sites

thanks, on that link i read something about ImprovedNearestObject, any idea what that is??? confused_o.gif

Share this post


Link to post
Share on other sites

Nearestobject can only detect objects within a 50m radius.

The findclosest function finds the closest object no matter what the distance is...

and

...with GB's findunits function you can specify the radius because it's a parameter to call the function.

Share this post


Link to post
Share on other sites

yesyes Blanco, i didnt need to know when a unit is near an array of people, i needed to know who was the closest unit in an array to a certain person, i Ended up using bdfv85's FindClosest function, the nearestobject i know is only 50 meters, someone else made a function of nearestobject that detects at any distance, called Improvednearestobject, thats what i was talking about..

.... Findclosest and Improvednearestobject are basically the same lol....

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  

×