Thread Tools Display Modes
11-19-09, 10:13 AM   #1
Waverian
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 188
Power frequent updates error.

Message: Interface\AddOns\oUF\elements\power.lua:46: attempt to call method 'UNIT_MAXMANA' (a nil value)
Time: 11/19/09 11:07:01
Count: 1
Stack: [string "Interface\FrameXML\BasicControls.xml:<Scrip..."]:18: in function <[string "Interface\FrameXML\BasicControls.xml:<Scrip..."]:4>
[C]: in function `UNIT_MAXMANA'
Interface\AddOns\oUF\elements\power.lua:46: in function <Interface\AddOns\oUF\elements\power.lua:39>

Locals: self = <unnamed> {
min = 100
frequentUpdates = 1
0 = <userdata>
unit = "player"
bg = <unnamed> {
}
disconnected = false
}
power = 100
(*temporary) = nil
(*temporary) = <unnamed> {
0 = <userdata>
}
(*temporary) = "OnPowerUpdate"
(*temporary) = "player"
(*temporary) = "attempt to call method 'UNIT_MAXMANA' (a nil value)"
UnitMana = <function> defined =[C]:-1
My code. I might be out of it but my code seems pretty standard and I've never had this problem before.

lua Code:
  1. if unit == 'player' then
  2.         -- an extraneous frame to avoid frame level / strata problems with our backdrop
  3.         self.PowerFrame = CreateFrame('Frame', nil, self)
  4.         self.PowerFrame:SetFrameLevel(4)
  5.         self.PowerFrame:SetBackdrop(backdrop)
  6.         self.PowerFrame:SetBackdropColor(0, 0, 0)
  7.         self.PowerFrame:SetPoint('BOTTOMLEFT', self.Health, 'BOTTOMLEFT', 2, 2)
  8.         self.PowerFrame:SetPoint('TOPRIGHT', self.Health, 'BOTTOMRIGHT', -3, 10)
  9.        
  10.         self.Power = CreateFrame('StatusBar', nil, self.PowerFrame)
  11.         self.Power:SetStatusBarTexture(texture)
  12.         self.Power:SetAllPoints()
  13.         self.Power.colorPower = 1
  14.         self.Power.frequentUpdates = 1
  15.        
  16.         self.Power.bg = self.Power:CreateTexture(nil, 'BACKGROUND')
  17.         self.Power.bg:SetTexture(texture)
  18.         self.Power.bg:SetAllPoints()
  19.         self.Power.bg.multiplier = .6

This problem persists from most recent wowi release all the way back to at least v1.3 core. I can't try anything more recent because github refuses to let me download files on two different browsers.

edit: I should clarify if it wasn't already. This error only happens when self.Power.frequentUpdates is non-nil.

Last edited by Waverian : 11-19-09 at 10:17 AM.
  Reply With Quote
11-19-09, 10:24 AM   #2
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
I've never had any trouble with it but my Power Statusbar does not, and never has had a custom parent. Try checking it it's any different without a custom parent?
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.

Last edited by v6o : 11-19-09 at 11:23 AM. Reason: Reworded
  Reply With Quote
11-19-09, 11:14 AM   #3
Waverian
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 188
And that was the obvious mistake I missed. I set the parent to the oUF frame (self) rather than to my extra frame and it works fine. Thanks.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Power frequent updates error.


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