Thread Tools Display Modes
Old 03-18-09, 06:16 AM   #1
Hakana4155
A Fallenroot Satyr
 
Hakana4155's Avatar
Join Date: Mar 2009
Posts: 22
Raid Frame Range Value

In the Party and Raid Frames you show OOR for players who are out of range of my character. What value is the distance that is considered "out of range" and which lua file would I need to modify if I wanted to change this value?

BTW, thank for the fantastic interface. Knowing its on your to-do list, I'm looking forward to the time that the characters are sorted in the raid frame is a logical manner.
Hakana4155 is offline  
Old 03-18-09, 09:58 AM   #2
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
I've moved this over into the developer chat thread as it's not actually modifying the layout as a customization you can make... it modifying core code and, frankly, really can't be done in a logic sense.

On your action bars there's no "value" for what out of range is, it's actually determined by the Bliz IsActionInRange() API method call which returns true/false for whether or not the action is currently within range of the target.

On the unit frames, that's more complicated. Any unit which is not in the same zone is by definition, out of range. Any unit which is more than 100 yards away is by definition, out of range. After that it turns into black magic and can only be determined by looking to see what spells you have that can be used on the unit and what their min and max ranges are.

If the unit is in range of the usable spell, then we know their distance to be between that min and max. I have to spin the list of spells you know and keep adjusting the min and max to try and narrow down the range and guess because Bliz does not offer a real, discrete, way to determine distance to a unit. So I can only assume the unit is somewhere between the greatest minimum distance that I found a usable spell for and the smallest maximum distance. If I can't find any spell you can use on the unit, I have to assume it's because it is out of range of all of your spells and it gets flagged as out of range. It is not an exact science. but there's still no magic number.

If you look at the code in [ Interface > AddOns > nUI > Units > nUI_UnitStatus.lua ] you'll see on line 233 where I flag the unit as out of range if the distance to the unit is over 40 yards... that's because the only way the distance can be known over 40 yards is if the unit is in a different zone, is not loaded by Bliz (over 100 yards away) or you have no spells that you can use on the unit. If the distance to the unit is less than or equal to 40 yards, it can only be because you have spells you can use on it and therefore it is by definition in range.
__________________

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.



Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/
spiel2001 is offline  
Old 03-18-09, 11:02 AM   #3
Hakana4155
A Fallenroot Satyr
 
Hakana4155's Avatar
Join Date: Mar 2009
Posts: 22
Thanks for the quick response

Through a quick test last night I figured you were using a value around 40 yards for the OOR indicator.

The reason I'm interested is that as a Feral Druid there are rare cases in a raid where I need to do one of a couple of things, i.e. Dispell poisions and curses, battle rez someone or put my Intervate on a caster. All of these feasures have a 30 yard range.

Currently I have Grid that displays when a player is over 30 yards away and if they have a poison, curse or are dead. The unit frames in nUI has the necessary function so I can remove Grid if I can change the range to 30 yards. When I get home I'll modify the lua file you mentioned and hopefully either get rid of Grid or maybe I'll get the addon to intergrate into the info-panel just in case I need it for something else. I prefer to have Omen up while I'm in combat so I done grab aggro from the tank.
Hakana4155 is offline  
Old 03-18-09, 11:27 AM   #4
wreck
A Flamescale Wyrmkin
 
wreck's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2009
Posts: 114
It will be interesting to hear if you manage to do this. As Scott said, there isn't really a way to find the distance to a target in WoW. Blizzard removed that for a number of reasons a long time ago. The best you can do is find out if a target is within any spell range as Scott points out.

I wonder how Grid is doing this. Or if it is some magic like Scott's that gives the illusion of knowing the range when all it really knows is that it is within a set of ranges depending on the particular spells your character has.
wreck is offline  
Old 03-18-09, 11:31 AM   #5
Hakana4155
A Fallenroot Satyr
 
Hakana4155's Avatar
Join Date: Mar 2009
Posts: 22
I would say that Grid has a way to see if the player is within a certain range because I can pick boxes for ranges like 10 yards, 25 yard, 30 yards, etc. What I did was have it display on the second line of center text the range value and I picked the box for 30 yards.
Hakana4155 is offline  
Old 03-18-09, 12:02 PM   #6
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
When I add the Grid style indicators to the unit frames I'll add this type of functionality to them, as well.
__________________

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.



Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/
spiel2001 is offline  
Old 03-18-09, 01:39 PM   #7
Hakana4155
A Fallenroot Satyr
 
Hakana4155's Avatar
Join Date: Mar 2009
Posts: 22
I'm thinking that what Grid does is looks to see which spells are in range and which are not and uses that as a test. This is purely speculation on my part as I've never researched it and if I was going to do it that is the mechanism I would probably use. However, there might be a less "brute force" approach to this. I very limited programming experience.

As mentioned in a different post I don't know that you need to re-invent the wheel by incorporating the functionally that Grid gives to the Unit Frames in nUI. But if it can be done without messing with the stream lined approach that nUI has now then that sounds good to me. I wouldn't want to see nUI become too bulky to be useful; as I think other programs become with time when they try and continually add more and more features.
Hakana4155 is offline  
 

Go BackWoWInterface » Featured Projects » nUI, MozzFullWorldMap and PartySpotter » Customization » nUI: Developer Chat » Raid Frame Range Value

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