Discuss this page on this pages [[objCalcBestTarget Talk Page|TalkPage]] [[http://ministry.kronosaur.com/record.hexm?id=66822|From API 34 on Ministry]] === objCalcBestTarget === ^ Syntax | (objCalcBestTarget obj [objList]) | ^ Arguments | obj: The object to calculate the target for | ^ | [objList]: A list of objects to check | ^ Returns | With one argument, returns the nearest visible target (non-friendly) to obj. With a list, returns the nearest visible target in the list. Returns nil if unsuccessful. | ^ Category | [[spaceObject functions]]| ^ Description | Useful for finding the nearest target to an object, or if an object/order giver is closer and therefore a better target. | === Example === (objCalcBestTarget gSource) Finds the nearest visible target to the source object. (objCalcBestTarget gSource (list aOrderGiver aAttacker)) Finds the nearest visible target between an attacker and subordinates, eg. a player or their auton, to gSource. Return to [[modding:function:spaceObject_functions|Space Object functions]] list Return to [[modding:functions:]] list