Super basic question on calling other scripts

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
GlassHorse
Regular
Posts: 30
Joined: Mon Jan 08, 2018 12:14 am
Contact:

Super basic question on calling other scripts

#1 Post by GlassHorse »

I feel like I'm not wording it right or something.

Any kind of example where it's a block of code you got, either from the cookbook section or patreon with the .rpy

I just don't know what to do with it. Something like a block of code that is meant for a mini game. I have the code, but no idea where to put it.

Not sure if I'm wording this right, but almost any kind of code on here that isn't something simple like an animation or a transition.

thanks again.

like anything from the cookbook section
viewtopic.php?f=51&t=60711

I know some can be define right before the game starts, but other more complicated stuff that may need more than just being put in the script.rpy and screens.rpy

User avatar
qirien
Miko-Class Veteran
Posts: 541
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
itch: qirien
Location: New Mexico, USA
Discord: qirien
Contact:

Re: Super basic question on calling other scripts

#2 Post by qirien »

You can put the code in any file with .rpy at the end and Ren'Py will read it. It actually doesn't care what any of your files are called; it puts all the .rpy files into one big thing and then runs code from there.
So usually you will download .rpy files and put them in a project, or copy and paste code into an .rpy file and save it in with your project. For example, if you downloaded some code for a cooking minigame, you might put it in cooking.rpy. Or it might have multiple .rpy files that you would put in your game directory with script.rpy

Does that make sense?
Finished games:
Image
Image
Image

Post Reply