I am stuck again with something.
I am trying to let a civilian go to the closest OPFOR unit.
The problem is, the civilian will check an array of OPFOR units to see how close they are, and if they are within a certain range he will go to that position.
But I have a problem, I will give an example:
If the civilian is closer to unit Z than the civilian is to unit V he will still go to unit V (if V is within the predefined minimal distance) since unit V is checked first by the scipt.
I call the script like this:
[thislist select 0,informant,[v,w,x,y,z]] exec "temp.sqs"
I would like something to compare all disances and
than the civilian decides what unit is the closest OPFOR unit and move to it.
I can make a massive script which compares all outcomes with eachoter but that will become massive. I guess I am just overlooking a simple solution
Tried to search for this aswell but found only one script but that link is dead
. Other distance script were using the "nearestobject" command, and thats not what I need
Maybe one of you can help me on this one?