So I have a character that consists of a body layer and a clothing layer. the character has a lot of poses and clothing to fit onto their respected pose. For the sake of organization I gave my character a separate folder to hold all the images.
What code do I need to put in to create image that allows me to swap between layers and still have it attached to my character?
one character with multiple poses and clothes to wear
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.
- RicharDann
- Veteran
- Posts: 286
- Joined: Thu Aug 31, 2017 11:47 am
- Contact:
Re: one character with multiple poses and clothes to wear
The most important step is always the next one.
Re: one character with multiple poses and clothes to wear
ok so i can swap between layers but the image doesn't refresh once the conditional statments are changed.RicharDann wrote: ↑Thu Nov 16, 2017 1:54 pm You may want to use LiveComposite.
Here's a related thread:viewtopic.php?f=8&t=43675
define kim_cloth_code = 0
init:
image kim = LiveComposite(
(198, 650),
(0,0), "kim/calm_side.png",
(0,0), ConditionSwitch(
"kim_cloth_code == 1", "kim/calm_c3.png",
"True", "kim/calm_c4.png")
)
#start the game
show kim #this will show the kim/calm_c4.png layer
hide kim
$kim_cloth_code = 0
show kim # sprite should have changed clothes but instead it keeps wearing the same layer.
- RicharDann
- Veteran
- Posts: 286
- Joined: Thu Aug 31, 2017 11:47 am
- Contact:
Re: one character with multiple poses and clothes to wear
It would be better if you formatted your code by putting it between [code] and [/code] mantaining identation so it's easier to read. Anyway the problem seems to be that you're not changing the value in the script.
One thing to note is that kim_cloth_code variable should be defined using default instead of define. Define is used for values that do not change.
One thing to note is that kim_cloth_code variable should be defined using default instead of define. Define is used for values that do not change.
Code: Select all
default kim_cloth_code = 0
image kim = LiveComposite(
(198, 650),
(0,0), "kim/calm_side.png",
(0,0), ConditionSwitch("kim_cloth_code == 1", "kim/calm_c3.png",
"True", "kim/calm_c4.png")
)
label start:
show kim #Here we show the image
"Let's change clothes."
$ kim_cloth_code = 1 #Here we change the value from default, wich is 0, to 1.
#At this point LiveComposite will notice you changed the variable and show calm_c3
"I've changed"
$ kim_cloth_code = 0 #If you do this here, it will change back to show calm_c4
The most important step is always the next one.
Re: one character with multiple poses and clothes to wear
Would this be helpful to you? https://github.com/koroshiya/renpy-image-definer
I'm unsure how exactly to "run" the script as it says in the discription...
How would you run this code?
I'm unsure how exactly to "run" the script as it says in the discription...
How would you run this code?
Code: Select all
define_images('bg/', 0, False)
Who is online
Users browsing this forum: Bing [Bot]