multiple screens/script files in editor - how to tell them apart

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
ComputerArt.Club
Veteran
Posts: 427
Joined: Mon May 22, 2017 8:12 am
Completed: Famous Fables, BoPoMoFo: Learn Chinese, Santa's workshop, Cat's Bath, Computer Art Club
Location: Taiwan
Contact:

multiple screens/script files in editor - how to tell them apart

#1 Post by ComputerArt.Club »

Usually when I am coding I tend to have 3-5 versions of script files with the same name open, for instance, if I am working on code for screens I will have a few screens files from my previous games open to see how I solved a problem before, or several versions of the gui file if I am working on the gui code, etc. This ends up being really confusing and it becomes difficult to tell them apart as they all have the same name in the editor (right now I am using notepad ++ but I have had the same problem in other editors).

Is there any way around this?
Can the screens, and gui files be renamed?
Is there another way to just change the display name inside editors? (this might be preferable)
Do you have a system or suggestions for best practices for this type of problem?

rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: multiple screens/script files in editor - how to tell them apart

#2 Post by rayminator »

i suggest that you put a note at the top stating what they are used for.

sample:
make sure you put the # in to grey it out.

Code: Select all

#this screen for gallery settings.
i think you can name it anyway you want them to be but not 100% sure
you can try it and find out to see what happens

User avatar
ComputerArt.Club
Veteran
Posts: 427
Joined: Mon May 22, 2017 8:12 am
Completed: Famous Fables, BoPoMoFo: Learn Chinese, Santa's workshop, Cat's Bath, Computer Art Club
Location: Taiwan
Contact:

Re: multiple screens/script files in editor - how to tell them apart

#3 Post by ComputerArt.Club »

rayminator wrote: Sat Apr 21, 2018 11:31 am i suggest that you put a note at the top stating what they are used for.

sample:
make sure you put the # in to grey it out.

Code: Select all

#this screen for gallery settings.
i think you can name it anyway you want them to be but not 100% sure
you can try it and find out to see what happens
Thanks, yes I guess that was lazy of me not to test it out in the first place. :(

Just tested renaming the screens file and the game still runs, provided both the rpy and rpyc files are renamed. If only the rpy file is rename it creates a new rpyc file and then fails to load the game.

Hopefully this type of renaming won't cause an unexpected errors, e.g. when building a distribution or android build. It might be a solution. Yeah, I kinda need the file name to be different or at least the name displayed in the relevant tab on the editor as I don't want to scroll up to the top and lose my place all the time.

If anyone has any further suggestions for best practices, I would love to hear them.

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: multiple screens/script files in editor - how to tell them apart

#4 Post by kivik »

The renaming won't cause any problems, as Ren'py basically reads all the files with .rpy extensions and compiles them (there're some other stuff going on but you don't need to know that in this context).


However, to solve your actual problem, there're a few things you can do:

First of all you should utilise the "Project" feature of your text editor. Add the project folder in your text editor and then only open files from within the project in that particular window. I'm not that familiar with Atom, but in Sublime Text, the Project Name is displayed along the title bar - I expect the same feature for Atom.

Screen Shot 2018-04-21 at 18.20.44.png

Now if you keep the project windows separate, and having to tab between them, you'll easily be able to tell which project you're working on. Another clue would be which project you're working on, is what tabs are opened.

In Sublime Text I can actually add multiple project folders (from different renpy games) into the same project, and if I open two files with the same name, it even tells me in the tab which file is from which folder. Again I don't know what Atom can do - but I know it has plugins which may give you the same features even if it's not out the box.

Screen Shot 2018-04-21 at 18.24.55.png

Personally I'd also recommend creating new rpy files that your script.rpy calls / jumps to, then you'd typically be working on different file names than other game anyway. There're no universal best ways, but you can break down your game by logic, by chapter, by characters, or combination of all of that.

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

Re: multiple screens/script files in editor - how to tell them apart

#5 Post by Ocelot »

A quick note: if you delete, rename, move or alter script files themselves, delete .rpyc files and let game recompile them again. If there is a .rpyc file withput corresponding .rpy, it will still be loaded (and you will basically load two .rpy files with same content in your case)
< < insert Rick Cook quote here > >

Post Reply

Who is online

Users browsing this forum: Google [Bot]