GetDungeonDifficultyID and PLAYER_DIFFICULTY_CHANGED do they go together?
function FIZ_OnLoad(self)
-- Events monitored by Event Handlerend function FIZ_OnEvent(self, event, ...) local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13 = ... elseif ( event == "PLAYER_DIFFICULTY_CHANGED") thenendFIZ_difficultyID = GetDungeonDifficultyID() ok the sticky said to enter the entire code so i'v put in the main part. Is PLAYER_DIFFICULTY_CHANGED the correct event to pull when the dungeon difficulty (normal/heroic) is toggled. I have the correct setup to get the difficulty but can't get the thing to fire when i toggle it. |
Did you double-check that it's firing by putting in a print() statement or watching the event trace (/eventtrace)?
|
thank you
well it didn't fire but now that iv figured out print (i am :o i still haven't learned lua fully but i am trying ;)) now i am shoving in prints everywhere to find out its flow chart. but event trace didn't find an event when i changed from normal to heroic (arrg:mad:). so i still need to find out what it shows up as.
|
I'm not sure when PLAYER_DIFFICULTY_CHANGED is triggered...
AFAIK you can not change dungeon difficulty while inside a heroic/instance, so logic-wise one would use CHAT_MSG_SYSTEM event to scan the message for DUNGEON_DIFFICULTY or RAID_DIFFICULTY. The correct message is formatted with ERR_DUNGEON_DIFFICULTY_CHANGED_S. I can't give a code example as I forgot how to do sscanf-like(php) function call in lua. Another event which might be helpful is PLAYER_ENTERING_WORLD. This triggers if the player is entering an instance. |
Quote:
Next, some random tips for Lua addons: Quote:
Code:
-- Nothing I'm listening for uses arg3/4/5 or 7+ Code:
function FarmForum_OnEvent (self, event, ...) Code:
local MyFrame = Global_Name_of_FarmForum_Frame_From_Wherever_I_Declared_It |
Quote:
Using GetInstanceInfo() seems to provide the correct info about what difficulty is used. lua Code:
|
All times are GMT -6. The time now is 03:14 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI