Lemma Soft Forums

Supporting creators of visual novels and story-based games since 2003.


Visit our new games list, blog aggregator, IRC, and wiki.
Activation problem? Email [email protected]
It is currently Sun May 19, 2013 6:07 pm

All times are UTC - 5 hours [ DST ]


Forum rules


Ask questions about one topic per thread, and use a descriptive subject. "NotImplemented error in script.rpy" is a good subject, "Tom's problems" is not. Remember to include all of traceback.txt or error.txt when reporting a problem, as well as the relevant lines of script. Use the [code] tag to format scripts.



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Feb 02, 2012 3:15 pm 
Newbie
User avatar

Joined: Wed Feb 01, 2012 4:28 pm
Posts: 4
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!


Top
 Profile Send private message  
 
PostPosted: Tue Feb 07, 2012 12:16 pm 
Veteran
User avatar

Joined: Sun Oct 09, 2011 11:15 pm
Posts: 390
Projects: Dream's Dénouement
Organization: Team ANARKY
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:
Code:
menu:
    "Green hair.":
         $ hair = "green"
    "Blue hair.":
         $ hair = "blue"


Example of the fuction that displays the customized sprite:
Code:
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


To display the customized sprite, you use:
Code:
call show_sprite


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...

_________________
Image Free hosting or website for your VN


Top
 Profile Send private message  
 
PostPosted: Thu Feb 09, 2012 4:45 am 
Newbie
User avatar

Joined: Wed Feb 01, 2012 4:28 pm
Posts: 4
Thank you very much! That is a big help. ^^ I'll be sure to remember this.


Top
 Profile Send private message  
 
PostPosted: Thu Feb 09, 2012 5:05 pm 
Miko-Class Veteran
User avatar

Joined: Mon Dec 13, 2010 9:30 am
Posts: 842
Location: New Brunswick, Canada
Projects: Camp Renard
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.

Code:
    image girl clothed happy = im.Composite(
        (300, 600)
        (0, 0), "girl_body.png",
        (0, 0), "girl_clothes.png",
        (100, 100), "girl_happy.png"
        )


Susan

_________________
In order to understand recursion, one must first understand recursion. (Anonymous)


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Protected by Anti-Spam ACP
Powered by phpBB® Forum Software © phpBB Group