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

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
nerupuff
Veteran
Posts: 211
Joined: Sat Dec 02, 2017 2:24 am
Projects: InTWON (Nano19)
Contact:

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

#1 Post by nerupuff » 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.
Last edited by nerupuff on Tue Oct 01, 2019 8:33 am, edited 1 time in total.
ImageImage
Hire me for proofreading, editing, and (maybe) writing! ♡ Check here!

User avatar
isobellesophia
Miko-Class Veteran
Posts: 976
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

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

#2 Post by isobellesophia » Mon Sep 30, 2019 11:02 pm

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
I am a friendly user, please respect and have a good day.


Image

Image


User avatar
nerupuff
Veteran
Posts: 211
Joined: Sat Dec 02, 2017 2:24 am
Projects: InTWON (Nano19)
Contact:

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

#3 Post by nerupuff » Mon Sep 30, 2019 11:06 pm

Alright, but do you have any suggestions that could help?
ImageImage
Hire me for proofreading, editing, and (maybe) writing! ♡ Check here!

User avatar
isobellesophia
Miko-Class Veteran
Posts: 976
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

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

#4 Post by isobellesophia » Mon Sep 30, 2019 11:28 pm

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.
I am a friendly user, please respect and have a good day.


Image

Image


User avatar
nerupuff
Veteran
Posts: 211
Joined: Sat Dec 02, 2017 2:24 am
Projects: InTWON (Nano19)
Contact:

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

#5 Post by nerupuff » 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.
ImageImage
Hire me for proofreading, editing, and (maybe) writing! ♡ Check here!

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

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

#6 Post by Imperf3kt » Tue Oct 01, 2019 12:20 am

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.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
Free Android GUI - Updated occasionally

User avatar
trooper6
Lemma-Class Veteran
Posts: 3706
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

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

#7 Post by trooper6 » Tue Oct 01, 2019 2:11 am

Or use the triple quotes.

"""
Using three quotes will comment out
a whole block of quotes.
"""
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
hell_oh_world
Veteran
Posts: 352
Joined: Fri Jul 12, 2019 5:21 am
Projects: The Button Man
Organization: NILA
Location: Philippines
Contact:

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

#8 Post by hell_oh_world » Tue Oct 01, 2019 3:16 am

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.

User avatar
nerupuff
Veteran
Posts: 211
Joined: Sat Dec 02, 2017 2:24 am
Projects: InTWON (Nano19)
Contact:

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

#9 Post by nerupuff » Tue Oct 01, 2019 8:33 am

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!
ImageImage
Hire me for proofreading, editing, and (maybe) writing! ♡ Check here!

drKlauz
Regular
Posts: 194
Joined: Mon Oct 12, 2015 3:04 pm
Contact:

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

#10 Post by drKlauz » Tue Oct 01, 2019 12:42 pm

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.
I may be available for hire, check my thread: viewtopic.php?f=66&t=51350

Post Reply

Who is online

Users browsing this forum: Google [Bot], richycapy