Thread Tools Display Modes
05-30-23, 01:43 AM   #1
mataal
A Murloc Raider
Join Date: Apr 2020
Posts: 8
Question Debugging possibilities?

Hey all, I'm getting error in BugSack (attached) but the addon I'm making doesn't do anything related with Unit or Player frames, kinda lost on how to debug this, are there any others ways of debugging in WoW?
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2023-05-30 at 08.26.38.png
Views:	40
Size:	130.7 KB
ID:	9821  
  Reply With Quote
05-30-23, 05:11 AM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
Are there any other addons you have that might ?

Depending on how many addons you have active you could either load them one at a time to see if the error triggers to identify which addons might be the cause or you could do it in blocks until you narrow it down to a few and then repeat using the one at a time pattern.

Then its the case of testing that potential faulty addon to see if it repeatedly makes the addon happen when it is the only addon loaded, but not with no addons loaded. You can then pass the information on to the developer of the addon for them to look into.

However, unless an addon has literally recreated a PlayerName object it shouldn't have broken Blizzards one.
Lua Code:
  1. function PlayerFrame_UpdatePlayerNameTextAnchor()
  2.     if PlayerFrame.unit == "vehicle" then
  3.         PlayerName:SetPoint("TOPLEFT", 96, -27);
  4.     else
  5.         PlayerName:SetPoint("TOPLEFT", 88, -27);  <<<<< Error Reported on this line on Retail 10.1
  6.     end
  7. end
__________________


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

Last edited by Xrystal : 05-30-23 at 05:15 AM.
  Reply With Quote
05-30-23, 07:10 AM   #3
mataal
A Murloc Raider
Join Date: Apr 2020
Posts: 8
Sort it out.

So, basically in the beginning of my addon I had:

PlayerName = UnitName("PLAYER"):lower()

Renamed the variable name and error stopped, so I guess that PlayerName is a Blizzard global variable or something

PS: Thanks for the reply

Last edited by mataal : 05-30-23 at 07:12 AM.
  Reply With Quote
05-30-23, 07:19 AM   #4
Vampyr78
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: May 2016
Posts: 10
There are 2 ways to avoid this kind of problems in the future.
  1. Use a prefix containing either your addon's name or an abbriviation of addon's name for every variable and function you create.
  2. Create an object with your addon's name that and declare all the variables and functions as members of that object.

Both appraoaches allow you to minimize risk given variable exists somewhere else.
  Reply With Quote
05-30-23, 07:54 AM   #5
mataal
A Murloc Raider
Join Date: Apr 2020
Posts: 8
Originally Posted by Vampyr78 View Post
There are 2 ways to avoid this kind of problems in the future.
  1. Use a prefix containing either your addon's name or an abbriviation of addon's name for every variable and function you create.
  2. Create an object with your addon's name that and declare all the variables and functions as members of that object.

Both appraoaches allow you to minimize risk given variable exists somewhere else.
Yeah, I've added a prefix and worked
  Reply With Quote
05-30-23, 07:55 AM   #6
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
To follow on from Vampyr's comment.

If you place something like ..

local addonName, addonData = ...

at the top of each lua file you will have access to data you assign to the data table in all the files you have that in. Handy if you want your files separate but able to access the same set of data.
__________________


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

WoWInterface » Developer Discussions » Lua/XML Help » Debugging possibilities?


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