Thread Tools Display Modes
05-17-17, 10:27 PM   #1
DarkruneDOTDK
A Murloc Raider
Join Date: Oct 2015
Posts: 9
I got some issues with some UI update

Hi.

I am fairly new to making addons for WoW and started recently on a little project. Right now I try to get all the emissaries currently available to the character and I want to change the UI then a World Quest gets completed.

My problem right now is, that I can't seem to get them to update... It tells me that it tries to get length of table but it's nil, even though I specifically declares it above the function that sets up the event listener.

The event I am currently using is QUEST_POI_UPDATE, though I am not sure it's the right event for it either...

The source code is attached.

Any help is appreciated.
Attached Files
File Type: lua WQCompanion.lua (3.8 KB, 110 views)
  Reply With Quote
05-18-17, 01:32 AM   #2
VincentSDSH
Non-Canadian Luzer!
 
VincentSDSH's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 350
The only event you watch for is QUEST_POI_UPDATE which doesn't fire when a WQ or EQ is completed.

QUEST_LOG_UPDATE will fire several times and returns no data.

QUEST_TURNED_IN and QUEST_REMOVED will fire for the World Quest you just completed.

QUEST_WATCH_UPDATE will fire a couple times but only returns a QuestIndex not a QuestID.

I had the same kind of headache when writing my own quest tracker and the Quest Intern module for Executive Assistant. Saying that Blizzard doesn't make it easy is an understatement.

You may want to keep an eye on QUEST_REMOVED and refresh the Emissaries then, at least the few brain cells awake at 2:30am tell me.
__________________
AddonsExecutive Assistant User Configurable To-Do ListLegible Mail Choose the Font for Your Mail
  Reply With Quote
05-18-17, 02:04 AM   #3
DarkruneDOTDK
A Murloc Raider
Join Date: Oct 2015
Posts: 9
Originally Posted by VincentSDSH View Post
The only event you watch for is QUEST_POI_UPDATE which doesn't fire when a WQ or EQ is completed.

QUEST_LOG_UPDATE will fire several times and returns no data.

QUEST_TURNED_IN and QUEST_REMOVED will fire for the World Quest you just completed.

QUEST_WATCH_UPDATE will fire a couple times but only returns a QuestIndex not a QuestID.

I had the same kind of headache when writing my own quest tracker and the Quest Intern module for Executive Assistant. Saying that Blizzard doesn't make it easy is an understatement.

You may want to keep an eye on QUEST_REMOVED and refresh the Emissaries then, at least the few brain cells awake at 2:30am tell me.
Thanks you ☺. At least the event I use now is correct... Still have some issues with the update part, as the update function for some reason gets nil, even though it has used the table to create the UI :-/

EDIT: I might have figured out, what I had done wrong... My UI was made of tables and the Emissary table was a parent table for the ui table, so when I reloaded the emissaries then the ui table would be removed in the process.

EDIT 2: Nevermind... problem still persists :-/

Last edited by DarkruneDOTDK : 05-18-17 at 03:12 AM.
  Reply With Quote
05-18-17, 04:20 AM   #4
VincentSDSH
Non-Canadian Luzer!
 
VincentSDSH's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 350
What's 'getting nil'? (& post your updated code if you still need help )
__________________
AddonsExecutive Assistant User Configurable To-Do ListLegible Mail Choose the Font for Your Mail
  Reply With Quote
05-18-17, 09:37 AM   #5
DarkruneDOTDK
A Murloc Raider
Join Date: Oct 2015
Posts: 9
Originally Posted by VincentSDSH View Post
What's 'getting nil'? (& post your updated code if you still need help )
It may be easier to see the code, than explaining it, but I will try. Most of the was more or less objects build in a chained kind of way. Found out I had a table called WQCompanion.Emissaries where I kept the emissaries, and some sort of extension of it called WQCompanion.Emissaries.ui. I think my problem was, that when I reloaded the WQCompanion.Emissaries, the child object/table if we can call it that would be erased or reset to nil or something. This might have caused the nil error for WQCompanion.Emissaries.ui.

I haven't figured it out completely how to update the elements correctly after a World Quest get completed.

I have attached my updated code below, where I tried to untangle the code a little bit, so the WQCompanion.Emissaries.ui has become WQCompanion.Emissaries and the emissaries are saved in their own local table.
Attached Files
File Type: lua WQCompanion.lua (5.5 KB, 104 views)
  Reply With Quote
05-18-17, 09:58 AM   #6
VincentSDSH
Non-Canadian Luzer!
 
VincentSDSH's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 350
I'd run around with it and see what I can see but I'd need the rest of the package.
__________________
AddonsExecutive Assistant User Configurable To-Do ListLegible Mail Choose the Font for Your Mail

Last edited by VincentSDSH : 05-18-17 at 10:07 AM.
  Reply With Quote
05-19-17, 10:34 AM   #7
DarkruneDOTDK
A Murloc Raider
Join Date: Oct 2015
Posts: 9
I have attached the folder as a zip file.
Attached Files
File Type: zip WQCompanion_Test.zip (1.8 KB, 104 views)
  Reply With Quote
05-19-17, 02:43 PM   #8
Kakjens
A Cliff Giant
Join Date: Apr 2017
Posts: 75
VincentSDSH is probably curious about the presence of DLU.
  Reply With Quote
05-19-17, 04:16 PM   #9
VincentSDSH
Non-Canadian Luzer!
 
VincentSDSH's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 350
Originally Posted by Kakjens View Post
VincentSDSH is probably curious about the presence of DLU.
^^^ I don't recognize DLU in a WoW context (library, framework, etc) and it's not referenced in the .toc or .lua so it's assumed to be part-of-the-environment as if WQC is an undeclared module/extension.
__________________
AddonsExecutive Assistant User Configurable To-Do ListLegible Mail Choose the Font for Your Mail
  Reply With Quote
05-19-17, 06:14 PM   #10
DarkruneDOTDK
A Murloc Raider
Join Date: Oct 2015
Posts: 9
Originally Posted by VincentSDSH View Post
^^^ I don't recognize DLU in a WoW context (library, framework, etc) and it's not referenced in the .toc or .lua so it's assumed to be part-of-the-environment as if WQC is an undeclared module/extension.
Ahh yeah, that right... Sorry about that. I use the DLU from my other addon. I have attached the other addon.
Attached Files
File Type: zip DarkruneDKLevelUp.zip (46.7 KB, 80 views)
  Reply With Quote
05-20-17, 02:09 AM   #11
VincentSDSH
Non-Canadian Luzer!
 
VincentSDSH's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 350
Damn, it is DKLevelup. I ran across that in a search and dismissed it as a false positive.

Thanks.

Edit: Ok...I'm confused. Where is DLU.EmissaryCheck() defined? I couldn't find it in the .lua or in the DKLU package.

When you first log in, var bounty is nil so no error and an empty table. If you reload, GetQuestBountyInfoForMapID() will return data to process and then it dies on the DLU.EmissaryCheck() call. I worked around that by defining the two vars but I'm still not seeing a per-se nil.

It could be that GetQuestBountyInfoForMapID() is not ready to return EQ data when the event is triggered for the WQ completion; you might try setting a delay before you update rather than triggering immediately off the event, or at least verifying the data returned by GetQuestBountyInfoForMapID() when the event is triggered if you're not up to digging around in their UI code to see what they're up to with their EQ tracker.
__________________
AddonsExecutive Assistant User Configurable To-Do ListLegible Mail Choose the Font for Your Mail

Last edited by VincentSDSH : 05-20-17 at 07:49 AM.
  Reply With Quote
05-21-17, 07:47 AM   #12
DarkruneDOTDK
A Murloc Raider
Join Date: Oct 2015
Posts: 9
Originally Posted by VincentSDSH View Post
Damn, it is DKLevelup. I ran across that in a search and dismissed it as a false positive.

Thanks.

Edit: Ok...I'm confused. Where is DLU.EmissaryCheck() defined? I couldn't find it in the .lua or in the DKLU package.

When you first log in, var bounty is nil so no error and an empty table. If you reload, GetQuestBountyInfoForMapID() will return data to process and then it dies on the DLU.EmissaryCheck() call. I worked around that by defining the two vars but I'm still not seeing a per-se nil.

It could be that GetQuestBountyInfoForMapID() is not ready to return EQ data when the event is triggered for the WQ completion; you might try setting a delay before you update rather than triggering immediately off the event, or at least verifying the data returned by GetQuestBountyInfoForMapID() when the event is triggered if you're not up to digging around in their UI code to see what they're up to with their EQ tracker.
DLU.EmissaryCheck() should be defined in QuestCompanion.lua near the bottom. The nil value doesn't pop up anymore after I restructured the code.

I will try to look through some of the Blizzard Interface code and see, if I can figure out how they are doing it.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » I got some issues with some UI update

Thread Tools
Display Modes

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