Ren'Py The better way to do an Something Unlimited Brothel System?

Ikatikei

Newbie
Aug 1, 2018
82
46
What would be the better way to do an menu like this in Renpy? I know that make it using Classes would be more pratical because the possibilities of adding a new character and their sprite on the right, but don't know how the rest would be working and how would it call the labels for the scenes.


imagem_2023-03-07_203647962.png
 

osanaiko

Engaged Member
Modder
Jul 4, 2017
2,248
3,851
Better than what?

There's nothing simple about building out a complex UI dealing with dynamic data in any language. That especially applies to Renpy which is intended to be a VN/KN builder, and requires extensive development work to make it have a non-linear Trainer style game play like SU.

Have you looked at the code that Ohwee is writing in his port of SU to renpy?
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,302
15,172
What would be the better way to do an menu like this in Renpy?
The simplest would be to rely on lists.

Python:
default availablesHeroines = []
default dancingHeroines = []
default strippingHeroines = []
default specialHeroines = []

screen clubWorks():

    frame:
        xpos 100
        ypos 100

        grid 1 3:
            for i in range(0, 3 ):
                if len( dancingHeroines ) <= i:
                    add "blank.png"
                else:
                    add ( "avatars/{}.png".format( dancingHeroines[i] ) )

    frame:
        xpos 100
        ypos 300

        grid 1 3:
            for i in range(0, 3 ):
                if len( strippingHeroines ) <= i:
                    add "blank.png"
                else:
                    add ( "avatars/{}.png".format( strippingHeroines[i] ) )

    frame:
        xpos 100
        ypos 500

        grid 1 3:
            for i in range(0, 3 ):
                if len( specialHeroines ) <= i:
                    add "blank.png"
                else:
                    add ( "avatars/{}.png".format( specialHeroines[i] ) )


    frame:
        xpos 500
        ypos 100

        grid 4 3:
            for i in range(0, 13 ):
                if len( heroines ) <= i:
                    add "blank.png"
                else:
                    add ( "avatars/{}.png".format( heroines[i] ) )
It's just a raw canvas, to effectively works you need to use drag instead of add, in order to benefit from the feature and then have an easily usable interface. And of course the visual is totally limited. But basically it's how it can be done.

It's also the best approach since it's totally independent of the rest of your game design. I wrote this example with in mind the heroines' name be used to fill the list, but it can be whatever else you want. If you use objects to represent them, it still works, either by having the __str__ or __repr__ method return the name, or by calling whatever attribute or method that would return the name. If you use ID, either the avatar images are named accordingly to those ID, or you call a function/method that translate it into a name.
 

Ikatikei

Newbie
Aug 1, 2018
82
46
The simplest would be to rely on lists.

Python:
default availablesHeroines = []
default dancingHeroines = []
default strippingHeroines = []
default specialHeroines = []

screen clubWorks():

    frame:
        xpos 100
        ypos 100

        grid 1 3:
            for i in range(0, 3 ):
                if len( dancingHeroines ) <= i:
                    add "blank.png"
                else:
                    add ( "avatars/{}.png".format( dancingHeroines[i] ) )

    frame:
        xpos 100
        ypos 300

        grid 1 3:
            for i in range(0, 3 ):
                if len( strippingHeroines ) <= i:
                    add "blank.png"
                else:
                    add ( "avatars/{}.png".format( strippingHeroines[i] ) )

    frame:
        xpos 100
        ypos 500

        grid 1 3:
            for i in range(0, 3 ):
                if len( specialHeroines ) <= i:
                    add "blank.png"
                else:
                    add ( "avatars/{}.png".format( specialHeroines[i] ) )


    frame:
        xpos 500
        ypos 100

        grid 4 3:
            for i in range(0, 13 ):
                if len( heroines ) <= i:
                    add "blank.png"
                else:
                    add ( "avatars/{}.png".format( heroines[i] ) )
It's just a raw canvas, to effectively works you need to use drag instead of add, in order to benefit from the feature and then have an easily usable interface. And of course the visual is totally limited. But basically it's how it can be done.

It's also the best approach since it's totally independent of the rest of your game design. I wrote this example with in mind the heroines' name be used to fill the list, but it can be whatever else you want. If you use objects to represent them, it still works, either by having the __str__ or __repr__ method return the name, or by calling whatever attribute or method that would return the name. If you use ID, either the avatar images are named accordingly to those ID, or you call a function/method that translate it into a name.
You're a real life saver, I tested it and after some little adjusts it works fine. I don't changed the code for using drag and drop yet, but I will try it. Thank you very much. =)