[tutorial] Dress up game

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Message
Author
Another
Regular
Posts: 82
Joined: Sun Apr 18, 2010 8:57 am
Contact:

Re: [tutorial] Dress up game

#31 Post by Another »

Here's how we define the location of the exported images :

Code: Select all

$pygame.image.save(doll.load(), os.path.join(config.basedir, "c%s.png") %(str(time.time()).replace(".", "")))
The images appear thus in the base directory. Their names start with "c" and end with ".png".



Concerning the hue code, there's indeed a missing parenthesis in your script. Try replacing the line :

Code: Select all

            (100, 100), im.MatrixColor("hair%d.png"%hair, huearray[hue])
with :

Code: Select all

            (100, 100), im.MatrixColor("hair%d.png"%hair, huearray[hue])),.1
Once this problem is fixed, you should get a new error because you still need to define several hue matrixes (hue2, hue3,...). You can take hue1 as an example and change some parameters.

User avatar
noeinan
Eileen-Class Veteran
Posts: 1153
Joined: Sun Apr 04, 2010 10:10 pm
Projects: Ren'Py QuickStart, Crimson Rue
Organization: Statistically Unlikely Games
Deviantart: noeinan
Github: noeinan
Location: Washington State, USA
Contact:

Re: [tutorial] Dress up game

#32 Post by noeinan »

Thanks, I made the changes you mentioned, as well as a few other small changes like spacing and giving the correct number of different hair styles etc. And I am no longer getting an error message! Yay!

I don't think I completely understand how the hue values work, though. I changed some of the numbers but it doesn't seem to change when I press the arrows. (I made it so the top arrows select the hue.)
Attachments
Hues.rar
(1.08 MiB) Downloaded 120 times
Image

Image
Image

Another
Regular
Posts: 82
Joined: Sun Apr 18, 2010 8:57 am
Contact:

Re: [tutorial] Dress up game

#33 Post by Another »

It seems the hue system is still broken in your script :
  • the im.MatrixColor() function should be inside the draw_char() function ;
  • the two buttons that change the hue are inoperative.
I went ahead and brought some quick changes to make all those bits of code fit together. Now, you should be able to play with the parameters of the matrixes and see what they do :wink: .
Attachments
script.rpy
(8.39 KiB) Downloaded 194 times

User avatar
noeinan
Eileen-Class Veteran
Posts: 1153
Joined: Sun Apr 04, 2010 10:10 pm
Projects: Ren'Py QuickStart, Crimson Rue
Organization: Statistically Unlikely Games
Deviantart: noeinan
Github: noeinan
Location: Washington State, USA
Contact:

Re: [tutorial] Dress up game

#34 Post by noeinan »

Awesome! Thank you so much! :D
Image

Image
Image

User avatar
pyopyon
Veteran
Posts: 451
Joined: Thu Aug 29, 2013 4:35 am
Completed: https://chouette.itch.io/
Projects: Ocean Pearls, Catching the Fox [NaNo16], Singles
Organization: Jellyfish Parade
Tumblr: jelpiparade
Skype: miss.chouette
Soundcloud: pyopyon
itch: chouette
Contact:

Re: [tutorial] Dress up game

#35 Post by pyopyon »

If you used this game in the middle of game play, how do you return to the game after customizing your sprite?
Image ImageImage

WiP: Image

✿ Writer for Trade/Commission ✿

User avatar
noeinan
Eileen-Class Veteran
Posts: 1153
Joined: Sun Apr 04, 2010 10:10 pm
Projects: Ren'Py QuickStart, Crimson Rue
Organization: Statistically Unlikely Games
Deviantart: noeinan
Github: noeinan
Location: Washington State, USA
Contact:

Re: [tutorial] Dress up game

#36 Post by noeinan »

Well, if you're only supposed to have it at a certain point then you jump to it using labels.

Otherwise, use the script as it-- there's a button that lets you pull up the dress up game at any time.
Image

Image
Image

User avatar
pyopyon
Veteran
Posts: 451
Joined: Thu Aug 29, 2013 4:35 am
Completed: https://chouette.itch.io/
Projects: Ocean Pearls, Catching the Fox [NaNo16], Singles
Organization: Jellyfish Parade
Tumblr: jelpiparade
Skype: miss.chouette
Soundcloud: pyopyon
itch: chouette
Contact:

Re: [tutorial] Dress up game

#37 Post by pyopyon »

I figured it out, sorry.
Image ImageImage

WiP: Image

✿ Writer for Trade/Commission ✿

User avatar
pyopyon
Veteran
Posts: 451
Joined: Thu Aug 29, 2013 4:35 am
Completed: https://chouette.itch.io/
Projects: Ocean Pearls, Catching the Fox [NaNo16], Singles
Organization: Jellyfish Parade
Tumblr: jelpiparade
Skype: miss.chouette
Soundcloud: pyopyon
itch: chouette
Contact:

Re: [tutorial] Dress up game

#38 Post by pyopyon »

I'm having another problem-- I used the coding in my game, but for some reason, the sprite was a lot lower than it was supposed to be... It was totally under the textbox. At first I couldn't figure out why-- until I noticed that in the options menu for the game, the tutorial is sized at 1024 x 768.

My game, however, is sized at 800 x 600... so the repositioning coding here (at least, I think this is the culprit, haha):

Code: Select all

def draw_char_side(st, at): # same thing as above, just scaled and positioned for the sideimage; there's probably more elegant solution than this...
        return LiveComposite(
            (384, 674),
            (10, 550), im.FactorScale("base.png", .45, .45),
            (10, 550), im.FactorScale("skin%d.png"%skin, .45, .45),
            (10, 550), im.FactorScale("eyes%d.png"%eyes, .45, .45),
            (10, 550), im.FactorScale("pants%d.png"%pants, .45, .45),
            (10, 550), im.FactorScale("shirt%d.png"%shirt, .45, .45),            
            (10, 550), im.FactorScale("jacket%d.png"%jacket, .45, .45),
            (10, 550), im.FactorScale("hair%d.png"%hair, .45, .45)
            ),.1
...doesn't apply.

Do you know how I could adjust the variables to actually be on the side of my dialogue box?

EDIT:

I played around with it, and these are the coordinates I came up with. :^)

Code: Select all

def draw_char_side(st, at): # same thing as above, just scaled and positioned for the sideimage; there's probably more elegant solution than this...
        return LiveComposite(
            (384, 674),
            (0, 375), im.FactorScale("base.png", .45, .45),
            (0, 375), im.FactorScale("skin%d.png"%skin, .45, .45),
            (0, 375), im.FactorScale("eyes%d.png"%eyes, .45, .45),
            (0, 375), im.FactorScale("other%d.png"%other, .45, .45),
            (0, 375), im.FactorScale("pants%d.png"%pants, .45, .45),
            (0, 375), im.FactorScale("shirt%d.png"%shirt, .45, .45),            
            (0, 375), im.FactorScale("jacket%d.png"%jacket, .45, .45),
            (0, 375), im.FactorScale("hair%d.png"%hair, .45, .45)
            ),.1
Image ImageImage

WiP: Image

✿ Writer for Trade/Commission ✿

User avatar
kuzai
Regular
Posts: 85
Joined: Sat May 12, 2012 8:15 pm
Projects: Custom Lover, PuppyShipping DWH, Yu-Gi-Oh!: Chat
Location: Canada
Contact:

Re: [tutorial] Dress up game

#39 Post by kuzai »

Phew okay guys I've been here a couple times and I'm really sorry for being such a pester person but I really need help in knowing to make this character creation coding work for an idea of mine, and I'm not code tech savvy (much) so here is what I'd like to know

I'd like to make a character creating game that works alot like "XX na kanojo no tsukurikata 2" from KISS.
Image
The character I am hoping to make would have something these options
1. obvious scroller to scroll up or down for more options
2. the preset thing I don't really need so it can be ignored
3.the random button is a must have and I would like to know hoe to have that in there for people who don't feel like using up time to make a character (or if they're just bored xD)
4. The option to click on to be able to colour the hair/eyes/clothing etc! I especially need to know how to do this the most! I'll get back to it later and explain why.
5. (woops I messed up there is no five pfffft)
6.Another scroller only this one is to see more of the options you wish to add tor your character in general like more hair/eye shapes/ clothing etc.
7. I would like to be able to turn my character (yes I know I will have to draw extra images) mostly for the fact I will have more then one body pose for during the gameplay.
Image
So this is the colour thing I was talking about earlier, as you can see it is a colour palette and it is the biggest thing I would like to know how to make my game

8.This is not important so it can be ignored
9. This is also not important can be ignored
10. This would be very useful in the game, it lets you keep a a colour you selected and save it for if you want to use it later or if you like it but will decide on it later.
Image
This is for costumes/clothing, obviously so your character can wear any clothing you wish for him/her to wear.

11. As mentioned just all of the clothing to choose from
Image
Finally a profile where you can add many different things about your character.
12. This is by far very VERY important to me! Personality changer! I would like to know not only how to add the different personalities but to have the personalities show in the dialogue when the the character shows up in the game.
Image
and finally the final IMPORTANT thing of all in the game, the CG's. I would LOVE to know how to make the CG's showing your character come up and look like the character you created
I don't know if Ren'py can actually do ANY of this but hey I could be surprise. So yeah as you can see I am going to be very busy but it will be fun for me to make the game. I love character creation games and I want to be able to make such games for people who enjoy them just as much as I do.

Again sorry if I am bugging anyone I just really would like to know how to make my dream game possible, thank you so VERY much in advance if anyone has the answers

User avatar
noeinan
Eileen-Class Veteran
Posts: 1153
Joined: Sun Apr 04, 2010 10:10 pm
Projects: Ren'Py QuickStart, Crimson Rue
Organization: Statistically Unlikely Games
Deviantart: noeinan
Github: noeinan
Location: Washington State, USA
Contact:

Re: [tutorial] Dress up game

#40 Post by noeinan »

Someone already did something similar to this with a bunch of open source sprites. (Didn't include CGs, though.) Let me see if I can dig it up for you.

[EDIT] Here's the thread. http://direct-lemmasoft.renai.us/forums ... 11&t=21515

It's not exactly what you want, but I'm sure you will find some useful code in there.
Image

Image
Image

User avatar
kuzai
Regular
Posts: 85
Joined: Sat May 12, 2012 8:15 pm
Projects: Custom Lover, PuppyShipping DWH, Yu-Gi-Oh!: Chat
Location: Canada
Contact:

Re: [tutorial] Dress up game

#41 Post by kuzai »

Oh man I am going to have a hard time figuring this all out but thank you~
Now I need to figure out how to do the CG thingy

EDIT: I'm going to need a better understanding of this of what code does what now because I can hardly figure this thing out
I forgive and forget. Because I have a good heart and terrible memory

User avatar
noeinan
Eileen-Class Veteran
Posts: 1153
Joined: Sun Apr 04, 2010 10:10 pm
Projects: Ren'Py QuickStart, Crimson Rue
Organization: Statistically Unlikely Games
Deviantart: noeinan
Github: noeinan
Location: Washington State, USA
Contact:

Re: [tutorial] Dress up game

#42 Post by noeinan »

Unfortunately, I don't understand it myself. Might try posting on their thread, but... Since what you're trying to do is a lot more complicated I would just recommend making your own thread in the Ren'Py Questions and Announcements section.

http://direct-lemmasoft.renai.us/forums ... um.php?f=8
Image

Image
Image

outae
Newbie
Posts: 5
Joined: Sat Mar 22, 2014 9:00 am
Contact:

Re: [tutorial] Dress up game

#43 Post by outae »

Hello -- I couldn't find the answer anywhere so excuse me.

No matter what I do with the code, the "pants" layer is layered on top of the "shirt" layer. Is there anyway I could fix this? I'm trying to layer it underneath the shirt layer. Thanks

User avatar
pyopyon
Veteran
Posts: 451
Joined: Thu Aug 29, 2013 4:35 am
Completed: https://chouette.itch.io/
Projects: Ocean Pearls, Catching the Fox [NaNo16], Singles
Organization: Jellyfish Parade
Tumblr: jelpiparade
Skype: miss.chouette
Soundcloud: pyopyon
itch: chouette
Contact:

Re: [tutorial] Dress up game

#44 Post by pyopyon »

outae wrote:Hello -- I couldn't find the answer anywhere so excuse me.

No matter what I do with the code, the "pants" layer is layered on top of the "shirt" layer. Is there anyway I could fix this? I'm trying to layer it underneath the shirt layer. Thanks
It's layered in order, so if you have the pants before the shirts, the pants will be on top of the shirts.
Image ImageImage

WiP: Image

✿ Writer for Trade/Commission ✿

outae
Newbie
Posts: 5
Joined: Sat Mar 22, 2014 9:00 am
Contact:

Re: [tutorial] Dress up game

#45 Post by outae »

pyopyon wrote:
outae wrote:Hello -- I couldn't find the answer anywhere so excuse me.

No matter what I do with the code, the "pants" layer is layered on top of the "shirt" layer. Is there anyway I could fix this? I'm trying to layer it underneath the shirt layer. Thanks
It's layered in order, so if you have the pants before the shirts, the pants will be on top of the shirts.
Thank you! :)

Post Reply

Who is online

Users browsing this forum: No registered users