Is it possible to "Split up" the script file ?

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
enzof2003
Newbie
Posts: 7
Joined: Fri Nov 09, 2018 6:04 pm
Contact:

Is it possible to "Split up" the script file ?

#1 Post by enzof2003 »

Hello, so i was creating my Visual Novel, and the script is starting to be quite long, i though that maybe it was possible to make a script file for like each chapter but with no avail. So maybe one of you guys can help me out on this issue

Thank

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
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 it possible to "Split up" the script file ?

#2 Post by isobellesophia »

Make a new file named chapters.rpy for example, (place it where the scripts screens and etc.. where have been placed.) then in the launcher, press the current project and click "all script files", then there will be an opened new script that you created, (it starts with 1 line.)

make sure the labels will be putted in there and other function blah blah, and for the script.rpy, make a jump label so you can make a chapter label. (just like when you open screens in screens.rpy.)


(Plus, Ren'Py editor is infinite, (probably.)( it is depends how size the script is.)

Sorry for the bad explanation.
I am a friendly user, please respect and have a good day.


Image

Image


User avatar
Sarchalen
Regular
Posts: 29
Joined: Tue Aug 08, 2017 5:23 pm
Projects: Sugawara Chronicle
Contact:

Re: Is it possible to "Split up" the script file ?

#3 Post by Sarchalen »

Renpy processes every .rpy file in the folder at runtime. Make a folder called chapter 1, with a label called chapter one. Have it jump to label chapter 2, and make another file for that. You can split it up however you want, renpy sees it all as the same thing.

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

Re: Is it possible to "Split up" the script file ?

#4 Post by Imperf3kt »

Very much so possible, in fact it's the recommended way to organise your script.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
SpicyMayo1429
Regular
Posts: 36
Joined: Tue Mar 20, 2018 11:23 am
Contact:

Re: Is it possible to "Split up" the script file ?

#5 Post by SpicyMayo1429 »

To call another 'script' file, I've used this:

Code: Select all

call section_1m from _call_Section_1_male
## section_1m would be the label name while Section_1_male is the name of the other file
So if you go by chapters it'll look somthing like this:

Code: Select all

call label_name_here from _call_Chapter_1

User avatar
Matalla
Veteran
Posts: 202
Joined: Wed Mar 06, 2019 6:22 pm
Completed: Max Power and the Egyptian Beetle Case, The Candidate, The Last Hope, El cajón del viejo escritorio, Clementina y la luna roja, Caught in Orbit, Dirty Business Ep 0, Medianoche de nuevo, The Lost Smile
itch: matalla-interactive
Location: Spain
Contact:

Re: Is it possible to "Split up" the script file ?

#6 Post by Matalla »

SpicyMayo1429 wrote: Fri Mar 15, 2019 12:31 am To call another 'script' file, I've used this:

Code: Select all

call section_1m from _call_Section_1_male
## section_1m would be the label name while Section_1_male is the name of the other file
So if you go by chapters it'll look somthing like this:

Code: Select all

call label_name_here from _call_Chapter_1
There's no need to reference the name of the other script file. I have 12 scripts in my proyect now (should be around 20 when the project is finished) and never use a reference to a file
Comunidad Ren'Py en español (Discord)
Honest Critique

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

Re: Is it possible to "Split up" the script file ?

#7 Post by Imperf3kt »

Yeah, all that should be needed is to simply make sure there's a return at the end of one script and a label at the start of another.
To move between script files, one simply jumps or calls labels like normal, as if it was all one big file.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: Google [Bot], mirceea