• 0

    posted a message on getting table id if __tostring is set in metatable
    Currently when you call tostring() on a table you get back some kind of identifier or address for the table which can be useful when debugging.

    Is there another way to get that info? I'd like to provide a __tostring metamethod on some of my tables, but once I do I lose the only way I know how get that value.
    Posted in: Lua Code Discussion
  • 0

    posted a message on how to know a quest is finished
    Thanks for the link, it turned out to be very helpful. So it turns out that I was backing the wrong horse in terms of QUEST_LOG_UPDATE versus UNIT_QUEST_LOGGED_CHANGED. I was mislead by the documentation page on wowprogramming.com for QUEST_LOG_UPDATE which says:
    This event (QUEST_LOG_UPDATE) should therefore only be used if you care about the QUEST LOG itself more than the quests; ie if you implement a custom quest log, then you'd use this event to update the display when things like dailies reset or headers change.
    However, if you are ONLY interested in tracking QUEST-related information (accepting quests, abandoning quests, achieving quest progress, and completing quests), there's a better event: UNIT_QUEST_LOG_CHANGED.


    So when the quest is completed UQCL fires before the quest is removed from the log while QLU fires before UQCL and then again after when the quest is in fact absent. That page seemed to indicate I would get spammed by QLU a lot more than UQCL, but while completing a quest just a few minutes ago (to kill n number of things) it generated pretty much the exact same number of events. It may generate more when you're dealing with the quest giver, but I'm not worried about that.

    The other clever thing he's doing is hooking AbandonQuest to prepare QLU to expect a quest abandonment. AbandonQuest is apparently only fired after the user has committed to the action. I was going to use quest completion mechansim to confirm turn in; he just assumses if he's missing a quest an there was no call to AbandonQuest that it was turned in.

    Thanks for the tip and thanks to Tekkub for the code I'm about to plagiarize :)
    Posted in: Lua Code Discussion
  • 0

    posted a message on how to know a quest is finished
    So I want to look for and track that a specific quest or set of quests have been completed and turned in. QueryQuestsCompleted() / GetQuestsCompleted are problematic with the server cooldown preventing you from calling it too often. Not that you'd probably want to call it too often and deal with that incoming data.

    So, I'd like to avoid calling it unless I'm pretty sure that I'm in a state that warrants using that api to confirm that the quest was finished as opposed to, perhaps, being abandoned. Knowing when I pick up one of the quests or even seeing that its in my logs isn't a problem. UNIT_QUEST_LOG_CHANGED will tell me that a quest is leaving the quest log (so I could then query to figure out if it was abandoned or finished), but its firing the actual removal. So, I can't be sure its one of the quests I'm interested in.

    Is there any good clean way to do this? Maybe I could whisper myself an addon message or something on a LOG_CHANGED event so that I could hopefully react shortly after the has actually been changed. But that seems ugly and means I would have to subscribe to the CHAT_MSG_ADDON event which I'd rather avoid ... I'm assuming registering for that one is a bit of a perf hit.
    Posted in: Lua Code Discussion
  • 0

    posted a message on initializing after cache invalidation, best practices?
    If the cache has been deleted or invalidated then GetCompanionInfo and GetSkillLineInfo will both return nil values for the name. RegisterOptionsTable itself doesn't have anything to with skill names per se, but I populate dropdowns in my options UI with lists of mounts. If I don't have those names, I really don't have anything I can show. I need to know the users riding skill for example to slot the death knight mounts into the correct category.

    You asked "what information is still unavailable by the time you're loaded in enough to type in a chat command"; actually, by that point I think the information is probably available. The problem is, that as an addon, how do you know you're loaded in enough to type in a chat command? That's what I was talking about in terms of not finding a suitable event to listen for. PLAYER_ENTERING_WORLD looked a candidate, but it happens too early.

    Since I expect the info to probably be available when the user types in a chat command, that's what led to my change in approach. I just wait for the user to call us to finish the initialization. So, it was about seeing if I could make changes in a minimal number of places as to catch usage of our addon.

    I thought the function pointers stuff for bindings and the way you can pass a function to RegisterTableOptions could be interesting for other addon writers who, like me, are still crawling up the learning curve. And at the same time maybe see if someone had a better mousetrap.
    Posted in: Lua Code Discussion
  • 0

    posted a message on initializing after cache invalidation, best practices?
    I'm trying to avoid throwing errors whenever the cache gets invalidated which tends to happen after patches. The main problem for me is that during OnEnable various strings are still missing for things like skills and the names of your mounts. So this post is one half explaining how I've tried to work around it and one half looking for good ideas from others. One big caveat is that I don't have any UI besides the options UI. If I did have frames up on screen at load I'd probably have had to do something else.

    So the first thing was that I couldn't find a suitable event to listen for in these cases where we have to try to reinitialize again later. One way might have been to just register a grab bag of common events (combat log, chat messages, etc) and try to reinitialize every time when we get one, unregistering once we finally succeeded.

    I wasn't crazy about that so instead I went with trying to catch the main entry points into my addons and adding init checks there. So, in my chat command handler I'll output an error message to try again later if I still can't initialize and only execute the command if its safe.

    When calling RegisterOptionsTable, instead of passing the table we instead pass a GetOptions function. That function can then do the same kind of init check and in the error case put up a different options ui with the same kind of warning.

    For all the keybindings, I have them go through a wrapper like so:
    <Binding name="FOOACTION">
        Foo:SafeCall(Foo.Action)
    </Binding>
    <Binding name="FOOOTHERACTION">
        Foo:SafeCall(Foo.OtherAction,true,false)
    </Binding>
     
    function Foo:SafeCall(fn, ...)
        if (init_check) then
            return fn(self, ...);
        else
            output error message etc
        end
    end


    Of course, it turns out that one of my friends still got errors because he was using a macro that called the functions directly using /run, but I'm thinking of just punting on that case since I already had a chat command to support what he was trying to do.

    Anyway, I'm interested in how others have tried to work around this problem.
    Posted in: Lua Code Discussion
  • 0

    posted a message on 3.1 breaking my hook of Rep frame
    Thanks! I think I've got it working correctly again now.
    Posted in: Lua Code Discussion
  • 0

    posted a message on 3.1 breaking my hook of Rep frame
    So I have an addon that uses AceHook to hook
    ReputationFrame_OnShow. Since 3.1 its been broken. I've run with all other addons disabled (in case someone else was hooking after me and not passing along the call) and stuck in some self:Prints - its getting init'ed and enabled, but my hook never gets called.

    Any ideas on why this may be or how to go about debugging? How can I verify that my hook call succeeded to hook?

    thanks,
    stencil
    Posted in: Lua Code Discussion
  • 0

    posted a message on Quartz: Modular Casting Bar
    Quartz doesn't have a Target of Target cast bar, right? That might be a nice thing to add to a rewrite.
    Posted in: General AddOns
  • 0

    posted a message on best time to init data - dealing with a cache bug
    Thanks for the tip about COMPANION_UPDATE. I'm checking for the error case now and if we're in it then try again in COMPANION_UPDATE and it seems to be working.
    Posted in: AddOn HELP!
  • 0

    posted a message on best time to init data - dealing with a cache bug
    So I have a problem with my addon whenever I log in after the cache has been deleted; major patches also seem to invalidate the cache such that I hit the same problem. I'm calling the function GetCompanionInfo, but in this scenario, the creatureName is being returned as nil and this messes up my addon. Reloading UI fixes the problem, but that's an annoyance and confusing to users who don't know what's going on.

    I'm doing this initialization during OnEnable and my question is whether there's a better time/place I should be doing this kind of addon initialization.

    Currently, my only other alternative is to try delay init until one of my methods is called. With that approach I'd also have to catch when the options UI is brought up, in case that is done before any methods are called (because those strings are needed to populate some dropdowns). I'm using wowace's options functionality, what can I hook there to tell that the options for my addon are about to be shown?

    thanks,
    stencil
    Posted in: AddOn HELP!
  • 0

    posted a message on Repositories and Tagging.
    So, one of my projects isn't getting pushed to curse. I tagged it Release and the packager created a release version (http://www.wowace.com/projects/pokedex/files/), but there's nothing on curse.

    The release version of my other project (http://www.wowace.com/projects/repheaderremember/), however, did end up on Curse.

    So, I'm kind of confused because as far as I know I'm tagging correctly, and did the same thing with both projects, and yet only one is getting pushed out.

    thanks,
    stencil
    Posted in: General Chat
  • 0

    posted a message on Repositories and Tagging.
    I'm still new to all this and I'd like to get more information about how the Tag repository action interacts with existing files and new checkins.

    I've been checking in updates and when I do they've been getting packaged up as alpha versions. That's cool, but now I'm ready to push out some beta and release versions. So how do I make my next checkin a Release version rather than an Alpha?

    I've found the Tag Repository action but I'm not sure of when to use it. I've noticed that after setting a tag, if I select Tag again the edit field does not contain what I previously entered. So ... I'm going to assume then that when you Tag the repository it acts against the most recent set of files as a kind of one shot deal.

    Which I guess means, the answer to my question is that I *don't* tag a *checkin* as Release. I simply checkin, the files get added to the repository (meaning a package tagged Alpha will be created) and then anytime before the next checkin if I Tag the repository as Release it will just create another package tagged Release and push that to curse.

    Is that right?

    thanks,
    stencil
    Posted in: General Chat
  • 0

    posted a message on detecting that Reputation Pane is open
    Some of my friends find it annoying to continually have to collapse the faction headers for Classic and The Burning Crusade in the reputation pane. Anytime you log in or reloadui blizz expands all the headers but Inactive.

    CollapseFactionHeader lets me do what I want, but the problem I'm having is the when. If I do it when the addon is loaded, blizz later undos my work. I tried to find an event I could watch to know when the character information panel or reputation pane was being opened but nothing jumped out at me as being the one I want.

    Any suggestions for what I could look for or hook into to use as a trigger?

    thanks,
    stencil
    Posted in: AddOn HELP!
  • 0

    posted a message on WelcomeHome - Your first Ace3 Addon
    There's an error in the tutorial. So in the step by step stuff where ui is moved into blizzs options windows, the line is: self.optionsFrame = LibStub("AceConfig-3.0"):AddToBlizOptions("WelcomeHome", "WelcomeHome").

    In the complete finished version of the file its: self.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("WelcomeHome", "WelcomeHome")
    Posted in: Ace3
  • 0

    posted a message on Recount
    Quote from Elsia »
    But to go back to why totems are currently a problem. Say you have 2 shamans in raid and both drop searing. While the totems say "<shaman 1's creation>" and "<shaman 2's creation>" this information is not passed along in the combat log. The combat log only sends:

    Searing totem hits X for 200 damage.

    Which one was it?

    Well there really isn't any way to find out. Hence why no damage meter can currently attribute this damage to owner.
    I'm one of those Shammies who would love to see totem damage rolled up into mine. One thing I noticed was that Scrolling Combat Text gleefully scrolls my totem damage up on the screen. After reading this comment, I grabbed another shaman (who had way more spell damage than me and so would have noticably different searing totem damage) and we conducted a little test. We partied up, dropped our searing totems, and frostshocked a mob (to keep it off the totems).

    What we found was that we each only saw our own totems damage in our combat log. So the answer to the question above, "Which one was it?", is yours and yours only.

    Sitting here now, I'd be interested to see if a non-shaman would have seen either of our totem damages reported ... I didn't think about that. BUT - it seems like you could simply allow collection of totem damage to only happen for users who are shamans and then they could sync that out to everyone. After all, its the shammies who care about it the most. Its really less about searing totem and more about shammies wanting to know how much their AoE totems are contributing.

    PS - thank you *so* much for starting development back up again on recount :)
    Posted in: General AddOns
  • To post a comment, please or register a new account.