Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[Resolved] Finding the used "p/print" command buried in tons of scripts

Good day everybody!

There is an annoying p/print command that is being executed whenever I change maps in my project, which always prints 0, 5, 0, so I know its probably in something like Game_Map #setup, but... I've got that method aliased in quite a few scripts, so its kinda hard to find (and its probably even used somewhere else, I don't know).

I want to alias the print command, where it'll print whatever it prints, but also I want it to show the Script name (or index # in the editor) and the Line # of that script which the command is being used, or possibly even the method using the command, just so I can find it and delete it.

Can anybody help me?

I found a workaround to this... I just simply redefined method in Kernel, and purposely made it throw an argument error which brought me to the line I was looking for.

Code:
module Kernel
  def p #<--Doesn't have an argument now :)
    #...Nothing really needs to be defined
  end
end
 
Sometimes you've gotta make errors to find errors (especially when you've got entire SDK broken down in your project, MACL split up, and then nearly 70 or 80 scripts of your own, that would return thousands, maybe hundreds of thousands of results for "p "). By temporarily redefining Kernel's 'p' command with NO args, I had created an error to find my problem, line 356 in Interpreter 5, I was apparently using 'p' to print the power, speed and duration of weather settings! Silly me. (Never thought ArgumentErrors would be something good, huh? Ha!)

BTW this topic is closed everybody :P
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top