View Full Version : Targeting a raidmember
Athene
05-06-2007, 03:40 PM
I wanted to make a mod that gives me a list of everybody in raid who needs healing, and now I've got everything finished but buttons to target those in need.
I know the TargetByName("unit") was removed a while ago, but I seem to remember from somewhere that it's still possible to target friendly units, atleast those in party\raid. Also, CT_RaidAssist is already doing this, so I must be able to do it too.
I tried to look through the codes in CT_RA, but the mod is so big...
So anyone have any idea how I can do this?
Tunga
05-06-2007, 05:54 PM
You can't intelligently target so there's no way you could get a button to point to the person with the lowest health if that's what you're trying to do.
Athene
06-06-2007, 04:26 PM
There's no difference from what CT_RA does when you click a button with some raidmembers name on it, than from what Im trying to do. I just need to know how it's done, preferably without having to read through tons of code.
Duugu
06-06-2007, 05:15 PM
You can't target a unit via lua code.
You'll have to set up a secure frame. Then set "type" to "target" and "unit" to a UnitID
frame:SetAttribute("type*", "target");
frame:SetAttribute("unit*", target);
Secure frames overview: http://www.wowwiki.com/Secure_Frames_Overview
UnitID overview: http://www.wowwiki.com/API_TYPE_UnitId
Tunga
06-06-2007, 06:32 PM
It sounds like there is a key difference. CTRA frames target one specific raid member and that target is locked to that frame, at least until the end of the fight (such things can only be changed outside of combat). You cannot have a frame intelligently target the person with lowest hitpoints while in combat. See Duugu's post above for the way to create what is basically just a unit frame.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.