Distance To Target -- Addon?

Forum for mod & macro requests and discussion

Moderator: Demon Hunters

Post Reply
User avatar
Posts: 1670
Location: London, Ontario, Canada

Distance To Target -- Addon?

Post by 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.

At the brink of danger I stand. Clad in armour, shield and sword in hand.

User avatar
Class Leader
Posts: 3797
Location: Orefield, PA
WoW character race: Night Elf
WoW character class: Druid
WoW character gender: Female
WoW character level: 100
WoW character guild: You and Whose Army

Post by 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.

Post Reply