
Originally Posted by
Levva
Should really be a separate thread, as I don't think this is a bug just an understanding issue.
There is no guarantee that your group members are group01, group02 etc. Initially yes it will be like this but with adding/removing group people as happens a LOT during things like invasion events, you can quite easily have a group of 2 where one person is "group02" and other is "group19" (in a raid setup ofc).
Note that if your group is group01, group02, group03 it MIGHT show up as group01, player, group03 or it might show up as player1.target, player, group01.pet.target if you are targeting the first player and the first player's pet is targeting the 3rd player. HOWEVER in this circumstances doing an Inspect.Unit.Detail("group02") will still give you back details for yourself just as if you had used Inspect.Unit.Detail("player"). The reason for this is that multiple specifiers can refer to the same unit ID, its just that Inspect.Unit.List only returns a single specifier for each unit randomly chosen. (cf. Inspect.Unit.List documentation "Units with multiple valid specs will have one chosen at random.").
Personally I'd like to have Inspect.Group.List() to return a table of unit IDs of the members of your group. With Event.Group.Add and Event.Group.Remove firing when a player joined or left your group.
You can create your own Inspect.Group.List() function: Code:
Inspect.Group = Inspect.Group or {}
function Inspect.Group.List()
local unitSpec = {"group01", "group02", "group03", "group04", "group05", "group06", "group07", "group08", "group09", "group10", "group11", "group12", "group13", "group14", "group15", "group16", "group17", "group18", "group19", "group020"}
local retList = {}
for _,unit in pairs(unitSpec) do
if Inspect.Unit.Lookup(unit) then
retList[unit] = Inspect.Unit.Lookup
end
end
return retList
end
Your current group position as player should return your unit ID when you lookup by group, so you can compare Inspect.Unit.Lookup("groupXX") with Inspect.Unit.Lookup("player") to see what position you are within the group. Specifiers that are returned are the shortest, most convenient way to address a unit.....it's easier to address "player" than "group02", for example.
Bookmarks