get_filename_line request for help

petertavy

Member
Aug 21, 2020
106
21
86
Please how can one use this command? I typed it in the console & got:

<function get_filename_line at [hex no] >

& when I typed this with brackets I got:

('renpy/common\00console.rpy', 1125)

& what I want to know is the line in the program where I opened the console.
please advise, thank you.
 

Mattock

Member
May 27, 2018
125
111
73
hello,
not too much info.(and please use code-tags)
I just looked at "debugexports.py" and I suppose if you type
Code:
get_filename_line()
it returns e.g. ('renpy/common\00console.rpy', 1125)
because you're in the console(on line 1125 there)...
not sure if this is easily doable in the console...but what do you get by
Code:
repr( renpy.game.context().current )
if that is not also console.rpy there may be a way.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
12,760
20,982
1,026
& when I typed this with brackets I got:

('renpy/common\00console.rpy', 1125)
What is normal, since it's where Ren'Py currently is.


repr( renpy.game.context().current )[/code]if that is not also console.rpy there may be a way.
It will still be the console.


The only way to have the information he want (where and in what file the script currently is) is to use renpy.get_filename_line from the game script itself. And it happen that someone made a tool for this.

This being said, there were some changes in Ren'Py, and now when used on a translated say line, renpy.get_filename_line Ren'Py will point to the translation file. There's probably a fix for this, but I haven't really looked for it yet.
 
  • Sad
Reactions: Mattock

Mattock

Member
May 27, 2018
125
111
73
Thanx! I knew I read about a tool some ages ago! (my bad for not looking it up)
I just also checked and yes it's still the console.

My (not so good) proposion would have been to use RenPy interactive director(developer mode);
but I think you need the .rpy in the game dir, not only the .rpyc
(I just got some nasty exceptions while trying)

-> use the tool from anne O'nymous !