• To improve security, we will soon start forcing password resets for any account that uses a weak password on the next login. If you have a weak password or a defunct email, please update it now to prevent future disruption.

Ren'Py pre-made functions library?

9thCrux

--Waifu maker--
Game Developer
Oct 22, 2017
844
3,218
Back in school I remember one of my instructors told the class about how efficient coders had something like a modules library, and how they would just go to their library to copy and paste a module into their project. Obviously after plugging in the module they had to customize the values and definitions for the specific project.

So I was wondering if someone with coding experience could help start a basic modules library for Ren'Py enthusiasts. Like a basic character stats system, a clock or time tracker, a basic inventory system, and so on.

Many people could benefit from having a functions or modules library; they could see an example of how its done and implemented, and after that they could start customizing the modules to their needs. What I personally do is to download a Ren'Py game and then decrypt it to see how they wrote their code but it feels like I'm stealing from them...

The Ren'Py forum offers a lot of information about coding but it takes a long time to actually find and implement what you want just by digging into their documentation and forums.

Having a handy functions library with "plug and play" modules can help many enthusiast get their games going, so please consider adding a basic module to this thread to help others. I will add some functions once I learn them, new to Ren'Py coding myself.
 

a meme

Member
Sep 26, 2017
274
259
Decrypt games and if they used other people's work, then they're supposed to credit them. You usually find the author and blog link in comment on top. Other than that, I agree. it's also a bitch to find stuff for RPGmaker: half of the websites are offline now and a lot of it is only properly listed in Japanese.
 

Penfold Mole

Engaged Member
Respected User
May 22, 2017
2,908
6,618
Unless you copy someone else's code, reading other dev's code and then writing your own from scratch is definitely not stealing. It's learning. And it's highly unlikely that you can actually use someone else's code to create a new game. If you do that, the game will be just a copy of the original.

Also, not all Renpy game scripts are packed inside rpa archives and at least some devs don't mind if you read their script. Especially when you help them to find and fix bugs.
Some Renpy games, game concepts or examples with everything in them are actually freely shared by their creators like Renpy itself. Some examples are available on Renpy Wiki.

Just make sure that you get a good example before you start to follow its style. Lots or maybe even most Renpy games that you can find here are written by beginners in Renpy, sometimes they also seem to have no previous experience in programming. It means that there is a lot of messy and bad code everywhere.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,229
14,984
Back in school I remember one of my instructors told the class about how efficient coders had something like a modules library, and how they would just go to their library to copy and paste a module into their project. Obviously after plugging in the module they had to customize the values and definitions for the specific project.
More exactly they have a ton of text files with a ton of part of code. Because when they start to make a library with them, they don't need to customize it later.


So I was wondering if someone with coding experience could help start a basic modules library for Ren'Py enthusiasts.
Just take a look on the forum. There's already people answering specific questions regarding the code with fully usable example. Myself I have some idea, and will probably retrieve part of my examples and make them better. But I wait the update of the forum before doing it ; being able to update my top message on the thread will make it easier since I'm just a human, I can forget a letter, found a better way to do it, and so on.

This said :
Like a basic character stats system, a clock or time tracker, a basic inventory system, and so on.
The problem is that there isn't really things like "basic" something here. When you look at Ren'py games code, you quickly discover that almost everyone is unique in a way or another. So if someone want to write a basic time tracker, it must make it easily extendable, because there's people wanting a three period time, other who goes with five, and some who sometime have the time divided in period and sometime not. I even found a game where the time division wasn't strict ; sometime it was three periods, some other it was five.
It must also be easy to use, to avoid misunderstanding and also not seem too hard for the creator who'll use it. And this need time and few update of the code (see above the "edit" thing).


Many people could benefit from having a functions or modules library; they could see an example of how its done and implemented, and after that they could start customizing the modules to their needs.
Even if it's outdated, the official cookbook have a ton of examples which are adapted in many games you can find here.


What I personally do is to download a Ren'Py game and then decrypt it to see how they wrote their code but it feels like I'm stealing from them...
It depend of the copyright. This said, most of the time the code itself is just reuse of something you can find on the cookbook, so it's free to use.
 

9thCrux

--Waifu maker--
Game Developer
Oct 22, 2017
844
3,218
Found this interesting channel in YouTube:

-Ren'Py tutorials-



She has very up to date tutorials for most of the things someone may need to build a game, I think is worth checking out.
 
  • Like
Reactions: GaLaLa05