Can I play these two different transitions at the same time?

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.
Post Reply
Message
Author
User avatar
parttimestorier
Regular
Posts: 164
Joined: Thu Feb 09, 2017 10:29 pm
Completed: No Other Medicine
Tumblr: parttimestorier
itch: janetitor
Location: Canada
Contact:

Can I play these two different transitions at the same time?

#1 Post by parttimestorier » Mon Apr 16, 2018 10:44 pm

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:

Code: Select all

define slowmove = MoveTransition(5.0)
define slowdissolve = Dissolve(5.0)
And this is how I'm trying to make it happen:

Code: Select all

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?
ImageImageImage

User avatar
Qlara
Regular
Posts: 77
Joined: Fri Nov 28, 2014 10:22 am
Completed: Carmilla
Skype: kantonija
itch: visualgothic
Location: Berlin
Contact:

Re: Can I play these two different transitions at the same time?

#2 Post by Qlara » 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.

User avatar
parttimestorier
Regular
Posts: 164
Joined: Thu Feb 09, 2017 10:29 pm
Completed: No Other Medicine
Tumblr: parttimestorier
itch: janetitor
Location: Canada
Contact:

Re: Can I play these two different transitions at the same time?

#3 Post by parttimestorier » Tue Apr 17, 2018 11:37 am

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.

Code: Select all

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
ImageImageImage

kivik
Miko-Class Veteran
Posts: 784
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Can I play these two different transitions at the same time?

#4 Post by kivik » 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:

viewtopic.php?t=41820

Let us know if you need help with the code.

User avatar
parttimestorier
Regular
Posts: 164
Joined: Thu Feb 09, 2017 10:29 pm
Completed: No Other Medicine
Tumblr: parttimestorier
itch: janetitor
Location: Canada
Contact:

Re: Can I play these two different transitions at the same time?

#5 Post by parttimestorier » Tue Apr 17, 2018 9:41 pm

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:

viewtopic.php?t=41820

Let us know if you need help with the code.
Thank you! I'll try that soon.
ImageImageImage

User avatar
Qlara
Regular
Posts: 77
Joined: Fri Nov 28, 2014 10:22 am
Completed: Carmilla
Skype: kantonija
itch: visualgothic
Location: Berlin
Contact:

Re: Can I play these two different transitions at the same time?

#6 Post by Qlara » Thu Apr 19, 2018 3:17 am

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.)
screenshot0003.jpg
Here's the exact code I used to replicate the problem (the character is my 'blood' sprite, your sun):

Code: Select all

    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

Code: Select all

init 2:
    transform movepos:
        xalign 0.0
        yalign 1.0
        linear 5.0 xalign 1.0
and using

Code: Select all

    scene bg scenery dusk
    show blood at movepos
    scene bg scenery night with slowdissolve
    pause

kivik
Miko-Class Veteran
Posts: 784
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Can I play these two different transitions at the same time?

#7 Post by kivik » Thu Apr 19, 2018 1:21 pm

Hey Qlara:

Imperf3kt's suggestion is to make the image itself an animation. So I think you should make the bg scenery night an animation:

Code: Select all

image bg scenery dusk_to_night:
    "dusk.png"
    "night.png" with slowdissolve

...

show bg scenery dusk_to_night
show blood at movepos

User avatar
Imperf3kt
Eileen-Class Veteran
Posts: 1842
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Can I play these two different transitions at the same time?

#8 Post by Imperf3kt » Thu Apr 19, 2018 5:36 pm

You may want to include some kind of timing to that.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

User avatar
Qlara
Regular
Posts: 77
Joined: Fri Nov 28, 2014 10:22 am
Completed: Carmilla
Skype: kantonija
itch: visualgothic
Location: Berlin
Contact:

Re: Can I play these two different transitions at the same time?

#9 Post by Qlara » Sat Apr 21, 2018 8:00 am

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.

kivik
Miko-Class Veteran
Posts: 784
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Can I play these two different transitions at the same time?

#10 Post by kivik » Sat Apr 21, 2018 8:51 am

Oh oops! Got confused looking down the thread without checking OP's name!

User avatar
parttimestorier
Regular
Posts: 164
Joined: Thu Feb 09, 2017 10:29 pm
Completed: No Other Medicine
Tumblr: parttimestorier
itch: janetitor
Location: Canada
Contact:

Re: Can I play these two different transitions at the same time?

#11 Post by parttimestorier » Sun Apr 22, 2018 10:48 am

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!
ImageImageImage

Post Reply

Who is online

Users browsing this forum: No registered users