separating and organizing .rpy files?

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
Cubaris
Newbie
Posts: 16
Joined: Mon Apr 27, 2020 10:39 pm
Projects: Crescent Moon Bay, A Trip To The Park
Tumblr: CubarisMurina
itch: Cubaris
Location: California
Contact:

separating and organizing .rpy files?

#1 Post by Cubaris »

so i really like having my files organized, but im wondering if its possible to have separate files such as

characters.rpy, pronouns.rpy, etc.

id also like to know if its possible for me to organize the .rpy files in folders while still being able to make them work?
Image
hi im azrael, have my oc cas as a dog
[he/they]

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

Re: separating and organizing .rpy files?

#2 Post by Ocelot »

tickingClockwork wrote: Mon Apr 26, 2021 2:09 pm so i really like having my files organized, but im wondering if its possible to have separate files such as

characters.rpy, pronouns.rpy, etc.
Yes. All different RPY files are combined together from game point of view. For example you can easily jump to label containing in other file, show screen contained in another file (which is actually how default framework works), refer to variables contained in another files, etc.
tickingClockwork wrote: Mon Apr 26, 2021 2:09 pm id also like to know if its possible for me to organize the .rpy files in folders while still being able to make them work?
Yes, RenPy scans all subdirectories under game directory for RPY files.

More info: https://www.renpy.org/doc/html/language ... html#files
< < insert Rick Cook quote here > >

User avatar
Bum_McFluff
Regular
Posts: 45
Joined: Sat Aug 18, 2018 8:15 pm
Contact:

Re: separating and organizing .rpy files?

#3 Post by Bum_McFluff »

So, to be clear, I can sort all of my files into folders and files, which is excellent, but do I need to call or jump or otherwise reference these files. If I store all of my variables in a rpy file (for example), will it find them without any help from me?
What, spy on our spy as he searches for their spy? Why not, sounds rather like fun.

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

Re: separating and organizing .rpy files?

#4 Post by Ocelot »

From the script point of view, there are no individual files, everything is loaded as if it was in one file.

So you do not need to care where label is, you will always be able to jump to it. Same with varaibles. If it was defined somewhere, it is accessible anywhere.
< < insert Rick Cook quote here > >

User avatar
Bum_McFluff
Regular
Posts: 45
Joined: Sat Aug 18, 2018 8:15 pm
Contact:

Re: separating and organizing .rpy files?

#5 Post by Bum_McFluff »

Thnak you Ocelot, that is going to make things much easier for my small brain to handle. :)
What, spy on our spy as he searches for their spy? Why not, sounds rather like fun.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot]