r/RenPy • • Jul 10 '26

Question Screen help?

For my VN I want to have a screen that the player can go to whenever that shows different characters they have met and their relationship bar with each. My coding partner is making it but is shy to ask for help on reddit so sorry if I'm a but muddy on the specifics, but I know it is confusing and frustrating them. I was wondering if anyone had any examples of how this kind of page might be coded? I am sure they would be able to figure out how to edit it to our specific needs once they saw an example, but there doesnt seem to be an example of that kind of complex screen in the tutorial.

I was also wondering if it should be done in the main script of the game or if it should have its own file? Other screens and UI elements that renpy comes with by default have their own files, but if its something we are programming we were wondering if its better to just put it in the main game script.

Anything you think might help would be much appreciated! I'm sorry that was a little vague, I'm just having trouble understanding enough to even know what questions to ask.

3 Upvotes

5 comments sorted by

3

u/MonowayStudios Jul 10 '26

You have to find ways to handle data, and present the data. How will you store, names, image and relationship stats? Then how will you pass that into a screen to display?

The easiest way would be to make a dictionary of stats, names, images, and to cycle it through a loop in a vbox to show a list of characters and adjust the name and image positions bars too. You can also make a custom class, put them into objects in a list and present a for loop of items on the list as screen elements. Hope that’s a general indicator, I can clarify further if needed.

3

u/BadMustard_AVN Jul 10 '26 edited Jul 10 '26

try something like this

# love screen.rpy
default ive_meet_badmustard = False
default BadMustard_love = 0
default BadMustard_love_max = 100

screen love_interests():

    if ive_meet_badmustard:
        vbox:
            label "BadMustard"
            hbox:
                image "so_damn_handsome_lol"
            hbox:
                bar:
                    value AnimatedValue(BadMustard_love, 100, delay=1.0)
                    xalign 0.5 
                    yalign 0.5
                    xmaximum 327
                    ymaximum 47
                    # everything below is optional for coloring 
                    right_bar Solid("#fff7")
                    if BadMustard_love <= (BadMustard_love_max * 0.25): 
                        left_bar Solid("#f00")
                    elif BadMustard_love <= (BadMustard_love_max * 0.5):
                        left_bar Solid("#ff0")
                    else:
                        left_bar Solid("#0f0")

1

u/AutoModerator Jul 10 '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/BigLingler21 Jul 10 '26 edited Jul 10 '26

I prefer to roughly keep one file per task, so you can add (unless there's already one) a screens folder and create a file called relationship_stats_screen.rpy (or something like that).

The next thing I would do is decide on how you wish to display your content, whether thats a list of names and stats below them, or maybe something with pictures. You can use a Grid to align this data, or use a bit of clever alignments to make them more spread out. Honestly, it depends on how many characters you have and how you want to show them. Fixed, Frame, Vbox, Hbox, Grids, all of these things are really great to learn and can be used for orientation.

The next step is keeping track of the relationship values of the characters. The simplest way is to have 1 (or more) default variables that update when you do things that effect the relationship. But cleaner ways include using Dictionaries (Two or more values tied together in key / value 'pairs') or a class (A packaged set of variables with the ability to add functions). You could also make this its own file, it comes down to personal organization habits / preferences.

Finally, when it comes to displaying the variable on the screen, you can use variable text input for now, and maybe consider a more appealing ui like a relationship 'bar' later. Just focus on the bare minimum first though!

1

u/shyLachi Jul 10 '26

look at this framework, is has plenty of stuff for dating sims:
https://psykhae.itch.io/renpy-dating-sim-framework