Distance To Target -- Addon?

Forum for mod & macro requests and discussion

Moderator: Demon Hunters

Distance To Target -- Addon?

Postby Heartwood » Thu Jan 10, 2008 1:02 am

Does anyone know if there is an addon that will show the distance to your current target? I've been wanting this info in-game for ages, but haven't seen anything.

-Heart
Image
At the brink of danger I stand. Clad in armour, shield and sword in hand.
User avatar
Heartwood
 
Posts: 1668
Joined: Fri Jul 14, 2006 7:59 pm
Location: London, Ontario, Canada

Postby Lealla » Thu Jan 10, 2008 9:11 am

It's something that's frequently requested. However, it is impossible to do with precision, because the information is not available to the user interface. Blizzard has deliberately chosen to restrict certain types of data in the client that can be used to enable botting, and one of those is position and range data for objects in the world.

The best that can be done (and what many addons do) is test for range brackets based on the known ranges of abilities and actions. You can't tell if target X is exactly 30 yards from you, but you can tell that a spell or ability with a 30 yard range is in range to that target. If it's out of range of a 20 yard ability, you know it's somewhere in the 21-30 bracket. Similarly, if a target is out of range of a 30 yard ability, but in range of a 36 yard ability, you know it's in the 31-36 bracket.

There's also a WoW API function called CheckInteractDistance(), which tells you which specific actions (such as trading, inspecting, etc.) a given unit is in range for. This is how mods like DBM can put up a box telling you who's too close to you for certain fights.

But it is impossible to put up a numeric display (Target is 31.2 yards away), just like it's impossible to put up an off-screen direction arrow or any other display that requires precise knowledge of an object's position in the 3D world.

FYI, this is probably a more appropriate topic for the Mods & Macros forum.
Image
Image
User avatar
Lealla
Class Leader
 
Posts: 3796
Joined: Sat Mar 03, 2007 4:22 pm
Location: Bethlehem, PA


Return to WoW Addon & Macro Discussion

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 3 guests

cron