Thread Tools Display Modes
02-05-10, 02:02 AM   #1
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
"PLAYER_ALIVE" Alternative?

Is there any particular reason why PLAYER_ALIVE doesn't fire on log in?

I've read the events to which it fires, but using it in the addon load sequence hasn't worked for me.

It just simply isn't triggering.

Any ideas?
  Reply With Quote
02-05-10, 03:49 AM   #2
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
I personally use "PLAYER_ENTERING_WORLD" for pretty much everything exept savedvar for which I use "ADDON_LOADED".
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.
  Reply With Quote
02-05-10, 04:08 AM   #3
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,936
I used PLAYER_ENTERING_WORLD as well as VARIABLES_LOADED. I use ADDON_LOADED when I need to but most of the time I can avoid it.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
02-05-10, 04:23 AM   #4
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
PLAYER_ALIVE fires for first logon but not for ReloadUI.

As a rule of thumb:
If you need to delay initialization of something on a clean start (entering the game from the account selection level) you can use PLAYER_ALIVE as it will fire after PLAYER_ENTERING_WORLD.

If you need to do the same after a reload (or entering the game after logging out to the character selection screen only) you can use PLAYER_ENTERING_WORLD and it will have the same effect.
(things that might not be available to the client at P_E_W on a clean start will be after a reload and for the rest PLAYER_ALIVE is usually delayed enough)

Bottomline if you need to use one of them, use both and unregister when you've done what you want to do.
  Reply With Quote
02-05-10, 04:55 AM   #5
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 318
Yeah, Dridzt is right, it will only fire on a "cold" login so to speak. If you're using PLAYER_ALIVE to know when talents are available you can register for PLAYER_ENTERING_WORLD and when it fires do this:

lua Code:
  1. if (GetNumTalentTabs() == 0) then
  2.     frame:RegisterEvent("PLAYER_ALIVE")
  3. else
  4.     -- talents are available already, so this was probably a /reload.
  5. end
__________________
Oh, the simulated horror!
  Reply With Quote
02-05-10, 01:42 PM   #6
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,327
I usually use PLAYER_LOGIN. It fires when everything's ready and only fires at loading.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » "PLAYER_ALIVE" Alternative?


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