Thread Tools Display Modes
02-25-17, 10:01 PM   #1
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
Detecting all units around me(?)

Hi all,

The title is bit too broad, so I'll try to be more specific here.

What I am trying to achieve is detecting all enemy units which are in combat with me (myself) or my group.

UnitAffectingCombat("unit") will only return 1 or nil value based on passed unit's id. Thus, in order for me to use that function, I'll need to define a table which holds each units' id.

Unfortunately, going through API lists on Wowprogramming did not relieve my curiosity

I guess some combat related addons like Skada or Details could be a good reference here, but they are too complex for newb like me to look into.

Any ideas, please?

Thank you!
  Reply With Quote
02-25-17, 10:55 PM   #2
briskman3000
A Flamescale Wyrmkin
 
briskman3000's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 108
http://wow.gamepedia.com/UnitId lists all the available UnitIDs.

I'm pretty sure you can't achieve what you want, they way you are thinking about it though. You can only get certain info from an enemy when its being targeted, which is why things like AOE threat meters don't exist.

The closest I can come up with is parsing the combat log and seeing if you can pull what you want from there.

EDIT:

Actually, with the nameplate unit added in legion (i forgot about that), you may be able to use a loop to scan all the active nameplates around you, but not sure if that would work.
__________________
My Addons: Convert Ratings Honor Track

Last edited by briskman3000 : 02-25-17 at 11:01 PM.
  Reply With Quote
02-25-17, 11:27 PM   #3
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
Originally Posted by briskman3000 View Post
Actually, with the nameplate unit added in legion (i forgot about that), you may be able to use a loop to scan all the active nameplates around you, but not sure if that would work.
Hi briskman3000,

I just had a look at the addon called EnemyGrid and it seems to be using the approach that you explained.

Guess I should start from this
  Reply With Quote
02-26-17, 04:30 AM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,324
The problem with using nameplate units is they only show targets that are on your screen. This means they're biased towards enemies that the player is facing and aren't very likely to show targets behind the player. There's also a limit of 30 nameplate units, meaning once that number of targets is reached, it stops assigning new UnitIDs.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
02-26-17, 07:03 AM   #5
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
Originally Posted by SDPhantom View Post
The problem with using nameplate units is they only show targets that are on your screen. This means they're biased towards enemies that the player is facing and aren't very likely to show targets behind the player. There's also a limit of 30 nameplate units, meaning once that number of targets is reached, it stops assigning new UnitIDs.
Thank you for the clarification SDPhantom!

As a matter of fact, I was actually trying to make something like EnemyGrid.
(Didn't even know that it already existed ...)

For me, I guess maximum 30 units are enough to deal with

The screen issue might be a problem tho...
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Detecting all units around me(?)


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