Page 1 of 1

SOLVED! Is there a way to "comment" an entire label

Posted: Mon Sep 30, 2019 10:56 pm
by nerupuff
Hello all.

Wondering if it is possible for me to use a hash mark (#) on a label and Ren'Py would ignore the entirety of the label and all its contents under that label. It would be much more convenient that way. If it is not doable, then is the only solution to add hash marks (#) on each line and block? Or is there a different code to implement the same intention?

I currently have labels with a large amount of content that I'd rather keep in the .rpy file (not cut and paste to a separate file) that I'll hide/ignore until I will need it/will edit it after, and adding individual # will be tiresome.

Thank you.

Re: Is there a way to "comment" an entire label

Posted: Mon Sep 30, 2019 11:02 pm
by isobellesophia
nerupuff wrote: Mon Sep 30, 2019 10:56 pm Hello all.

Wondering if it is possible for me to use a hash mark (#) on a label and Ren'Py would ignore the entirety of the label and all its contents under that label. It would be much more convenient that way. If it is not doable, then is the only solution to add hash marks (#) on each line and block? Or is there a different code to implement the same intention?

I currently have labels with a large amount of content that I'd rather keep in the .rpy file (not cut and paste to a separate file) that I'll hide/ignore until I will need it/will edit it after, and adding individual # will be tiresome.

Thank you.

I dont think that is possible as it seen here to the documentation.

https://www.renpy.org/doc/html/language ... l#comments

Re: Is there a way to "comment" an entire label

Posted: Mon Sep 30, 2019 11:06 pm
by nerupuff
Alright, but do you have any suggestions that could help?

Re: Is there a way to "comment" an entire label

Posted: Mon Sep 30, 2019 11:28 pm
by isobellesophia
nerupuff wrote: Mon Sep 30, 2019 11:06 pm Alright, but do you have any suggestions that could help?
How about this?

https://www.renpy.org/doc/html/text.html#text-tag-#

I dont think it can use hastags in game but give it a try.

Re: Is there a way to "comment" an entire label

Posted: Mon Sep 30, 2019 11:34 pm
by nerupuff
Errr, no. That's not related to the question at all. I appreciate the effort, but I'm hoping other people will answer and provide any suggestions to point me in the right direction.

Re: Is there a way to "comment" an entire label

Posted: Tue Oct 01, 2019 12:20 am
by Imperf3kt
Two options.

If you use editra as your editor, you can highlight a chunk of text and in the drop down menu at the top of the program you'll find an option to "toggle comment"
I believe shift + tab is the shortcut.
I find this extremely handy.

Option two is my actual recommendation, however.
Instead of commenting out an entire label, simply add a jump at the end of the previous label that skips right over the label entirely.
Remove the jump when the label is ready.

Alternatively, place the label/s at the end of your script and make sure there is a return at the end of the last label you want to use.

Re: Is there a way to "comment" an entire label

Posted: Tue Oct 01, 2019 2:11 am
by trooper6
Or use the triple quotes.

"""
Using three quotes will comment out
a whole block of quotes.
"""

Re: Is there a way to "comment" an entire label

Posted: Tue Oct 01, 2019 3:16 am
by hell_oh_world
nerupuff wrote: Mon Sep 30, 2019 11:34 pm Errr, no. That's not related to the question at all. I appreciate the effort, but I'm hoping other people will answer and provide any suggestions to point me in the right direction.
The most common and almost present shortcut key for comments is ctrl + /. Select all the block of codes then hit ctrl + /. It always works on every IDEs that I use, also on the text editor that I use.

You can also try the triple quotes technique, but it has some downsides if you are optimizing the game, as python doesn't really ignore a block of texts enclosed with these, rather it is being dumped in garbage collection or whatsoever. Not quite sure about that, but this is of course based on what I read.

Re: Is there a way to "comment" an entire label

Posted: Tue Oct 01, 2019 8:33 am
by nerupuff
Imperf3kt wrote: Tue Oct 01, 2019 12:20 am Option two is my actual recommendation, however.
Instead of commenting out an entire label, simply add a jump at the end of the previous label that skips right over the label entirely.
Remove the jump when the label is ready.

Alternatively, place the label/s at the end of your script and make sure there is a return at the end of the last label you want to use.
I don't use editra, so I didn't try that out (I use Atom, so shift + tab actually removes my indentation). BUT, your second suggestion is the more practical option, so I'll keep it in mind. It is definitely practical (the jumps), just gotta remember that I did that. The alternative, to keep it at the end of the script, I might end up forgetting lol. Thank you!
trooper6 wrote: Tue Oct 01, 2019 2:11 am Or use the triple quotes.

"""
Using three quotes will comment out
a whole block of quotes.
"""
It doesn't seem to work on Atom, but maybe other text editors, it works too. Thank you!
hell_oh_world wrote: Tue Oct 01, 2019 3:16 am The most common and almost present shortcut key for comments is ctrl + /. Select all the block of codes then hit ctrl + /. It always works on every IDEs that I use, also on the text editor that I use.
THANK YOU SO MUCH!!! This is such a handy shortcut that I can use on on Atom! This is such a lifesaver! Marking this as solved!

Re: SOLVED! Is there a way to "comment" an entire label

Posted: Tue Oct 01, 2019 12:42 pm
by drKlauz
Better yet add jump to start of label itself.
So this

Code: Select all

label event_234:
  bob 'blablabla'
  bob 'bye!'
  return
become this

Code: Select all

label event_234:
  jump event_234_skip
  bob 'blablabla'
  bob 'bye!'
label event_234_skip:
  return # or jump or however else event_234 label supposed to end, can be nothing at all if you use labels sequentially
This way whole game will treat event_234 same way, without knowing if it is ready or not, maintaining gameflow. Once you ready simple remove jump to skip and skip label.