Line Numbers of Errors

Posted by Artel on Sat 13 Jan 2007 05:28 AM — 2 posts, 13,232 views.

USA #0
I just finished converting my first plugin from VBscript to Lua, and of course, there are a few errors. The problem is, the line numbers that it gives me do not seem to correspond to anything (blank lines, etc). I've looked in both the plugin file (.xml) and the script file (.lua) and the line numbers don't even point to the function it gives me. I was always able to find the line easily in VBscript in the plugin file. Does anybody know how the line numbers can be interpreted?

Here's the error message, although it probably doesn't matter:
Error number: 0
Event:        Run-time error
Description:  [string "Plugin"]:307: attempt to concatenate a nil value
stack traceback:
	[string "Plugin"]:307: in function `displayQuest'
	[string "Plugin"]:241: in function `questMccp'
Called by:    Function/Sub: questMccp called by trigger
Reason: processing trigger "QuestMCCP"
Australia Forum Administrator #1
The script section is only part of a plugin, so you have to add in the number of lines between the start of the plugin and the start of the script section.

Also, if you have included the Lua constants (there will be an "include" tag) then you also need to subtract out the number of lines in that file. You probably don't need the Lua constants file, so you could just omit it.

The resulting number should be the line number in the plugin where the error occurs.