A better Game_Interpreter Line 1411 error backtracer

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
4,704
Reaction score
5,376
First Language
Indonesian
Primarily Uses
RMVXA
Screenshot_1248.jpg
Problem:

Game_Interpreter Line 1411 is usually a bane or our existence. It's an error that points out to Game_Interpreter line 1411, which it's on its own has nothing to do with the error. it just a line that handles the script call, and even the full backtracer usually don't print the full stack error for script call.

Solution:

I made a shared method that works as a method on its own, not script call. So the error tracing works properly. Performance-wise, it MIGHT hit a little more to the script call. So, it might best to only use this for debugging. This is the only code you need and it does not automatically solve your problem. It just to for better tracking.
Code:
class Game_Interpreter
 
  def command_355
    script = @list[@index].parameters[0] + "\n"
    while next_event_code == 655
      @index += 1
      script += @list[@index].parameters[0] + "\n"
    end
    name = "command_ex"
    eval("create_method(:#{name}) {#{script}}")
    method(name).call
  end
 
  def create_method(name, &block)
    self.class.send(:define_method, name, &block)
  end
 
end
How did I test this?

I made two slots of script
Screenshot_1250.jpg
- Game_Interpreter: is my snippet above
- Faulty: where the error happens. it basically just
Screenshot_1251.jpg
And the last, I test it with a simple script call
Screenshot_1254.jpg

Without my script, it goes like this
Screenshot_1252.jpg
With my script, it goes like this
Screenshot_1253.jpg

Terms of Service:
Why would you even bother to put ToS for debugging tools? Do whatever you want.
Yes, it means free for everything.
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Broke: Dont move. -boring. -passive. -uncreative. Woke: Bewegen Sie Nicht! +authoritative. +foreign. +reminds your son that he's a garden gnome now.
My girlfriend left a note on the fridge saying 'This isn't working, goodbye.' I opened the refrigerator and it works just fine. Weird.
BCj
Could someone translate something from Japanese to English for me?

Forum statistics

Threads
94,386
Messages
920,548
Members
124,165
Latest member
Zflooder
Top