Problems and doubts w/Layered images and dress up feauture

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
BLucy
Newbie
Posts: 9
Joined: Tue Jun 16, 2020 5:21 am
Contact:

Problems and doubts w/Layered images and dress up feauture

#1 Post by BLucy »

Hi!

I want to add a customization scene in my game, so I investigated and got to leon's tutorial and to BáiYù's tutorial. I've also read the Renpy documentation and I think I have a better understanding, but still there are many things I'm strugging with:

For what I understood LiveComposite and Layeredimages are used for the same, but Layered is a newer version and allows for a shorter code. Either way, I don't know what I'm doing wrong, I tried first with LiveComposite (though, looking back now, I think I have an idea of what I did wrong) and now I tried with Layered,but I think I still don't know how it's done:

Code: Select all

init -1:

layeredimage PPf:
    always:
        "piel2f"
    group piel:
        attribute piel1f:
            "piel1f"
        attribute piel2f:
            "piel2f"
        attribute piel3f:
            "piel3f"
        attribute piel4f:
            "piel4f"
The code I have goes like this (I know I can shorten it to just "attribute piel1f" or with auto, but I prefer to star like this in case it didn't work and had step back), with more groups written the same. The problem is, I don't know how to make them appear and how to make one specific combination come out, as this is for the main character that I want the player to personalize.
On this topic, can I have a group inside another group? I have 3 different eye shapes, but I also have, for each of those shapes, 4 different colours, and the same goes for the hair and clothes, or do I have to leave it like this?:

Code: Select all

group ojos:
        attribute ojos1mf default:
            "ojos1mf"
        attribute ojos1af:
            "ojos1af"
        attribute ojos1gf:
            "ojos1gf"
        attribute ojos1vf:
            "ojos1vf"
        attribute ojos2mf:
            "ojos2mf"
Other question I have is, is it overall better to have a base for a character and the different expresions separated and then use layeredimg or is not much difference if I have each experession as a single full boy image and display that instead? Or at least for npcs that can't be customized.

And (I know these are too many questions, but I think they're too connected) finally, for the customization part, I adapted BaiYu's and Leon's example to show what I needed (instead of Agustina's glasses or outfit, my character's outfit, eyes, and everything else), but first, it wouldn't show up as "there was no label tu jump to/call" and now that I've written a label, it'll just ignore it completly and go straight to the menu I put to confirm that's the wanted customization:

Code: Select all

### Dress-Up Screen
# Adapted from leon's [tutorial] Dress up game thread
# https://lemmasoft.renai.us/forums/viewtopic.php?f=51&t=14559

init python:
    piel, ropa, labios, ojos, pelo = 2, 1, 1, 1, 20 # default dressup items
    piel_num, ropa_num, labios_num, ojos_num, pelo_num = 4, 13, 3, 12, 1 # number of styles for each dressup item
label dress_up:
    screen dressup_example():

    ## Ensure this appears on top of other screens.
        zorder 100

        hbox:

            xalign 0.5
            yalign 0.15
            spacing 400

            textbutton _("<") action SetVariable('piel', max(piel-1,0))
            textbutton _(">") action SetVariable('piel',min(piel+1,piel_num))

        add "PPf" xalign 0.5

        hbox:

            xalign 0.5
            yalign 0.15
            spacing 400

            textbutton _("<") action SetVariable('ropa', max(ropa-1,0))
            textbutton _(">") action SetVariable('ropa',min(ropa+1,ropa_num))

        hbox:

            xalign 0.5
            yalign 0.15
            spacing 400

            textbutton _("<") action SetVariable('labios', max(labios-1,0))
            textbutton _(">") action SetVariable('labios',min(labios+1,labios_num))
        hbox:

            xalign 0.5
            yalign 0.5
            spacing 400

            textbutton _("<") action SetVariable('ojos', max(ojos-1,0))
            textbutton _(">") action SetVariable('ojos',min(ojos+1,ojos_num))

        hbox:

            xalign 0.5
            yalign 0.5
            spacing 400

            textbutton _("<") action SetVariable('pelo', max(pelo-1,0))
            textbutton _(">") action SetVariable('pelo',min(pelo+1,pelo_num))

        textbutton _("Hecho") action Jump('dressup_game') xalign 0.99 yalign 1.0

label dressup_game:
    show hr_neutralab with dissolve

    hr "Have you finished?"

    menu:

        "Yes":
I reread the documentation, rewatched the tutorials and tried what I came up with but I'm still stuck :(

Thank you in advance 🙏

Post Reply

Who is online

Users browsing this forum: Bing [Bot]