Simultaniously dissolve side image and character image?

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
Amie
Regular
Posts: 28
Joined: Tue Jun 06, 2017 4:48 am
Contact:

Simultaniously dissolve side image and character image?

#1 Post by Amie » Thu Jul 06, 2017 5:29 am

Hi everyone, OK, so I'm a little stuck again. When I change a characters expression with dissolve, I want the side image to also change expression with dissolve, but this seems to be a bit tricky.

I'm using the code below to make side images transition smoothly between expressions:

Code: Select all

transform same_transform(old, new):
    old
    new with Dissolve(0.2, alpha=True)

define config.side_image_same_transform = same_transform
But this only works if you don't use a transition on your main character image. So for example if I "show Alice happy" then the above code takes care of transitioning the side image with a nice dissolve effect, but if I do "show Alice happy with dissolve", then it will kind of fade out the side image and then just instantly show the new side image once the main character image has finished transitioning.

Is there a way to dissolve between character images and also have the side image dissolve to the new expression simultaneously?

User avatar
DannyGMaster
Regular
Posts: 113
Joined: Fri Sep 02, 2016 11:07 am
Contact:

Re: Simultaniously dissolve side image and character image?

#2 Post by DannyGMaster » Fri Jul 07, 2017 11:31 am

Indeed, it is very strange, I think this happens because of how same_transform is designed to work,
it shows the old image without transition then dissolves into the new one when the image changes. Maybe for games where the main character image doesn't change and the side image
is the one that shows the different expressions. Sadly the Documentation doesn't offer a lot in therms of
Side Image manipulation.

A possible solution might be trying to use ShowingSwitch() or CoditionSwitch(),
they are explained here: https://www.renpy.org/doc/html/displaya ... wingSwitch (ConditionSwitch is
a bit up the page). In the case of ShowingSwitch, you could add the transform as an argument of the image after the xalign and yalign, something like:

Code: Select all

#This is a custom dissolve transform
transform my_side_transform:
    alpha 0.0
    xalign 1.0
    yalign 1.0
    linear .2 alpha 1.0 #This is the dissolve part, linear is the time

define e = Character("Eileen",
    show_side_image=ShowingSwitch(
        "eileen happy", At("eileen_happy_side.png", my_side_transform),
        None, At("eileen_happy_default.png", my_side_transform),
        )
    )
This is merely an example, you should tweak it to suit your own code.
Last edited by DannyGMaster on Fri Jul 07, 2017 11:46 am, edited 1 time in total.
The silent voice within one's heart whispers the most profound wisdom.

User avatar
TellerFarsight
Veteran
Posts: 230
Joined: Sun Jun 04, 2017 8:09 pm
Projects: Vora, Secrets Untold
Location: Toronto, ON
Contact:

Re: Simultaniously dissolve side image and character image?

#3 Post by TellerFarsight » Fri Jul 07, 2017 11:45 am

Now, I don't fully understand what I'm about to explain and hopefully someone can clear it up,

but,

there's something a little bit unintuitive about applying transitions like dissolve and fade. As far as I've seen through trial and error, when you, say, transition between one expression and another "with fade", the whole screen will briefly go to black and return, showing the new expression. It doesn't just turn the sprite black or just the expression black, but the whole screen.
I assume dissolve works the same way, where "dissolving" from one character expression to another actually fades out the whole screen and simultaneously fades in the new screen. Because all the elements of the screen are exactly identical except for the expressions, they are the only parts you notice, but I think that might be how it works.
My theory is that this is why your side image is gone, because the main image dissolving out takes the side image with it, and then the new main image dissolves in without the side image. Then, once that transition's done, the side image pops in at whatever point it's at in its own transition. If you make same_transition take a much longer time, you might be able to see if this is happening. Without the main image changing, the side image transitions perfectly, yeah?

As for a solution, nothing is really coming to mind. I don't think the problem has anything to do with layers, so that won't help. I've never used Switches, so maybe Danny's suggestion can help.
Current Project: Vora
Also Check Out: Devil Survivor [Reverse-Engineered]

User avatar
DannyGMaster
Regular
Posts: 113
Joined: Fri Sep 02, 2016 11:07 am
Contact:

Re: Simultaniously dissolve side image and character image?

#4 Post by DannyGMaster » Fri Jul 07, 2017 11:57 am

TellerFarsight wrote:It doesn't just turn the sprite black or just the expression black, but the whole screen.
I think that is exactly the case. Transitions apply to the entire screen, so if you use

Code: Select all

 
show eileen with dissolve
The entire screen dissolves, but if you use:

Code: Select all

 
transform my_dissolve(x):
    alpha 0.0
    linear x alpha 1.0

label transform_test:
    show eileen at truecenter, my_dissolve(.5)
It applies only to eileen.

Having the side image change at the same time is a bit trickier so that's why more advanced functions like ConditionSwitch and ShowingSwitch are needed, or at least that's what I think.
The silent voice within one's heart whispers the most profound wisdom.

User avatar
Amie
Regular
Posts: 28
Joined: Tue Jun 06, 2017 4:48 am
Contact:

Re: Simultaniously dissolve side image and character image?

#5 Post by Amie » Sat Jul 08, 2017 10:41 am

Wow, thanks DannyGMaster and TellerFarsight! I don't know how you manage to figure this stuff out, do you think I should really start learning python? I mean, how did you get so knowledgable about this stuff?

User avatar
TellerFarsight
Veteran
Posts: 230
Joined: Sun Jun 04, 2017 8:09 pm
Projects: Vora, Secrets Untold
Location: Toronto, ON
Contact:

Re: Simultaniously dissolve side image and character image?

#6 Post by TellerFarsight » Sat Jul 08, 2017 11:25 am

Most of what I know is probably from other people on this site, like Danny, answering my questions.
There are official pages explaining a lot of this stuff (if you just google ren'py documentation).

I don't really know python that well, which I really should get working on. I recommend you do too if you want to go beyond very simple game design; Ren'Py can do some ridiculous things (in my opinion) if you start putting straight python code into it. I'm trying to learn how to do battle engines now, and I'm sure it's a very complicated but very doable system.
Current Project: Vora
Also Check Out: Devil Survivor [Reverse-Engineered]

User avatar
Amie
Regular
Posts: 28
Joined: Tue Jun 06, 2017 4:48 am
Contact:

Re: Simultaniously dissolve side image and character image?

#7 Post by Amie » Sat Jul 08, 2017 4:28 pm

It's funny because I have always been scared of coding, in the past I always chose engines that didn't require it, like Construct 2 or RPG Maker, etc, in fact the reason I'm here now is because I really wanted to make a VN and was waiting for Visual Novel Maker to be released, but they took soooo long with their delays that I started with Ren'Py (I tried Tyrano first but it's a little too buggy), and now I really love Ren'Py, but it's still pretty confusing at times for me, I guess I'll buy a Python for dummies book or something xD

Post Reply

Who is online

Users browsing this forum: Google [Bot]