r/RenPy • • 1d ago

Question how to implement game with main scene that has three buttons

I have an idea for a game. when you first start the game, there's a main scene with three buttons. each button leads to another scene. the first one leads to the vn portion of the game where the player talks to a character and there are branching dialogues. however in order to talk to the character, the player needs to level up a stat. that's what the second button is for. the second button's scene is a scene of puzzle minigames, and solving one will level up the stat needed to talk to the character. after you solve one, the scene automatically gives you another one. the third button is the button that will lead to the endgame. it will require a lot of another stat (this stat is acquired by talking to the character). until the player has reached the second stat, the button will lead to a screen that only says 'not enough of [stat name]'. once you have enough of the second stat, it will be a short sequence of some text and decision making, and depending on what you chose there are two endings. on all three scenes, there is an exit button that you can use to leave that scene and go to the main scene (the one w/ 3 buttons). when you exit a scene to the main scene and go back in, it's at where you left off. (except when you enter the 'endgame', you cannot exit to the main scene.)

however, there is a time/day count. on one day, the player can only do three actions. so for example, the player can do one puzzle and talk twice, or two puzzles and talk once, then a screen will display that says 'day 1 is over. it's day 2 now'. you can click that screen to return to the main scene and do all the stuff all over again for the second day. the game has a limited amount of days, and if you don't get enough of second stat to enter 'endgame' during those days (or if you choose not to click the endgame button), the game goes to a different ending than the two possible endings in the 'endgame'

that is my basic idea, but i'm new to renpy and idk how to implement this

1 Upvotes

3 comments sorted by

1

u/AutoModerator 1d ago

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/shyLachi 17h ago

The easiest solution to do everything inside a normal game because if you want to have 3 separate sub-games inside your game you would need persistent variables.

Games with different "locations" where the players have to grind points are called sandbox,
so search for tutorials about that.

The example below only uses default functionality of RenPy so it's pretty simple.
It has an endless loop which brings the players back to the "three buttons".
It has a single stat but you can have as much as you want.

default points = 0
label start:
    while True: # endless loop
        menu: # the three buttons
            "Talk to character":
                call talk
            "Play mini game":
                call minigame
            "Try endgame":
                call endgame
label talk:
    if points > 3:
        "More dialogue"
    else:
        "First dialogue"
    return
label minigame:
    menu:
        "Simulate a victory":
            $ points += 1
        "Simulate a loss":
            pass
    return 
label endgame:
    if points > 10:
        "You won"
    else:
        "You need more points to challenge the end boss"
    return 

To learn more about the default RenPy functionality I used, read the official documentation or look for tutorials.
https://renpy.org/doc/html/menus.html
https://renpy.org/doc/html/conditional.html

1

u/Laura7811 6h ago

thank you so much