Ren'Py Script/code to output labels/scenes onto a textfile?

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,369
15,285
Oh trust me, what probably took you 5 minutes to think about and type...
The day after Christmas, while taking a break in the middle of a day past writing a test suit for my Ren'Py tools ? It clearly took me more than 5 minutes.


took me about 40 minutes of double checking, thinking and correcting.
But you also wrote a more detailed answer, and took care of the purely internal variables used by Ren'Py, removing them from the result. It obviously need more time and more checking.
 

FaceCrap

Active Member
Oct 1, 2020
885
619
Therefore, it's probably better to use some tool for this ; i think that one was named on this thread :D
If you're referring to EVV ;) I already found that one, but held off because of the version limitation...
However, visiting this thread did make me realize one thing.

For a while now I've been using a dirtyConsole.rpy that had a command defined to list variables changed since the start of the game...
It's only after visiting this thread I became aware this being from your hand. Thank you for that as it was the reason why I wanted to expand it a bit...

and thank you 79flavors for the explanation and the addition to clean out "_" variables (which I already seen appear before)
 
Last edited:

Lou111

Active Member
Jun 2, 2018
538
680
If you're referring to EVV ;) I already found that one, but held of because of the version limitation...
However, visiting this thread did make me realize one thing.

For a while now I've been using a dirtyConsole.rpy that had a command defined to list variables changed since the start of the game...
It's only after visiting this thread I became aware this being from your hand. Thank you for that as it was the reason why I wanted to expand it a bit...

and thank you 79flavors for the explanation and the addition to clean out "_" variables (which I already seen appear before)
What!? Where do I find stuff like dis???
Anne holding out on us?

Edit:
FFS, it's right in her (his) signature. I've read this one when I first started out. Time to recap...
Edit2:
Is actually NOT compatible with version 7.4.x and further
 
Last edited:

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,369
15,285
Anne holding out on us?
If you knew :D


Edit2:
Is actually NOT compatible with version 7.4.x and further
Yeah, but I'm working on this. I'm near to have finish the rewriting of the utilities I need for my mods/tools, and half way for the rewriting of the in-game configuration interface. As for the tool itself I don't know. Since I'll need to do tests with real games, it's from "Oops I need to rewrite everything" to "finished".


The test suit I talked about above is precisely for the utilities ; what is half stupid since the test unit is not Python 3.x ready, but at least permit to ensure that once Ren'Py will pass to Python 3.x, any problem will come from the transition, not from my code.


Edit: Oh, by the way, sorry to crunch your dream, but I'm a guy... with a really bad sense of humor when it come to find a pseudonym ;)
 
  • Haha
Reactions: Lou111

Lou111

Active Member
Jun 2, 2018
538
680
If you knew :D

Yeah, but I'm working on this. I'm near to have finish the rewriting of the utilities I need for my mods/tools, and half way for the rewriting of the in-game configuration interface. As for the tool itself I don't know. Since I'll need to do tests with real games, it's from "Oops I need to rewrite everything" to "finished".

The test suit I talked about above is precisely for the utilities ; what is half stupid since the test unit is not Python 3.x ready, but at least permit to ensure that once Ren'Py will pass to Python 3.x, any problem will come from the transition, not from my code.


Edit: Oh, by the way, sorry to crunch your dream, but I'm a guy... with a really bad sense of humor when it come to find a pseudonym ;)
Thanks for informing me about this!
I only started reffering to you as a girl after you said that if I named my child after you it better be girl (more or less)
I know it doesn't make sense in hind-sight because your digital name could be anything, but it still left an impression on me.
The rule is that everyone is a man until physically proven otherwise but I made an exception for you my friend.
Happy holidays (to you and everyone) and I'm looking forward to any progress on this utility.
 
  • Like
Reactions: anne O'nymous

FaceCrap

Active Member
Oct 1, 2020
885
619
Yes. Replace file.write( "{}"\n".format( i ) ) by file.write( "{}:\n\t{}"\n".format( i, getattr( store, i ) ) )
After encountering a few case where a variable didn't have a value and googling 'getattr' I changed the above to
file.write( "{}:\n\t{}"\n".format( i, getattr( store, i, '' ) ) )
this at least prevents it throwing an AttributeError: ...
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,369
15,285
After encountering a few case where a variable didn't have a value and googling 'getattr' I changed the above to
file.write( "{}:\n\t{}"\n".format( i, getattr( store, i, '' ) ) )
this at least prevents it throwing an AttributeError: ...
Oh yeah, sorry about that.

As I said above on the thread, I'm rewriting many things regarding Ren'Py, preparing for the moment when it will pass to Python 3.x. What make me pass half of the day the nose deep in Python documentation, and at the end of the day I tend to mix everything and don't really remember how things works or what can be the difference between 2.x and 3.x.

But, positive point, you've been able to find a solution by yourself, and this is pleasing to see.