Download
(6 Kb)
Download
Updated: 11-03-12 01:50 AM
Updated:11-03-12 01:50 AM
Created:04-09-12 08:43 AM
Downloads:45
Favorites:0
MD5:
LibNearFar
Version: 0.4
by: seebs [More]
PTS-only until 1.8:

Determine distance between two units. Usage:

nf = Library.LibNearFar

x = nf.distance(unit1, unit2, default)

returns default if distance can't be calculated. unit1 and unit2 may be unit tables with .coordX etc members, or unit designators suitable for Inspect.Unit.Detail.

x = nf.prettydistance(unit1, unit2, default)

Yields a string value.

x = nf.prettydistance(numeric)

Same string value.

Added range/prettyrange which subtract unit radius, since that's what spells use.

Note: I can't find a way to detect whether or not two units have comparable coordinates. Say, dimensions, instances, and such. You could check whether units are in instances, but since you can have different zone IDs outside of instances, it may be that you can have different zone IDs within a given instance...
0.2: range (less radii of units) added
0.3: TOC updates
0.4: ToC updates.
Optional Files (0)


Archived Files (3)
File Name
Version
Size
Author
Date
0.3
3kB
seebs
06-22-12 09:45 PM
0.2
3kB
seebs
04-11-12 11:08 AM
0.1
3kB
seebs
04-09-12 08:43 AM


There have been no comments posted to this file.
Be the first to add one.



Category Jump: