The whole game in one file or separate 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
iamleyeti
Newbie
Posts: 3
Joined: Thu Oct 30, 2014 5:52 am
Projects: "Portrait of a Botanist"
Tumblr: diplodocouille
Soundcloud: iamleyeti
Contact:

The whole game in one file or separate files?

#1 Post by iamleyeti »

Hi there!
First time here, first topic and first question :D

I was wondering if it's better to write your whole game in one file or to separate the game in several files. My game is in 4 acts, so I was wondering that maybe it could be easier/faster to use separate files.

How do you manage a big project?

Thanks!

User avatar
Donmai
Eileen-Class Veteran
Posts: 1962
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: The whole game in one file or separate files?

#2 Post by Donmai »

Yes, to keep your project organised you can create several rpy files inside your game folder. Ren'Py will treat them as a single big script when running the game. You can use labels, jumps and calls to another script.
See here:
http://lemmasoft.renai.us/forums/viewto ... =8&t=28811
and here:
http://lemmasoft.renai.us/forums/viewto ... =8&t=28028
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

User avatar
iamleyeti
Newbie
Posts: 3
Joined: Thu Oct 30, 2014 5:52 am
Projects: "Portrait of a Botanist"
Tumblr: diplodocouille
Soundcloud: iamleyeti
Contact:

Re: The whole game in one file or separate files?

#3 Post by iamleyeti »

Perfect! I didn't know exactly where to look...

But will I need to call my characters again or the first script is enough?

Sorry for the silly questions, that's my first game with Ren'py :)

neowired
Regular
Posts: 199
Joined: Mon Dec 01, 2008 2:33 pm
Contact:

Re: The whole game in one file or separate files?

#4 Post by neowired »

I think you can put an "init" blocks of code into any place inside the files and it will be read at the game start regardless of where it is. You can put labels into any rpy file and they will be treated like they are in one file. You only need to declare things/variables/characters/pictures/etc. once in the game.

You can treat all the rpy files you make as a single file.

User avatar
iamleyeti
Newbie
Posts: 3
Joined: Thu Oct 30, 2014 5:52 am
Projects: "Portrait of a Botanist"
Tumblr: diplodocouille
Soundcloud: iamleyeti
Contact:

Re: The whole game in one file or separate files?

#5 Post by iamleyeti »

I did exactly like the first link you gave me Donmai and it works. It will be easier to separate acts, scenes and endings. Thank you so much!

User avatar
Donmai
Eileen-Class Veteran
Posts: 1962
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: The whole game in one file or separate files?

#6 Post by Donmai »

iamleyeti wrote:it works.
Nice to know! Good look with your game.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Post Reply

Who is online

Users browsing this forum: No registered users