Roderick
Member
I'm not 100% sure what would be the proper naming convention, but what I'm suggesting would be a second version of instance_nearest that would take some extra parameters:
instance_nearest_ext(x, y, obj, number, min_range, max_range, min_angle, max_angle)
x, y, and obj would be exactly the same as the existing instance_nearest.
number would be the number of objects to find. The result would be stored in an array, rather than a variable.
min_range would be the minimum range to check. If an object is closer than min_range, it will not be included in the results.
max_range would be the maximum range. Like min_range, things further than this value would be ignored. A value of 0 or negative means no maximum range.
min_angle and max_angle define an arc to be checked. Anything outside this arc is ignored.
This would allow users to get the nearest multiple objects, or the second closest object, or the nearest object within a specified area, without having to resort to using complicated scripts, and by making it a new, separate command, the original would still be available when the basic functionality is all that's needed.
instance_nearest_ext(x, y, obj, number, min_range, max_range, min_angle, max_angle)
x, y, and obj would be exactly the same as the existing instance_nearest.
number would be the number of objects to find. The result would be stored in an array, rather than a variable.
min_range would be the minimum range to check. If an object is closer than min_range, it will not be included in the results.
max_range would be the maximum range. Like min_range, things further than this value would be ignored. A value of 0 or negative means no maximum range.
min_angle and max_angle define an arc to be checked. Anything outside this arc is ignored.
This would allow users to get the nearest multiple objects, or the second closest object, or the nearest object within a specified area, without having to resort to using complicated scripts, and by making it a new, separate command, the original would still be available when the basic functionality is all that's needed.