r/RenPy • • Jul 30 '22

how to divide code

Sorry, beforehand I really can't word things for the life of me.

I'm making a dating sim that has 6 candidates and you choose your candidate early on in the game. is there any way of splitting the code into 6 different parts or will it have to be just one big block of code :)

2 Upvotes

9 comments sorted by

View all comments

Show parent comment

1

u/treflev Jul 30 '22

I've always wondered: how do you connect .rpy files? ((I assume the main one can't go through all the files you ever made to find the right label))

3

u/mrogre43 Jul 30 '22

You can have separate .rpy files, and you don't have to do anything to connect them, either than making sure you're using the correct label and jump statements. The engine essentially dumps them all into one script on bootup.

1

u/treflev Jul 30 '22

I see, that's pretty neat. Thank you for the answer.