Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
So I have a character that blinks, but the shine is a second layer that would overlay the eyes. I want to animate the blink so that the shine won't show up when the eye is closed, but will show up when the eye is open. Does anyone know how to do that?
The code I'm currently looking at is from the Ren'Py wiki, so I don't know if it's still applicable.
Am I right in thinking that you've got two layers: girl and shine, and you've got two versions of the girl image with eyes open and eyes closed?
If that's the case, how difficult would it be to break it into 3 layers: girl, shine, eyes?
I'm guessing from your image naming convention that you have different eyes for the girl - maybe a separate layer would actually make life much easier going forward?
Ah sorry for misunderstanding, also I realised my suggestion wouldn't work anyway as the shine has to go above the eyes - which makes me think:
Have an eye lid layer (eye closed) that goes from blank to completely visible. That will cover the shine layer and thus it won't show anymore.
That means: body / head > eyes > shine > eyelids
I couldn't find anything on triggering another image to disappear based on an image's own states unfortunately so I don't know if it's possible at all to do it that way. Maybe there's a lower level (pygame or python) callback you could use, but I think the eyelid as separate layer may be the easiest to implement. Hope that was helpful in some small way!
Hmm, I see. I don't think I can do that unfortunately...
So what I have for layers is the open eyes, the shine, and then the closed eye. I only need to implement the shine over the open eye. Is there a way to do that?
Ah, am I right in thinking then that the shine is actually a glowing effect that goes outside of the eyes then? If so, can you animate the shine layer instead?
image eye shine:
"[shine_option]_open.png" # use a variable to determine which shine image to use
choice:
4.5
choice:
3.5
choice:
1.5
# This randomizes the time between blinking.
"shine_closed.png" # if the shine is gone you can just use the closed eye image
.25
repeat
The shine is like an anime shine in which the eyes look more, well, shiny with them. The problem with the most recent post is that it assumes that the eye is simply on one layer, when there are two separate layers to the eyes. It's not really a 'glow' effect but is layered right on top of the eyes.
I already drew the layers, the eyelid is incorporated right onto the eye and it can't change. There's an open eye, a closed eye, and the shine only shows up on the open eye. (The eyes itself are one layer, while the shine a separate layer). The shine isn't part of the eye layer.
Sorry I'm a bit confused, but am I not right in thinking that you have an eye closed image?
Can you share a few of your images please so I can understand better what you have to hand?
I'm still under the impression that you have at least 3 images: eye opened, eye closed, shine. And you have two layers: eye layer, shine layer.
If that's the case, you just need to change the eye close image to be used in the shine layer, so that it goes between shine being shown:
eye open + shine
and eye closed:
eye open + eye closed
Ah, do you mean your eye closed image cannot cover the eye open image entirely? And it's not possible to redo all the eye closed images? Sorry if that's the case! Then my solution definitely won't work!
image girl eyes normal:
LiveComposite((775, 1400), #replace 775 and 1400 with the width and height respectively
(0, 0), "eye_open.png",
(0, 0), "eye_shine.png"
)
choice:
4.5
choice:
3.5
choice:
1.5
# This randomizes the time between blinking.
"eye_closed.png"
.25
repeat
image girl eyes normal:
LiveComposite((775, 1400), #replace 775 and 1400 with the width and height respectively
(0, 0), "eye_open.png",
(0, 0), "eye_shine.png"
)
choice:
4.5
choice:
3.5
choice:
1.5
# This randomizes the time between blinking.
"eye_closed.png"
.25
repeat
Ooh nice! I bet that will work! Sorry for my silly suggestion!