WoWInterface (
-   oUF (Otravi Unit Frames) (
-   -   Boss frames not working anymore (

zork 03-27-13 04:29 PM

Boss frames not working anymore

Bug is fixed. The trick is to use frequentUpdates for the statusbar and the health tag for boss frames. UNIT_HEALTH does not fire properly for bossframes.
Damn. Since the last push and changes to the bossframe only the bossframe you are currently watching will update. All other bossframes will stick at 100% hp.

Made a screenshot of the Magera encounter.

All heads are at 100%. The tooltip shows the correct health of the other snake head.


Maybe it is my issue. Has the way how bossframes will be spawned got changed? I'm curious because on my screenshot two of the bossframes have the same name aswell. Could be a hint.

My spawn code is:
Lua Code:
  1. if then
  2.     oUF:RegisterStyle("diablo:boss", createStyle)
  3.     oUF:SetActiveStyle("diablo:boss")
  4.     local boss = {}
  5.     for i = 1, MAX_BOSS_FRAMES do
  6.       local name = "oUF_DiabloBossFrame"..i
  7.       local unit = oUF:Spawn("boss"..i, name)
  8.       if i==1 then
  9.         unit:SetPoint(cfg.units.boss.pos.a1,,cfg.units.boss.pos.a2,cfg.units.boss.pos.x,cfg.units.boss.pos.y)
  10.       else
  11.         unit:SetPoint("TOP", boss[i-1], "BOTTOM", 0, -5)
  12.       end
  13.       table.insert(oUF_Diablo_Units,name) --add frames to the slash command function
  14.       func.applyDragFunctionality(unit)
  15.       boss[i] = unit
  16.     end
  17.   end

Kagura 03-28-13 02:47 AM

Think your answer might be next :

zork 03-28-13 03:13 AM

If I understood haste correctly boss frames are now real unitframes. Thus they should poll events like UNIT_HEALTH/UNIT_POWER on unit basis.

Thus you should be able to do sth like this:

Lua Code:
  1. RegisterUnitEvent("UNIT_HEALTH","boss1","boss2","boss3","boss4","boss5")
  2. RegisterUnitEvent("UNIT_POWER","boss1","boss2","boss3","boss4","boss5")

Either this is not working as intended or sth else is wrong. Either way. The bossframes do not update correctly atm.

Kagura 03-28-13 03:45 AM

I don't think boss units are real units (maybe they changed it and they are supposed to be, but they are still not). I don't use oUF, but I have the exact same problem in my own unitframes if I don't poll boss units.

Phanx 03-28-13 05:40 AM

RegisterUnitEvent only supports up to 2 units to filter on:

frame:RegisterUnitEvent(event, unit1, unit2)

zork 03-28-13 06:00 AM


I checked ShadowedUnitFrames. He is still polling boss frame updates via OnUpdate. That is because his download is version 3.8.5.

The latest changelog including the clique-shiv and bossframe change is 3.8.6 but that version is not available for download. The download on wowace is working properly:


I checked version 3.8.6. He did remove the OnUpdate polling of the boss frames. Not sure if he has any issues though.

haste 03-28-13 04:29 PM

Is it just one fight it bugs out on or all of them? I've only done some limited testing in RFC and it seemed that events worked properly there (with and without the boss targeted).

zork 03-28-13 07:16 PM

I had the same issue on the Raigonn encounter. (
There is a green bossframe showing the weakness. It does not update properly aswell. That was the first time I encountered the bug.

The bug will only appear if more that one bossframe is in place. The current bossframe you are facing will always work properly. But bossframes you are not facing (interacting with) will not update properly.

Maybe it can only be tested with other players being around doing damage to units you do not interact with. Once you swap targets the bossframe will update to the proper values. Currently it seems like the bossframes get frozen in place (receive no update) until you actively interact with them.

Maybe events are registered to player thus they will not fire if others interact?! Just guessing here sorry.

myno 03-29-13 11:01 AM


Originally Posted by zork (Post 275444)
The bug will only appear if more that one bossframe is in place. The current bossframe you are facing will always work properly. But bossframes you are not facing (interacting with) will not update properly.

I had the same bug yesterday on the Ji-Kun encounter while being dead on the bottom of the room (out of range of the boss). There's only one boss frame and it did not update unless I targeted the boss directly.

gagou 03-30-13 01:00 PM

My boss unit frames seems to be updating correctly (at least on elder council in ToT).

My oUF is a little bit custom :
in units.lua I have registered INSTANCE_ENCOUNTER_ENGAGE_UNIT to boss uf with the following :

        elseif(unit:match'(boss)%d?$' == 'boss') then
                object:RegisterEvent('INSTANCE_ENCOUNTER_ENGAGE_UNIT', object.UpdateAllElements)

I'm also using a custom events.lua from Adirelle which use RegisterUnitEvent.

zork 03-30-13 08:53 PM

Thanks. Currently trying your suggestions.

Tested it on the Raigonn encounter again. Does not work. The weak spot will not update to the correct value unless you actively damage it.

haste 03-31-13 05:49 AM

Add true as the third argument to :RegisterEvent:
Lua Code:
  1. elseif(unit:match'(boss)%d?$' == 'boss') then
  2.         object:RegisterEvent('INSTANCE_ENCOUNTER_ENGAGE_UNIT', object.UpdateAllElements, true)

It seems the event also fires during the encounters, to force updates on all boss frames.

zork 04-01-13 07:37 AM


Please see below...

I finished my test. UNIT_HEALTH is not working properly. It does not fire if a boss unit loses HP. It will fire if you target that unit though. That explains why only the current boss that you are looking at will update.

Made some shots for prove:

I think this a bug of the Blizzard API. I tested the same for UNIT_POWER. Guess what. It just works.

Thus UNIT_POWER is currently working properly. UNIT_HEALTH is not.


Hmmm...maybe I still forget sth. But from my understanding UNIT_HEALTH does not fire enough. It does only fire for the current target frame.

Going to try sth special now...damage done with a mouseover macro while targeting a pet. Maybe UNIT_HEALTH will not fire once. This would be really bad.


Just tested it. As I thought. I targeted my pet and did cleave damage with mouseover macros for 3 minutes. Not a single UNIT_HEALTH event call. Not one! But the mouseover tooltip shows that the boss units have lost health. Quite a downer imo.

UNIT_POWER works. UNIT_HEALTH just does not fire at all unless you are targeting one of the boss units. Then it will fire for that one unit.

Sure you get updates here and there if you register "UNIT_TARGETABLE_CHANGED" or "INSTANCE_ENCOUNTER_ENGAGE_UNIT" when the bossframes swap but that is by far not enough when it comes to unit_health.

The only time you will get UNIT_HEALTH to work is if you actively target a bossframe. If you do this the UNIT_HEALTH event will work. But only for the unit you are targeting.

Thus I went back to the OnUpdate. That still works flawlessly. If Blizzard fixes the BUG that UNIT_HEALTH is not firing for boss units we can remove the OnUpdate. But atm it is not possible.

Lua Code:
  1. elseif(unit:match'(boss)%d?$' == 'boss') then
  2.     --object:RegisterEvent('INSTANCE_ENCOUNTER_ENGAGE_UNIT', object.UpdateAllElements, true)
  3.     --object:RegisterEvent('UNIT_TARGETABLE_CHANGED', object.UpdateAllElements)
  4.     enableTargetUpdate(object)
  5.   elseif(unit:match'%w+target') then
  6.         enableTargetUpdate(object)
  7.     end

I checked the Blizzard code. They are using OnUpdates to poll HealthUpdates but as far as I can tell only for PlayerUnits or TargetTarget.

No clue how the default bossframe health actually is capable of updating properly.

There is a thread on that on wowprogramming aswell:

Rainrider 04-01-13 08:01 PM

It's probably strange, but I did some lfr today and all multiple boss encounters updated correctly as far as I can tell. Tested The Stone Guard, Council of Elders and Megaera. I use oUF 1.6.4 without any modifications. I use UNIT_HEALTH_FREQUENT though, so maybe that's the issue?

zork 04-02-13 12:50 AM

Could be possible that UNIT_HEALTH_FREQUENT may fire correctly even if you are not targeting the unit. On the other hand I'm pretty sure UNIT_HEALTH_FREQUENT is nothing more than a hidden OnUpdate in the back...

Same idea is used here:

Gonna test it. If it works adding "self.Health.frequentUpdates = true" should fix the issue on bossframes.

zork 04-02-13 01:34 PM

Finished my test. Thank god. UNIT_HEALTH_FREQUENT does fire correctly for all boss units. No clue what is wrong with UNIT_HEALTH. So adding frequentUpdates to the boss unit healthbars fixes the health issue.

If you are changing your health values via tags make sure that boss unit health strings use a health tag that uses UNIT_HEALTH_FREQUENT aswell. Otherwise only that statusbar will update correctly. I suggest creating a new tag for that purpose since you may not want that event on all units.

I will just post some stuff I'm using atm:

Boss tags
Lua Code:
  1. --boss health value
  2.   oUF.Tags.Methods["diablo:bosshp"] = function(unit)
  3.     local val = oUF.Tags.Methods["perhp"](unit)
  4.     return val or ""
  5.   end
  8.   --boss power value
  9.   oUF.Tags.Methods["diablo:bosspp"] = function(unit)
  10.     if UnitIsDeadOrGhost(unit) then return "" end
  11.     local str = ""
  12.     --power value tracking (show percentage if max power > 0)
  13.     local pp_max = UnitPowerMax(unit)
  14.     if pp_max > 0 then
  15.       str = str..oUF.Tags.Methods["perpp"](unit).."%"
  16.     end
  17.     --additional altpower tracking
  18.     local ap_max = UnitPowerMax(unit, ALTERNATE_POWER_INDEX)
  19.     local color = "0099ff"
  20.     if pp_max > 0 and ap_max > 0 then
  21.       str = str.." ("
  22.     end
  23.     if ap_max > 0 then
  24.       local ap_cur = UnitPower(unit, ALTERNATE_POWER_INDEX)
  25.       str = str.."|cff"..color..("%s%%"):format(floor(ap_cur/ap_max*100)).."|r"
  26.     end
  27.     if pp_max > 0 and ap_max > 0 then
  28.       str = str..")"
  29.     end
  30.     --return "93% (|cff"..color..("%s%%"):format(30).."|r)" --debug
  31.     return str or ""
  32.   end
  33.   oUF.Tags.Events["diablo:bosspp"] = "UNIT_POWER UNIT_MAXPOWER UNIT_TARGETABLE_CHANGED"

Boss health statusbar. The powerbar does not need frequentupdates it works properly without.
Lua Code:
  1. self.Health.frequentUpdates = true

I added this to oUF/units.lua
Lua Code:
  1. elseif(unit:match'(boss)%d?$' == 'boss') then
  2.     object:RegisterEvent('INSTANCE_ENCOUNTER_ENGAGE_UNIT', object.UpdateAllElements, true)
  3.     object:RegisterEvent('UNIT_TARGETABLE_CHANGED', object.UpdateAllElements)

INSTANCE_ENCOUNTER_ENGAGE_UNIT is unitless thus the third attribute has to be set to true.

Rainrider 04-02-13 01:43 PM

I don't register INSTANCE_ENCOUNTER_ENGAGE_UNIT, neither do the current oUF version. And it updates properly, meaning it also shows all boss units. There are 9 UNIT_HEALTH_FREQUENT events between 2 UNIT_HEALTH if I recall correctly. If UNIT_HEALTH_FREQUENT is a hidden polling, why would Blizzard not just register for it but rather poll it in lua in UnitFrame.lua and the like?

I'll try to test Omnotron Defense System as INSTANCE_ENCOUNTER_ENGAGE_UNIT probably plays a role there.

zork 04-02-13 01:47 PM

Make sure you target your pet and use only mouseover macros. UNIT_HEALTH will not fire once for your boss units.

Once you activate UNIT_HEALTH_FREQUENT it will fire properly. bug is gone test is finished. Thanks for help.

You don't have to register the other two events. It's just nice to do it since they fire once an encounter starts or when bossframes switch places.

Phanx 04-02-13 04:23 PM


Originally Posted by Rainrider (Post 275704)
If UNIT_HEALTH_FREQUENT is a hidden polling, why would Blizzard not just register for it but rather poll it in lua in UnitFrame.lua and the like?

Because it's way more efficient to do the polling C-side and fire off events, than for 5, 10, or 100 addons to run identical OnUpdate scripts in Lua. I mean, in theory you could just use OnUpdate for everything instead of responding to events... but I'm pretty sure even the UI coders at Blizzard, with their inexplicable love for ugly and inefficient code, would laugh at you if you did that. :p

Rainrider 04-04-13 04:23 PM

Phanx, that was exactly my point, I'm sorry if I expressed it wrongly. I asume the Blizzard event dispatcher is C coded, but they set an OnUpdate script for the stock frames instead of registering UNIT_HEALTH_FREQUENT. Why would they do that? The only reason I could think of would be that UNIT_HEALTH_FREQUENT does not work like other events and simply sets an OnUpdate script on the frame it gets registered to. Hm, would that be what Zork suspects which I didn't understand in my previous post? Apart from that, OnUpdate is also a kind of event handler reacting to the event of refreshing the screen, isn't it? Please excuse me for drifting away from the thread topic.

All times are GMT -6. The time now is 01:47 PM.

vBulletin © 2018, Jelsoft Enterprises Ltd
© 2004 - 2017 MMOUI