Go to Page... |
|
Thread Tools | Display Modes |
|
07-02-12, 03:04 PM | #1 |
Updating TXP for MoP Beta
I just finally got a chance to login and start working on my experience bar addon today and after fighting with getting DC'd at 90% loaded for a few hours I got this error:
Code:
Message: Interface\AddOns\TXP\TXP.lua:58: Division by zero Time: 07/02/12 16:28:24 Count: 1 Stack: Interface\AddOns\TXP\TXP.lua:58: in function <Interface\AddOns\TXP\TXP.lua:55> Locals: self = TribalExperienceBar { 0 = <userdata> } event = "VARIABLES_LOADED" curxp = 0 levelmax = 0 (*temporary) = <function> defined =[C]:-1 (*temporary) = "%.1f%%" (*temporary) = nil (*temporary) = nil (*temporary) = nil (*temporary) = nil (*temporary) = nil (*temporary) = "Division by zero" TXPBarText = TXPBarText { 0 = <userdata> } TribalExperienceBar = TribalExperienceBar { 0 = <userdata> } This is the relavant section of code: LUA Code:
And here is the entire code: LUA Code:
Any help would be awesom! Thanks guys! Edit: Just realized I threw this in the wrong section... one of you wonderful admins want to stuff this in the corner where it belongs please. Last edited by Othgar : 07-02-12 at 03:07 PM. Reason: Wrong section... derp.. |
|
07-02-12, 03:24 PM | #2 |
VARIABLES_LOADED is a useless event, and is causing this problem. It fires many times during the loading process to indicate that various Blizzard or game settings are loading, and has nothing to do with addons. At that time, information about your character's experience is not yet available. Just remove that event entirely. You don't need it. You're already catching the "I'm logged in, info is now available" event with PLAYER_LOGIN, PLAYER_ENTERING_WORLD, and PLAYER_XP_UPDATE.
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. Last edited by Phanx : 07-02-12 at 03:27 PM. |
|
07-02-12, 04:16 PM | #3 |
Phanx... I love you! Thanks so much, it's working perfectly in the beta for now. A little more testing and I'll upload it to the beta section.
|
|
07-03-12, 07:27 AM | #4 |
Last night while messing around in Beta, I decided I wanted to add some additional texture options to my xp bar. I found the ones I wanted, sized them made them work and made them user selected via slash command. Now I'm stuck on how to get them to save per character. I tried it the same way that I did it for locked/unlocked visable/hidden and couldn't get it to work. I'm guessing it's because I'm not defining the variable correctly, but for the life of me I can't figure out a way to define the variable and save it. Hopefully one of you guys will see something that I don't.
Here's my code: LUA Code:
Here's my TOC: LUA Code:
and attached is the full addon just in case. |
|
07-03-12, 03:38 PM | #5 |
You need to do a check like this:
lua Code:
This uses the pre-existing SVs or creates an empty table if there are none. You can also improve your slashcmdhandler like this: lua Code:
This works by doing a simple table lookup and quickly coming back with a result or nil, instead of testing each check in an if-else chain.
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes". Author of NPCScan and many other AddOns. |
|
07-03-12, 05:06 PM | #6 |
Thanks Torhal. So more or less then I need to define the saved variable like this
Code:
TXPTexture = TXPTexture or {} Code:
TXPTexture = TribalExperienceBar:SetStatusBarTexture("..") |
|
WoWInterface » Site Forums » Archived Beta Forums » MoP Beta archived threads » Updating TXP for MoP Beta |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Switch to Linear Mode |
Hybrid Mode |
Switch to Threaded Mode |
|
|