well ya, atm i'm just sloppy coding to get something that works then cleaning it up.
Thanks to everyone for help. going to test a few things out later. i have some other stuff based off the ScanTarget used in Emalon module. Trying to make the most efficient way to do this with the least amount user input since user error is a big one.
function mod:PLAYER_TARGET_CHANGED()
if UnitExists("target") and UnitAura("target", buffName) and not GetRaidTargetIndex("target") then
SetRaidTarget("target", 1 + iconIndex)
iconIndex = (iconIndex + 1) % 5 -- cycling over [0-4]
elseif UnitExists("target") and not UnitAura("target", buffName) and GetRaidTargetIndex("target") then
SetRaidTarget("target", 0)
end
end
i would do mod:RegisterEvent('PLAYER_TARGET_CHANGED') when p3 occurs. Haven't been able to test this with father's day and all.
Also thinking of doing an OnEvent watch for mouseovers to clear the icons before the next beacon.
if event == "UPDATE_MOUSEOVER_UNIT" then
if UnitExists("target") and not UnitAura("target", buffName) and GetRaidTargetIndex("target") then
SetRaidTarget("target", 0)
end if
if UnitExists("mouseover") and not UnitAura("mouseover", buffName) and GetRaidTargetIndex("mouseover") then
SetRaidTarget("mouseover", 0)
end if
end if
i've been working on it and figuring out a way to use the schedulerepeatingevent that is already in place to do this. I've got the mouseover thing to work and mark/unmark the guardians. Instead now, the raid leader wants it done on target. The ScanEvent will need to be updated so that the event isn't cancelled right away to continue to loop... the only question is loop till when? I would think letting the event run until the next empowering shadows would be inefficient. Its not always a set amount that get the buff so it makes it difficult to properly end the repeating event... unless i'm missing something.
first off mouseover worked so thats good. Now instead of mouseover going to try to use PLAYER_TARGET_CHANGED. Wish there was an easy way to do this by GUID. This is for Yogg-Saron. Basically trying to mark the mobs that gain Shadow Beacon. They all have the same name so it gets interesting.
looks like it does scan through the raids targets and marks that way.
local num = GetNumRaidMembers()
for i = 1, num do
local unitid = fmt("%s%d%s", "raid", i, "target")
if UnitGUID(unitid) == guid then
target = unitid
break
end
end
what i'm trying to accomplish is alter the Yogg module for BW. Basically p3 section. Immortal Guardians (random) get a buff called Shadow Beacon and I want to mark (up to 5 i believe) the guardians that have the buff. So when there are say 10 guardians up, its rather difficult to have someone targeting each one.
Was curious if there is a way to use the destGUID for marking/raid icons? I know the name can be passed which is also available, but what I'm trying to do is mark certain npc's that obtain a buff and they are all named the same.
that does work but i run into some issues, Obituary uses LibSink2.0 and the function Pour to print the output to the screen (whatever frame you choose i.e. chat, channel, popup, msbt, etc).
self:Pour( ouput, 1.0, 1.0, 1.0)
will Print the message to the screen (output which is just a string of text). Now i've tried concatinating the 2 together to form 1 output string so the handler will just paste the skull then the message... didn't really work. Any ideas?
Pour is defined below:
function sink:Pour(textOrAddon, ...)
local t = type(textOrAddon)
if t == "string" then
pour(self, textOrAddon, ...)
elseif t == "table" then
pour(textOrAddon, ...)
else
sink:error("Invalid argument 2 to :Pour, must be either a string or a table.")
end
end
and the function it calls is pour which is defined below:
local function pour(addon, text, r, g, b, ...)
local func = sink.override and sink.handlers[sink.override] or nil
if not func and sink.storageForAddon[addon] and sink.storageForAddon[addon].sink20OutputSink then
local h = sink.storageForAddon[addon].sink20OutputSink
func = sink.handlers[h]
-- If this sink is not available now, find one manually.
if customHandlersEnabled[h] and not customHandlersEnabled[h]() then
func = nil
end
end
if not func then
func = getPrioritizedSink()
end
if not func then func = chat end
func(addon, text, r or 1, g or 1, b or 1, ...)
end
no, since its just basically printing to the screen you can't. was thinking maybe i had to use something like:
local raidicon = GameTooltip:CreateTexture("GameTooltipRaidIcon", "OVERLAY", nil)
raidicon:SetTexture("Interface\\TargetingFrame\\UI-RaidTargetingIcon")
SetRaidTargetIconTexture(raidicon, 1)
not sure if that works, still testing. i know it can be done because you see mods where images are printed out and sometimes the icons are used. just don't know the code to make it work
altered the Mod obituary for a guild member and he would like me to add a {skull} icon to each line that states each persons death... i can't seem to find the api call or function i need to call to get the icon. Any help would be appreciated.
does anyone know why the mod will reset during an encounter when a person in the raid dies? Fights where i've noticed this... Ignis, Flame Leviathan, Hodir, XT-002 and Kologarn. I think it was happening on Mimiron. Not sure if it is a module problem or a part of the core of BW. Could this be caused due to not everyone having bwbm enabled? (don't think so as there are a bunch of people on live who don't use it and i see 0 issues currently).
0
Thanks to everyone for help. going to test a few things out later. i have some other stuff based off the ScanTarget used in Emalon module. Trying to make the most efficient way to do this with the least amount user input since user error is a big one.
0
i would do mod:RegisterEvent('PLAYER_TARGET_CHANGED') when p3 occurs. Haven't been able to test this with father's day and all.
Also thinking of doing an OnEvent watch for mouseovers to clear the icons before the next beacon.
0
0
0
0
local num = GetNumRaidMembers()
for i = 1, num do
local unitid = fmt("%s%d%s", "raid", i, "target")
if UnitGUID(unitid) == guid then
target = unitid
break
end
end
0
0
0
0
0
self:Pour( ouput, 1.0, 1.0, 1.0)
will Print the message to the screen (output which is just a string of text). Now i've tried concatinating the 2 together to form 1 output string so the handler will just paste the skull then the message... didn't really work. Any ideas?
Pour is defined below:
function sink:Pour(textOrAddon, ...)
local t = type(textOrAddon)
if t == "string" then
pour(self, textOrAddon, ...)
elseif t == "table" then
pour(textOrAddon, ...)
else
sink:error("Invalid argument 2 to :Pour, must be either a string or a table.")
end
end
and the function it calls is pour which is defined below:
local function pour(addon, text, r, g, b, ...)
local func = sink.override and sink.handlers[sink.override] or nil
if not func and sink.storageForAddon[addon] and sink.storageForAddon[addon].sink20OutputSink then
local h = sink.storageForAddon[addon].sink20OutputSink
func = sink.handlers[h]
-- If this sink is not available now, find one manually.
if customHandlersEnabled[h] and not customHandlersEnabled[h]() then
func = nil
end
end
if not func then
func = getPrioritizedSink()
end
if not func then func = chat end
func(addon, text, r or 1, g or 1, b or 1, ...)
end
0
local raidicon = GameTooltip:CreateTexture("GameTooltipRaidIcon", "OVERLAY", nil)
raidicon:SetTexture("Interface\\TargetingFrame\\UI-RaidTargetingIcon")
SetRaidTargetIconTexture(raidicon, 1)
not sure if that works, still testing. i know it can be done because you see mods where images are printed out and sometimes the icons are used. just don't know the code to make it work
0
0
0