[RGSS3] DEBUGGING HELP

Posts

Pages: 1
Red_Nova
Sir Redd of Novus: He who made Prayer of the Faithless that one time, and that was pretty dang rad! :D
9192
So I found a nifty little Ruby method to print a trace from the code's current location:

puts caller.join("\n")


I'm using this to debug my code, but I need a little help converting one piece of information to something readable. I put the caller method in my code and get this:

{0166}:6390:in `refresh'

{0067}:57:in `set_temp_actor'
{0069}:112:in `update_help'
{0054}:391:in `call_update_help'
{0054}:96:in `active='
{0053}:137:in `activate'
{0166}:6582:in `init_commands'
{0166}:6558:in `start'
{0100}:12:in `main'
{0006}:23:in `run'
{0275}:10:in `block in <main>'
:1:in `block in rgss_main'
:1:in `loop'
:1:in `rgss_main'
{0275}:8:in `<main>'
ruby:in `eval'



From the first line of the above block: "{0166}" is the name of the script containing the trace call (in this case, Yanfly's Equip Engine), and 6390 I believe refers to a line number, but I'm not sure exactly, as Yanfly's Equip Engine is certainly not even close to 6000+ lines. I need to somehow convert these lines to something readable, but I don't know what method to use.

I need to figure out how to translate {0166}:6330 into the exact script name and line number during output. Doing this will help me read which methods from which scripts are being called. Any help on this would be greatly appreciated!
Marrend
Guardian of the Description Thread
21781
I got this to display/output with "msgbox", rather than "puts". If that's any indication of anything.

Other than that, no, I have no clue what's going on. I think you're right that the second number is supposed to be a line number, but, how it's coming up with that result is all kinds of ????? to me.
Red_Nova
Sir Redd of Novus: He who made Prayer of the Faithless that one time, and that was pretty dang rad! :D
9192
"msgbox" just displays the message in a popup window. "puts" prints the message in the console log, which is more convenient for me. It's got nothing to do with the message itself, just how it's displayed.

There's a regex manipulation procedure I'm missing. I need to use the gsub method, but the exact syntax of the search and replace parameters are a mystery to me.
Marrend
Guardian of the Description Thread
21781
The random thought that has occurred to me that it's reporting an error number (Referencing the "Errno" built-in module? The "Exception" built-in class? Not really sure!), rather than a line-number?
Red_Nova
Sir Redd of Novus: He who made Prayer of the Faithless that one time, and that was pretty dang rad! :D
9192
The caller function returns the current execution stack, so I'm not sure if it has anything to do with error reporting. Granted, that explanation is still better than my current one, which is "I dunno."

The format of each line is almost exactly the same as an error report bar an error message, which is why I was leaning towards the line number.
This is a total shot in the dark, because I don't know how Ruby works, nor do I know how the Yanfly engine is coded, but my guess is that the Yanfly engine does some sort of "require" or "import" or "include" or whatever that causes the ruby interpreter to view the file and all included classes as one big script with 6k+ LOC.
Pages: 1