I think I already asked this but I don't remember getting a precise answer so here it is again :
Is there any way to comment blocks of RenPy code ? I'd like to redo a particular scene but with the possibility to go back to the old version easily if it doesn't work. Putting # in front of every line would be rather tedious :/.
Comment blocks
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.
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.
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
This is more of an editor function then a language one, IMHO. In SciTE (and SciTE for Ren'Py), commenting a block of text can be done by selecting it, and then chosing Edit > Block Comment or Uncomment.
Similarly, block indent can be done by selecting text and hitting Tab, and block outdent can be done by selecting text and hitting shift-Tab.
Similarly, block indent can be done by selecting text and hitting Tab, and block outdent can be done by selecting text and hitting shift-Tab.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Mmm... true, yet Java offers two way to comment : // and /* */. One for lines and the other one for blocks. HTML and CSS follow a similar rule.
Since I'm quite used to my editor, I'd rather not change it.
Ah well, I just found a "comment" function like what you said. Well, it'll do for now I suppose ^^;... If it's not too difficult to implement though, please consider it since it would allow any editor to use that functionality. If it is, well, nevermind ^^;.
In any case, thanks
Since I'm quite used to my editor, I'd rather not change it.
Ah well, I just found a "comment" function like what you said. Well, it'll do for now I suppose ^^;... If it's not too difficult to implement though, please consider it since it would allow any editor to use that functionality. If it is, well, nevermind ^^;.
In any case, thanks
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Which editor are you using to edit Ren'Py code? Have you customized it in any way?
I resist the idea of block comments, because they are unnecessary and make the code a little harder to read. Block comments make it hard to determine if a given line will execute or not, because then the user has to scroll up and look for the start of the comment block to determine if a given line is commented out. While syntax highlighting helps alot with this, in general editors that are sophisticated enough to support syntax-highlighting also support block comments.
I resist the idea of block comments, because they are unnecessary and make the code a little harder to read. Block comments make it hard to determine if a given line will execute or not, because then the user has to scroll up and look for the start of the comment block to determine if a given line is commented out. While syntax highlighting helps alot with this, in general editors that are sophisticated enough to support syntax-highlighting also support block comments.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
I also use Crimson Editor, but using a copy of the python syntax files with added renpy keywords.
To set it up properly:
In the Crimson Editor 'link' subdirectory, create an "extension.rpy" file containing:
In the 'spec' subdirectory, copy 'python.key' to 'renpy.key' and 'python.spc' to 'renpy.spc'.
Edit the 'renpy.key' file, and add to the end of the [KEYWORDS0:GLOBAL] section the lines:
As long as the syntax type is autodetected as renpy (which is what the 'extension.rpy' file sets up), you can select a range of lines in the editor, right-click, and pick 'Make Comment' from the context menu.
To set it up properly:
In the Crimson Editor 'link' subdirectory, create an "extension.rpy" file containing:
Code: Select all
LANGSPEC:RENPY.SPC
KEYWORDS:RENPY.KEY
Edit the 'renpy.key' file, and add to the end of the [KEYWORDS0:GLOBAL] section the lines:
Code: Select all
# ===== RenPy keywords =====
at call hide image init jump menu onlayer python
return scene set show with label
Who is online
Users browsing this forum: apocolocyntose, DewyNebula