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.
I'd like to have an effect in my game that shows the sun setting. I have one background for the sky during sunset, and another background for nighttime. So I thought the easiest thing to do might be to dissolve from the sunset background to the night background, while an image of the sun moves from one position to another.
I've defined the transitions I want to use like this:
scene bg sunset
show sun at firstsunposition
show sun at secondsunposition with slowmove
scene bg night with slowdissolve
I want the moving and the dissolving to happen at the same time. But currently, the sun takes five seconds to move, and then the background takes five seconds to dissolve after that. Is it possible to fix this so both transitions happen at once?
Qlara wrote: ↑Tue Apr 17, 2018 2:01 am
Are you using the latest Ren'Py version? I just tried it (and several variations) and the transitions do in fact happen at the same time.
Thanks for replying. I tried updating just now and I'm still having the same problem though. I wonder if there's something somewhere else in my code that's messing it up somehow.
Edit: I've tried just starting a new Ren'Py project with nothing but the information I need for this sunset transition in it, and it's still doing the same thing - the sun moves and then the background dissolves rather than them happening at the same time. In case you or anyone else can help me figure out what I'm doing wrong, I'll paste all the code that's in that project.
image bg sunset = "bgs-placeholder/lighthouse_outside_sunset.png"
image bg night = "bgs-placeholder/lighthouse_outside_night.png"
image sun = "cgs-placeholder/sun.png"
define slowmove = MoveTransition(5.0)
define slowdissolve = Dissolve(5.0)
init:
$ sunposition1 = Position(xpos=1108, ypos=265, xanchor=0, yanchor=0)
$ sunposition2 = Position(xpos=1477, ypos=486, xanchor=0, yanchor=0)
label start:
scene bg sunset
show sun at sunposition1
show sun at sunposition2 with slowmove
scene bg night with slowdissolve
return
kivik wrote: ↑Tue Apr 17, 2018 12:06 pm
I get the same result as you, and I think it makes sense since you're doing one transition on the image and the other on the scene.
I had a look on Google and Imperf3kt made a suggestion of turning the moving image into an animation:
Here's a screenshot, just to be sure we're talking about the same thing. (Character has moved about half-way and the night scene is half-way-overlayed.)
Here's the exact code I used to replicate the problem (the character is my 'blood' sprite, your sun):
scene bg scenery dusk
show blood:
xalign 0.0
yalign 1.0
linear 5.0 xalign 1.0
scene bg scenery night with slowdissolve # worked with 'show' as well as 'scene'
pause
Same result with defining the move transition elsewhere
Kivik, I think there's a slight misunderstanding. I posted the code, because for me it does work. I tried to replicate parttimestorier's problem in order to help.
Thanks for the help everyone! Kivik's suggestion to turn it into an animation works, but I'll also try Qlara's version.
Edit: I've tried Qlara's version and it seems like it works! For whatever reason, defining the sun moving transtion the way she did will work at the same time as the background transition, but not the way I did it. Thanks again!