Thread Tools Display Modes
06-15-10, 07:33 PM   #1
Phenomena
A Murloc Raider
Join Date: Oct 2008
Posts: 5
BagBuddy Tutorial Help

Ok, so I bought the WoW Programming book the other day, and I'm reading through it working on the BagBuddy addon that it walks you through and I'm having some issues.

Code:
-- Create the filter buttons
	self.filters = {}
	for idx=0, 5 do 
		button = CreateFrame("CheckButton", "BagBuddy_Filter" .. idx, self, "BagBuddyFilterTemplate")
		SetItemButtonTexture(button, "Interface\\Icons\\INV_Misc_Gem_Pearl_03")
		self.filters[idx] = button
		
		if idx == 0 then
			button:SetPoint("BOTTOMLEFT", 40, 200)
		else
			button:SetPoint("TOPLEFT", self.filters[idx-1], "TOPRIGHT", 12, 0)
		end
		
		button.icon:SetVertexColor(GetItemQualityColor(idx))
		button:SetChecked(false)
		button.quality = idx
		button.glow:Hide()
	end
	self.filters[-1] = self.filters[0]
Is the code thats causing me problems, more specifically this line (I think lol)

Code:
SetItemButtonTexture(button, "Interface\\Icons\\INV_Misc_Gem_Pearl_03")
the LUA error im getting in game:

Message: Interface\FrameXML\ItemButtonTemplate.lua:46: attempt to index field '?' (a nil value)
Time: Tue Jun 15 21:31:56 2010
Count: 1
Stack: Interface\FrameXML\ItemButtonTemplate.lua:46: in function `SetItemButtonTexture'
Interface\AddOns\BagBuddy\BagBuddy.lua:22: in function <Interface\AddOns\BagBuddy\BagBuddy.lua:1>

Locals: button = BagBuddy_Filter0 {
0 = <userdata>
}
texture = "Interface\Icons\INV_Misc_Gem_Pearl_03"
(*temporary) = nil
(*temporary) = nil
(*temporary) = "IconTexture"
(*temporary) = "attempt to index field '?' (a nil value)"
edit: solved my problem, I made a typo in my xml file >.> Template is hard word to spell apparently

Last edited by Phenomena : 06-15-10 at 08:51 PM.
  Reply With Quote
06-22-10, 11:37 AM   #2
b3vad
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Jun 2010
Posts: 21
what mistake

can you tell me what was your mistake?
i have similar problem with my adoon!

Code:
Message: [string "F_K1A:OnLoad"]:1: attempt to call global 'F_K1A_OnLoad' (a nil value)
Time: 06/22/10 22:08:25
Count: 1
Stack: [string "*:OnLoad"]:1: in function <[string "*:OnLoad"]:1>

Locals: self = F_K1A {
 0 = <userdata>
}
(*temporary) = nil
(*temporary) = "attempt to call global 'F_K1A_OnLoad' (a nil value)"
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » BagBuddy Tutorial Help


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