Gosh I hope I'm doing this right...
I've been tinkering around with a few things on a dating sim I'm working on (it's also a fangame *shields self*) and I've been wondering...
I would really love for the player to be able to customize the look of their character. Different hair, eyes, and clothes you know? I know this is possible, but how?
Also, is it possible to show their customized player on a CG Scene and not just their sprite?
Any help is greatly appreciated!
Customizable Player... How?
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.
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.
- leon
- Miko-Class Veteran
- Posts: 554
- Joined: Sun Oct 09, 2011 11:15 pm
- Completed: Visual Novel Tycoon, Night at the Hospital, Time Labyrinth, The Buried Moon, Left of Center, Super Otome Quest
- Projects: Lemon Project, Porcelain Heart, Dream's Dénouement
- Organization: Team ANARKY
- Contact:
Re: Customizable Player... How?
It depends on how much customization you want. With a small number of customization options (for example - 3 options for eye, hair and clothes), you could simply prepare all combinations as images (3 options for 3 customizations would mean 3*3*3=27 images).
For more complexity, you will need to combine the images on the fly.
Menu example to store eye selection:
Example of the fuction that displays the customized sprite:
To display the customized sprite, you use:
This example is not the most elegant solution. It simply displays the images on top of each other. A better method would be to prepare the combined image first and display it once, but I'm not that experienced with Ren'Py yet...
To ensure the parts (eyes, hair, ...) are in the right locations, you can either position them in Ren'Py, but I think it's better if you save all the images from your photo editor so they fit (the hair, eyes, ... images should be the same size than the base sprite).
If a CG is a background + sprite(s), it shouldn't change anything. You just display the BG for the CG and the custom sprite on top of it (using the same code/function or a copy of it, with different images). But for more complex (action) CGs, this could mean a lot of extra resources...
For more complexity, you will need to combine the images on the fly.
Menu example to store eye selection:
Code: Select all
menu:
"Green hair.":
$ hair = "green"
"Blue hair.":
$ hair = "blue"
Code: Select all
label show_sprite:
show base_sprite
# TODO: add if-sentences to display selected clothes
show fancy_clothing
# if-sentences to display selected hair:
if hair == "blue":
show hair blue
if hair == "green":
show hair green
# TODO: add if-sentences to display selected eyes
show green_eyes
return
Code: Select all
call show_sprite
To ensure the parts (eyes, hair, ...) are in the right locations, you can either position them in Ren'Py, but I think it's better if you save all the images from your photo editor so they fit (the hair, eyes, ... images should be the same size than the base sprite).
If a CG is a background + sprite(s), it shouldn't change anything. You just display the BG for the CG and the custom sprite on top of it (using the same code/function or a copy of it, with different images). But for more complex (action) CGs, this could mean a lot of extra resources...
- Ninaiso
- Newbie
- Posts: 4
- Joined: Wed Feb 01, 2012 4:28 pm
- Tumblr: ninaiso
- Deviantart: ninaiso
- Contact:
Re: Customizable Player... How?
Thank you very much! That is a big help. ^^ I'll be sure to remember this.
- SusanTheCat
- Miko-Class Veteran
- Posts: 952
- Joined: Mon Dec 13, 2010 9:30 am
- Location: New Brunswick, Canada
- Contact:
Re: Customizable Player... How?
I would think that playing with Composite might achieve what you are looking for:
im.Composite(size, *args, **properties)
http://www.renpy.org/doc/html/displayables.html
This image manipulator composites multiple images together to form a single image.
Susan
im.Composite(size, *args, **properties)
http://www.renpy.org/doc/html/displayables.html
This image manipulator composites multiple images together to form a single image.
Code: Select all
image girl clothed happy = im.Composite(
(300, 600)
(0, 0), "girl_body.png",
(0, 0), "girl_clothes.png",
(100, 100), "girl_happy.png"
)
" It's not at all important to get it right the first time. It's vitally important to get it right the last time. "
— Andrew Hunt and David Thomas
— Andrew Hunt and David Thomas
Who is online
Users browsing this forum: No registered users