Reply
Thread Tools Display Modes
Unread 10-23-05, 11:12 PM   #1
WinHack
A Deviate Faerie Dragon
Join Date: Oct 2005
Posts: 11
Help with debugging(?)

So I am off and writing my mod, and I am coming upon a difficulty. Every so often, I get an error of some kind (from WoW) in my localization.lua file. When I get an error in my mod's .LUA file, I get a message box with an ok button and some text telling me which line was the offender, etc. Usually, I can figure out what I did.

However, when there is an error in my localization.lua file (in the same directory as my mod files), I get the same message box, but the text does not wrap, so I see "Interface\AddOns\modname\localization.l..." and that's it. No text wrap, so I cannot see the offending line.

This would be easier if there were a pre-compiler I could use, but from what I've read, it seems that most of the IDEs are in alpha/beta/not really fully working yet. I am using B:Lua because it closely mirrors the MS VS.NET environment (different files open on different tabs, etc.), though I've downloaded SciTe LUA as well.

So I guess the smaller question is: how do I find out what is wrong with my localization.lua file from within WoW, and the bigger question is: Is there a better environment than what I am working with that could detect these errors earlier?

Any help is appreciated.
__________________
In theory, practice and theory are the same thing. In practice, they are not.
WinHack is offline   Reply With Quote
Unread 10-24-05, 01:32 AM   #2
Gorak
A Fallenroot Satyr
Join Date: Oct 2005
Posts: 21
SciTE has an in-built LUA interpreter that can detect outright syntax errors in the code. However, it cannot detect problems with indexing tables, or others which only happen in run-time behaviour (loading in-game variables or using API functions incorrectly)

However, to redeem the issue with the error text not wrapping, here is a small script command that can be executed inside World of Warcraft by typing it to the edit box's prompt. To open the prompt, press Enter inside the game, just like you were chatting with someone.

/script DEFAULT_CHAT_FRAME:AddMessage( tostring(ScriptErrors_Message:GetText()) );

What this script does is it reads the currently open error message (the dialog box with no text wrapping) and pastes it it's whole contents to your chat frame. You can then read the whole error message and act upon it accordingly.

EDIT: You can paint the script text with mouse, then use copy-paste to move the script as is into the edit box. Yes, copy & paste DO work inside World of Warcraft. Make use of this feature.
Gorak is offline   Reply With Quote
Unread 10-24-05, 09:39 AM   #3
WinHack
A Deviate Faerie Dragon
Join Date: Oct 2005
Posts: 11
Thank you very much. Out of curiosity, do you (or anyone for that matter) have any idea why this functionality is somewhat brain-damaged within the WoW client to begin with?

And yes: after running the SciTe compiler and executor (thank you for that tip again), I did in fact find my errors. Two devious little concatenates that I totally missed when moving them from the mod code proper to the localization file.
__________________
In theory, practice and theory are the same thing. In practice, they are not.
WinHack is offline   Reply With Quote
Unread 10-25-05, 10:47 PM   #4
Gorak
A Fallenroot Satyr
Join Date: Oct 2005
Posts: 21
The error text not wrapping is a bug.

It'll be fixed for client version 1.8.1., which is already live in US, and should be live in here after this week's maintenance as well.
Gorak is offline   Reply With Quote
Unread 10-26-05, 09:56 AM   #5
WinHack
A Deviate Faerie Dragon
Join Date: Oct 2005
Posts: 11
Saw this in the patch notes last night. Thank you for your responses, Gorak.
__________________
In theory, practice and theory are the same thing. In practice, they are not.
WinHack is offline   Reply With Quote
Unread 10-27-05, 12:34 AM   #6
Elkano
A Flamescale Wyrmkin
 
Elkano's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 119
You may also use ImprovedErrorFrame (-> http://www.curse-gaming.com/mod.php?addid=170 ). It catches the error message into its own window from which you can also c&p. But check the comments for some 1.8 related fixes.
Elkano is offline   Reply With Quote
Reply

Go BackWoWInterface » Developer Discussions » Lua/XML Help » Help with debugging(?)

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