[SOLVED] Is it possible to have traceback.txt to be saved/opened as traceback.rpy instead?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
Chekhov
Regular
Posts: 113
Joined: Tue Jun 26, 2018 9:19 am
Projects: Pluton
Contact:

[SOLVED] Is it possible to have traceback.txt to be saved/opened as traceback.rpy instead?

#1 Post by Chekhov »

Under prefferences of course one can decide which text editor to use. I use sublime text.

However, I also just use notepad for .txt files (I know I know, bad program, old habits).

So when I have an error, traceback.txt is either opened in a another editor, not opened automatically at all, or opened in notepad. Because contrary to ren'py launcher's claim, the program opened is not the system program for ren'py files, but the system program for the relevant file opened (in case of traceback, .txt)

Any way to change this or otherwise resolve it? Can I change traceback to be saved as .rpy? Any way to resolve this would be appreciated.

Image
Last edited by Chekhov on Fri Apr 09, 2021 9:11 pm, edited 1 time in total.

uncoded
Regular
Posts: 27
Joined: Fri Apr 09, 2021 10:29 am
Contact:

Re: Is it possible to have traceback.txt to be saved/opened as traceback.rpy instead?

#2 Post by uncoded »

With renpy-7.4.4-sdk, I seems to happen line 215 of renpy/error.py.
Maybe you just have to edit this line in your local installation of renpy with something like:

Code: Select all

f, traceback_fn = open_error_file("traceback.rpy", "w")
Might have undesired side effects, tho.

Or else, associate Sublime Text with .txt files in your OS ... If you don't like notepad already, this shouldn't be a huge loss :wink:
🐾

User avatar
Chekhov
Regular
Posts: 113
Joined: Tue Jun 26, 2018 9:19 am
Projects: Pluton
Contact:

Re: Is it possible to have traceback.txt to be saved/opened as traceback.rpy instead?

#3 Post by Chekhov »

If you don't like notepad already, this shouldn't be a huge loss
It's more of a guilty pleasure and refusal to budge on that front, lol. Like I know I shouldn't use it, shouldn't like it.... but I do.

-----

As for your solution, in the first test it worked like it should. We'll see about possible side effects in the future, but I'm sure it will be fine :D

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: [SOLVED] Is it possible to have traceback.txt to be saved/opened as traceback.rpy instead?

#4 Post by Imperf3kt »

Tracebacks open in Atom for me (I hate Atom and will be finding a different editor eventually)

Maybe you have specifically told your Operating System to associate .txt files with Notepad, which will forcibly open them in Notepad only?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

uncoded
Regular
Posts: 27
Joined: Fri Apr 09, 2021 10:29 am
Contact:

Re: Is it possible to have traceback.txt to be saved/opened as traceback.rpy instead?

#5 Post by uncoded »

Software developpers can be principled individuals, so your guilty adhesion to Notepad is perfectly normal lol :wink:
Chekhov wrote: Fri Apr 09, 2021 9:11 pmAs for your solution, in the first test it worked like it should. We'll see about possible side effects in the future, but I'm sure it will be fine :D
Glad to hear that.
Remember you may lose this modification next time you'll update Ren'Py SDK.

Maybe take notes where and why you did it now (while you remember it), or create a patch you'd apply after each SDK update ...
As you're on windows, patch utility is out, but if you use git for updates, this could be done with git patch.
🐾

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2402
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: [SOLVED] Is it possible to have traceback.txt to be saved/opened as traceback.rpy instead?

#6 Post by Ocelot »

RenPy saves traceback files as .txt, because they are text files. It doesn't save them as .rpy, because they are not .rpy files: they do not contain renpy code.
To save traceback files as .rpy makes as much sense as saving them as .wav or .mp4: you can do that, but you shouldn't. I do not remember, where RenPy saves traceback by default, but if it is something within game directory RenPy might try to load it and crash.

If you are still refusing to change default program for .txt files, you can save tracebacks as .log files instead and change default program for those. That would be optimal solution in this case.
< < insert Rick Cook quote here > >

User avatar
Chekhov
Regular
Posts: 113
Joined: Tue Jun 26, 2018 9:19 am
Projects: Pluton
Contact:

Re: Is it possible to have traceback.txt to be saved/opened as traceback.rpy instead?

#7 Post by Chekhov »

uncoded wrote: Sat Apr 10, 2021 3:43 am Software developpers can be principled individuals, so your guilty adhesion to Notepad is perfectly normal lol :wink:
That's nice of you to say, but I consider it completely unwise and emotional instead, lol.
Glad to hear that.
Remember you may lose this modification next time you'll update Ren'Py SDK.

Maybe take notes where and why you did it now (while you remember it), or create a patch you'd apply after each SDK update ...
As you're on windows, patch utility is out, but if you use git for updates, this could be done with git patch.
This is a really great suggestion, thanks.
Ocelot wrote: Sat Apr 10, 2021 3:47 am RenPy saves traceback files as .txt, because they are text files. It doesn't save them as .rpy, because they are not .rpy files: they do not contain renpy code.
To save traceback files as .rpy makes as much sense as saving them as .wav or .mp4: you can do that, but you shouldn't. I do not remember, where RenPy saves traceback by default, but if it is something within game directory RenPy might try to load it and crash.

If you are still refusing to change default program for .txt files, you can save tracebacks as .log files instead and change default program for those. That would be optimal solution in this case.
This is so much cleaner, thanks, great suggestion.
Imperf3kt wrote: Fri Apr 09, 2021 10:22 pm Tracebacks open in Atom for me (I hate Atom and will be finding a different editor eventually)
Good luck going for a new editor!



Very helpful guys! I hope I can help people like this in the future.

Post Reply

Who is online

Users browsing this forum: Google [Bot], LegsWild