View Single Post
05/01/14, 02:01 AM   #20
LilBudyWizer
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 32
It works, you must have made some mistake. I did a similar thing to try to find what event precedes another. The main thing you need to watch is the saved variables is created just prior to EVENT_ADD_ON_LOADED for your addon being called as near as I can tell. So anything you placed in that variable before that is gone. If there's a saved variables file then it's replaced with that. If not then it's empty, not just left whatever it was. So you can't use that variable until the addon loaded event for your addon.

As far as your original question you should initialize your addon during EVENT_ADD_ON_LOADED. Just as a general rule your addon should be functional when that completes. Conceptually another addon should be able to watch for you to load and then use you. That doesn't mean they get accurate data since the subsystems you use may not be populated yet, but everything functions. Static data should be captured at EVENT_PLAYER_ACTIVATED though. All the subsystems are up-to-date at that point. Specifically guild and social data isn't loaded until after the addons are loaded. Also the POI locations for quests aren't loaded yet either.

Some, I believe is deferred, i.e. running async, so you can't count on when the list gets populated, just that it has been by player activation. I suspect the reason social and guild data isn't loaded until so late is they have problems with those subsystems on the server. I get about 12s from the first addon loading to character activation while my addon takes 0.017s to load. My mod for logging event isn't timestamping them yet so I can't see exactly where the delay lies, but I suspect most of it is waiting on guild and social data to load. The point being though that you can count on the order things are loaded. They seem to just send off requests and they get responses whenever the server gets around to it. The initial EVENT_PLAYER_ACTIVATED seems to fire once all initial data requests have completed.
  Reply With Quote