View Single Post
12/12/16, 09:48 PM   #1
StackofCups
Join Date: Dec 2016
Posts: 1
All addons loaded are nil

So, everything is working fine as far as my other addons go. This is my first time trying to write an addon and I'm trying to d("hello world") withing my EVENT_ADD_ON_LOADED callback. I had the if addonName == MyAddon.name then d("hello world") but it never fired. Other things fired at other places so I eventually removed the if statement. Turns out every addonName is just nil when passed into this callback. I really don't understand why. Here's my code so far:
Code:
-- Addon Container
TheDeeps = {}
-- Container properties
TheDeeps.name = "TheDeeps"
TheDeeps.CombatEvents = {}

-- Initialization Function
function TheDeeps:OnAddOnLoaded(event, addonName)

	zo_callLater (function () d (addonName) end, 3000) -- addonName is always nil. I see nil the number of times in my chat log equal to how many addons I have installed.

	if addonName == TheDeeps.name then
		zo_callLater(function() d(addonName) end, 3000)
	end
end


-- Register for loaded event to trigger addon initialization
	EVENT_MANAGER:RegisterForEvent(TheDeeps.name, EVENT_ADD_ON_LOADED, TheDeeps.OnAddOnLoaded)
  Reply With Quote