damage meter issue related to Pet OwnerName and OwnerID
Hi Everyone !
I'm working on porting an old addon back from Cata. so far everything works fine except (it seems) Pet. (it's a kind of DPS meter) The way used in there to get the ownername,ownerID and petID is a bit scriptic for me (i'm not a huge LUA expert, i'm just digging info and fixing with the resources i find) Basically the issue is that (it seems) each time a hunter uses stampede, or any other classes that seem to have some weird pets, the addon floods me with errors : Code:
Code:
Many thanks for your time and help! BuG |
The problem is likely caused by the order of the arguments for COMBAT_LOG_EVENT_UNFILTERED being changed.
The error is from the variable 'flag' being a string instead of a number, which probably means it's holding the unit's name or something instead of its flags. Can you show us what the variables are being assigned to for the COMBAT_LOG_EVENT_UNFILTERED event? Although the fact that you say everything else is working fine would seem to indicate that it's something else.. |
Hi and thank you for your answer.
sorry for such a nebbish question but, what/where exactly should i find what you would like to see ? i do register the combat log unfiltered in the add-on, but i'm not familiar with such thing. is that printed somewhere in the cache/variables ? i tried a suggestion from someone to print what it is showing : Code:
local function _RelevantMember(flag) Although, here is a more complete error that happens (just realized the original one was missing a few lines) Code:
Edit 2 : the easiest way i found to reproduce it is have a lock with me and wait for him to have a "proc Imp" this brings the error right away and will keep spamming it every few seconds. Now i'm "convinced" more and more that it has to do with Guardians and not pet (since pet seem to be coded "okish") as guardians do not have names or id or something the add-on just get lost |
Okay, even though that function is where the error is being thrown, it isn't the source of the problem.
The problem is being caused by the fact that the function is being fed a string instead of the flags it's expecting. The stack trace shows you the line numbers of the function calls leading up to the error. Even though line 411 is the one that it's actually failing on, that function is being called from another line (2776 in your last post). The function _RelevantMember is being called with something other than the flags. You need to identify what it's being called with. Find where _RelevantMember is being called, look at what the variable it's being called with is named, then go back through the script until you find where that variable is assigned. That is the source of the problem. If you can't do that, post the entire script somewhere. |
Hi Semiar,
this is very useful and your help is very appreciated. RelevantMember is called (as you said) further down the script in the following function : Code:
local function _LogParser(timeStamp, subEvent, hideCaster, sourceGUID, sourceName, sourceFlag, sourceRaidFlag, targetGUID, targetName, targetFlag, targetRaidFlag, …) as soon as a Lock gets his Imp procs the error pops. for example the part around line 2776 : Code:
if _RelevantMember(sourceFlag) then |
Quote:
The error isn't being caused by an incorrect value for flag, it's being caused by this little line inside of _RelevantPet.. Lua Code:
edit: It's expecting guid to be a number, not a string. I don't know if this was changed at some point, but it's certainly not a number today. Try changing it to or tonumber(strsub(guid or '00000', 5, 5) or 0, 16) % 8 == 4 which is basically pulling the fifth character out of the guid (which identifies the unit type) and checks if it's 4 (which identifies it as a pet). |
I was actually wondering exactly what is this part of code doing exactly, i could find the correspondences of all the HEX part on the web like
http://wowdiff.googlecode.com/svn-hi.../Constants.lua but the last bit you mentioned, i couldn't find it anywhere… do you know what this is doing ? i'm gonna try first to see what happens when i set it to FLAG instead of GUID and see if anything happens.. |
Check my edit, I realized what it's supposed to be doing after I wrote it.
|
yep just checked it and understand.. however that code you gave gives an error :
Code:
Core.lua:429: attempt to call global "strsub" (a nil value) it doesn't seem to like that |
strsub is a valid function implemented in the client. It shouldn't be throwing an error in-game. It's not a native lua function so it might cause problems if you're trying to run it outside of the game.
Just change it to string.sub. |
yeah, i have that strsub in other add ons just ok..and i use that in game.. no idea but str.sub works ok.. i'm gonna try and see what happens… thanks so much for your help so far !
Edit : doh ! almost.. (error popped up when hunter used stampede) Code:
Code:
if not arg9 then |
You need to add something like if not guid or guid == '' then return end to the top of the _RelevantPet function to just exit if there's no guid.
The error is being caused by the guid being an empty string which is one of the only things I didn't make an exception for in my example. Actually, hang on I'll write something better because that will make it lose some of its functionality. |
Quote:
wouldn't setting something like NONE (as the example above) shown would work better ? |
Try changing the if statement to this..
Lua Code:
A unit can not have a name, but it should never be missing a GUID. If the GUID field is missing, there's no way to track the unit. In other words even if there were a unit without a GUID, it wouldn't be possible to identify who it belonged to. I know for a fact stampeded pets all have GUIDs and even guardians summoned by trinkets such as voodoo gnomes do as well. |
Quote:
so far, with your latest tweak, it seem to be fully working, and dos tracked by hunter + lock is accurate (compared to skada/recount) i'll give it further try, but thank you so much for your work and your help, i would have never figured that out! |
i'll continue testing but so far that issue seem to be solved! thanks again!
|
Hi Semlar.
So far so good, the add-on works errorless.. however it is not recording all pet/guardians damage all the time. it will randomly record or not. resulting in totally off values. i wonder if you might have an idea ? thanks cheers BuG |
Is there anything that the missing pets have in common?
|
i'm investigating deeper, been doing billions of dog and lfr etc. running both recount/skada + the add-on all in parallel. damages are spot on up to the last digit.
i think the issue is coming from the default updating time of 5sec for the data. using 1sec (which is what recount/skada are using) makes it work fine. i guess the delay is way too big for the amount of data and creates gab + sometimes will just lose some stuff if you are not actively fighting and just let a pet do things. (i.e. : cast a dot on dummy and nothing else, it won't show anything in the add-on since you get out of combat before the 5sec starts) Either the way it was "storing" the data before needs some update or there is maybe a way to make it "buffer" somehow but well that's way out of my knowledge...if 1sec isn't make memory usage + cpu go nuts, i guess it should be fine. feel free if you have an idea tho ^^ thanks for following up with me, very appreciated! i'll keep you up to date. |
If the caster is not in combat, it stops recording. for example, i died on on Sha and it will stop recording anything.
couldn't figure where this is. |
All times are GMT -6. The time now is 04:17 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI