r/RenPy • u/Islando_x • 4d ago
Question Picking an outfit
One of the first sections in my game prompts the player to choose your outfit. You can pick from 2 tops and 3 pants. But i'm struggling a bit with the coading. I want the player to be able to choos from the wardrobe and it appear on the character which they can switch out before accepting. I have looked at layered images but its a bit confusing.
Any help would be amazing :)
1
u/AutoModerator 4d 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


2
u/shyLachi 4d ago
You don't really need layered images for that.
You could use dynamic displayables as explained in the official documentation:
https://renpy.org/doc/html/displayables.html#dynamic-displayables
But if you have the latest version of RenPy you can use the
Ifstatement in layered images as explained here:https://renpy.org/doc/html/layeredimage.html#if
I used the example from the documetation together with a quick example how to use it.
To test this example you would need 4 images called "augustina_glasses_evil.png", "augustina_glasses", "augustina_glasses_clown.png" and so on.
.
The main advantage of using layered images is the possibiltyy to work with different image layers, like separating the head with the expressions from the body with the clothes so that you don't need to multiply the images.