- Jul 3, 2021
- 4,416
- 21,834
There's another file I recently added to my "Night Hacker" "mod" I use. I don't need to add the file as it is quite small (I will update my zip in a moment). But, just create a file named... well... anything you wish, I call it "developer.rpy" and add the following code to it... this is VERY USEFUL for finding the exact line an error occurs on and the file it is in (I have used this to find the error in a file and fix it myself)...
...it is a little more involved to use it, I do it this way to avoid having to touch any game coded and keep this independant of that. You copy and past the line "show screen bugTesting_Overlay" then enter console mode and paste it. You will then see green debugging text on screen in the upper left corner telling you the file name and line number it is currently executing.
Edit: added this to my zip.
Python:
# Show filename and line number of current code being executed
# in upper left corner.
screen bugTesting_Overlay():
$ fileLine = renpy.get_filename_line()
text "[fileLine[0]]:[fileLine[1]]" xpos 10 color "#0f0"
# Press SHIFT+O to enter console mode and copy and paste this: show screen bugTesting_Overlay
Edit: added this to my zip.