Thread Tools Display Modes
08-22-14, 01:07 PM   #1
darrare
A Defias Bandit
Join Date: Aug 2014
Posts: 3
A simple range checker

I want to add something to my addon that only displays 0-100 yards range, the only thing i found in wow api was functions that return nil or 1. How do i make it so i just have a number on my screen that changes as you move closer and farther. thanks
  Reply With Quote
08-22-14, 01:24 PM   #2
jeruku
A Cobalt Mageweaver
 
jeruku's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 223
If all you are looking for is an average range display then RangeDisplay should do the trick.

If what you are looking for is a way to easily tell if your spells are in range then tullaRange is a good option.
  Reply With Quote
08-22-14, 02:23 PM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
You may want to look over the Things addons/macros can't do sticky thread. Addons cannot know the exact position of any units other than yourself and your party/raid members, so it's not possible to have an accurate display of the exact distance to arbitrary units. The best you can do is guess by checking whether spells with different ranges are in range, estimating based on how spells go in/out of range as you move, or by triangulating using data communicated by other players using the same addon.

The first addon Jeruku linked is probably your best bet.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » A simple range checker

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off