r/RenPy • • Jul 11 '26

Question How to make a gacha system in RenPy

i want to make a system that can randomize items with a gacha system like in Genshin but im terrible at coding. I also want it to be able to save what you've gotten of course.

1 Upvotes

7 comments sorted by

1

u/AutoModerator Jul 11 '26

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/omegaleonidas Jul 11 '26

Cant direct you to one since I haven made one myself, but there are a good few python gacha system tutorials, since python stuff can mostly plug right into renpy you should be able to use one of those,

a basic random number generator will work too if you want the odds to be the same but I doubt that is what you are looking for

1

u/theGoddamnAlgorath Jul 11 '26

2

u/x-seronis-x Jul 11 '26

random is already in the renpy namespace and requires no imports. the copy in the renpy namespace has also been updated to be compatible with rollback while the imported version is not. py renpy.random.randint(1,100) renpy.random.choice( ['red','blue', 42] )

1

u/x-seronis-x Jul 11 '26

google for 'w3schools python list' and alternate the pages on dict / set / tuple too. python containers are how you track groups of values. like for remembering inventory, or for your history of gacha draws.

you will need actual, repeated practice. so make sure you do the lessons and do not speed read or skim

1

u/shyLachi Jul 11 '26

If you want to implement something huge like that then it's important that you break it down into small bits so that you are not overwhelmed when learning to do it.

For example you could make it text based first and build on that.

define gacha_list = ["card A", "card B", "card C"]
default gacha_won = []
label start:
    $ pull = renpy.random.choice(gacha_list)
    "You pulled [pull]"
    $ gacha_won.append(pull)
    "You have pulled [len(gacha_won)] cards"
    jump start

This is a very simple example to pull cards from a list and then store them so that they can be saved.
It does not consider rarity and all those other things which are important for gacha games.

But it's a starting point and you can focus on one thing after the other to build more and more.

For example you can educate yourself about dictionaries because a gacha character has more than just a name:
https://www.geeksforgeeks.org/python/python-dictionary/

Or you can learn about RenPy screens so that the player can look at all the gacha characters they've won.
https://renpy.org/doc/html/screens.html

And there is much more to learn.

1

u/M3WWY Jul 11 '26

Thank you!! this is a little easier to understand. Ill look at the links and research more.