[SOLVED!!] Prevent dialogue disappearing during sprite transition?

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.
Message
Author
User avatar
Offworlder
Regular
Posts: 107
Joined: Mon Aug 20, 2018 6:33 pm
Contact:

[SOLVED!!] Prevent dialogue disappearing during sprite transition?

#1 Post by Offworlder » Sat Jan 05, 2019 4:13 am

I've been trying for ages to find a solution to this issue, but I've thus far come up empty.
Basically, I want to switch sprites mid-dialogue and use the dissolve transition when doing so.

With the "{nw}" and "extend" tags, getting the sprite to switch automatically within the same line of dialogue is no problem. However, unless I don't use the dissolve transition when switching sprites, the dialogue disappears during the switch.

Is there some way around this? I don't want to be inconsistent by having one or two places where expression changes don't have transitions, and I don't want to ruin the effect I'm going for by having the dialogue disappear partway through. >_<

Here's the code I'm using:

Code: Select all

show neth b1 with dissolve
n2 "{i}d{w=0.1}e{w=0.1}e{w=0.1}p{w=0.1}{nw} "
show neth b2 with dissolve
extend "b{w=0.1}r{w=0.1}e{w=0.1}a{w=0.1}t{w=0.1}h{/i}"
Any and all help is greatly appreciated!
Last edited by Offworlder on Mon Jan 07, 2019 8:59 pm, edited 1 time in total.

User avatar
IrinaLazareva
Veteran
Posts: 376
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: IKG
Location: St.Petersburg, Russia
Contact:

Re: Prevent dialogue disappearing during sprite transition?

#2 Post by IrinaLazareva » Sat Jan 05, 2019 5:50 am

try

Code: Select all

define mydis = { "master" : Dissolve(1.0) }

Code: Select all

show neth b1 with dissolve
n2 "{i}d{w=0.1}e{w=0.1}e{w=0.1}p{w=0.1}{nw} "
show neth b2 with mydis
extend "b{w=0.1}r{w=0.1}e{w=0.1}a{w=0.1}t{w=0.1}h{/i}"
https://renpy.org/doc/html/transitions. ... ransitions
There is a light at the end of the tunnel, just pray it's not a train.
___
TODO: unresolved/нерешённое

User avatar
Offworlder
Regular
Posts: 107
Joined: Mon Aug 20, 2018 6:33 pm
Contact:

Re: Prevent dialogue disappearing during sprite transition?

#3 Post by Offworlder » Sat Jan 05, 2019 6:19 am

IrinaLazareva wrote:
Sat Jan 05, 2019 5:50 am
try

Code: Select all

define mydis = { "master" : Dissolve(1.0) }

Code: Select all

show neth b1 with dissolve
n2 "{i}d{w=0.1}e{w=0.1}e{w=0.1}p{w=0.1}{nw} "
show neth b2 with mydis
extend "b{w=0.1}r{w=0.1}e{w=0.1}a{w=0.1}t{w=0.1}h{/i}"
https://renpy.org/doc/html/transitions. ... ransitions
I've actually already tried this method. D:
It behaves as though there's no transition at all, so it just jumps straight from one sprite to the other while ignoring the "mydis" aspect.

User avatar
IrinaLazareva
Veteran
Posts: 376
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: IKG
Location: St.Petersburg, Russia
Contact:

Re: Prevent dialogue disappearing during sprite transition?

#4 Post by IrinaLazareva » Sun Jan 06, 2019 8:59 pm

Strange... It is work for me. Anyway,
Alex wrote:ATL transforms should be the answer.
viewtopic.php?f=8&t=14823#p193210 (there are other problem, but the same decision)
There is a light at the end of the tunnel, just pray it's not a train.
___
TODO: unresolved/нерешённое

lacticacid
Regular
Posts: 36
Joined: Fri Nov 23, 2018 6:44 pm
Contact:

Re: Prevent dialogue disappearing during sprite transition?

#5 Post by lacticacid » Sun Jan 06, 2019 10:18 pm

Copy and paste the dialogue you had to after the transition with the {fast} tag after it, maybe? It worked out fine for me.
~There is almost always a better, easier way to approach a problem.~

User avatar
Offworlder
Regular
Posts: 107
Joined: Mon Aug 20, 2018 6:33 pm
Contact:

Re: Prevent dialogue disappearing during sprite transition?

#6 Post by Offworlder » Sun Jan 06, 2019 10:38 pm

IrinaLazareva wrote:
Sun Jan 06, 2019 8:59 pm
Strange... It is work for me. Anyway,
Alex wrote:ATL transforms should be the answer.
viewtopic.php?f=8&t=14823#p193210 (there are other problem, but the same decision)
Using the suggested ATL transform does prevent dialogue from disappearing, but now there's a different issue. D:
Rather than just an expression change, the entire sprite disappears before the transition/transform begins, then fades back in.

It's possible I just don't understand how the transform works, but I've tried changing all the numbers and nothing seems to stop that from happening.
Last edited by Offworlder on Sun Jan 06, 2019 11:06 pm, edited 6 times in total.

User avatar
Offworlder
Regular
Posts: 107
Joined: Mon Aug 20, 2018 6:33 pm
Contact:

Re: Prevent dialogue disappearing during sprite transition?

#7 Post by Offworlder » Sun Jan 06, 2019 10:42 pm

lacticacid wrote:
Sun Jan 06, 2019 10:18 pm
Copy and paste the dialogue you had to after the transition with the {fast} tag after it, maybe? It worked out fine for me.
I'm not sure I understand your suggestion. I apologize for my confusion!

User avatar
IrinaLazareva
Veteran
Posts: 376
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: IKG
Location: St.Petersburg, Russia
Contact:

Re: Prevent dialogue disappearing during sprite transition?

#8 Post by IrinaLazareva » Mon Jan 07, 2019 5:53 am

Offworlder wrote:
Sun Jan 06, 2019 10:38 pm
It's possible I just don't understand how the transform works, but I've tried changing all the numbers and nothing seems to stop that from happening.
May be this will help to understand ATL viewtopic.php?f=51&t=16604

And then, here another interesting example
viewtopic.php?f=51&t=29064#p345408
There is a light at the end of the tunnel, just pray it's not a train.
___
TODO: unresolved/нерешённое

lacticacid
Regular
Posts: 36
Joined: Fri Nov 23, 2018 6:44 pm
Contact:

Re: Prevent dialogue disappearing during sprite transition?

#9 Post by lacticacid » Mon Jan 07, 2019 7:30 am

Offworlder wrote:
Sun Jan 06, 2019 10:42 pm
lacticacid wrote:
Sun Jan 06, 2019 10:18 pm
Copy and paste the dialogue you had to after the transition with the {fast} tag after it, maybe? It worked out fine for me.
I'm not sure I understand your suggestion. I apologize for my confusion!

Code: Select all

e "Example text."
hide eileen with dissolve
e "Example text.{fast}"
The {fast} tag makes the text before it appear instantly, so it would look like it never disappeared in the first place.
You could also to this

Code: Select all

e "Example text.{nw}"
hide eileen with dissolve
e "Example text.{fast} More text."
to make the transition appear to happen in the middle of the text. This should work, I think. I apologize if it doesn't.
~There is almost always a better, easier way to approach a problem.~

User avatar
Offworlder
Regular
Posts: 107
Joined: Mon Aug 20, 2018 6:33 pm
Contact:

Re: Prevent dialogue disappearing during sprite transition?

#10 Post by Offworlder » Mon Jan 07, 2019 8:41 am

lacticacid wrote:
Mon Jan 07, 2019 7:30 am

Code: Select all

e "Example text."
hide eileen with dissolve
e "Example text.{fast}"
The {fast} tag makes the text before it appear instantly, so it would look like it never disappeared in the first place.
You could also to this

Code: Select all

e "Example text.{nw}"
hide eileen with dissolve
e "Example text.{fast} More text."
to make the transition appear to happen in the middle of the text. This should work, I think. I apologize if it doesn't.
Unfortunately, using the "{fast}" tag instead of the "extend" tag doesn't prevent text from disappearing while the transition is happening. I still appreciate your help, even if it didn't quite work out!
I'm wanting to show a new sprite rather than hide one, by the way.

User avatar
Offworlder
Regular
Posts: 107
Joined: Mon Aug 20, 2018 6:33 pm
Contact:

Re: Prevent dialogue disappearing during sprite transition?

#11 Post by Offworlder » Mon Jan 07, 2019 8:53 am

IrinaLazareva wrote:
Mon Jan 07, 2019 5:53 am
Offworlder wrote:
Sun Jan 06, 2019 10:38 pm
It's possible I just don't understand how the transform works, but I've tried changing all the numbers and nothing seems to stop that from happening.
May be this will help to understand ATL viewtopic.php?f=51&t=16604

And then, here another interesting example
viewtopic.php?f=51&t=29064#p345408
These topics definitely look super useful, but the suggestions they give seem pretty specific and quite a bit more complicated than what I'm trying to do. D:
It's probably because I'm so inexperienced, but I can't figure out how to adapt their suggestions into a basic dissolve transition/expression change.

User avatar
mitoky
Veteran
Posts: 316
Joined: Sat Feb 07, 2015 9:12 pm
Projects: The Purring Demon's Love, circus eterie
Contact:

Re: Prevent dialogue disappearing during sprite transition?

#12 Post by mitoky » Mon Jan 07, 2019 10:41 am

Ok so it is a bit of a work around, but should work.
First, add a second seperate sprite of neth b2 and name it something diffrent so it does not replace the tag.
Example: If your case name the sprite neth2 or so.

Either way then add these 2 transforms:

Code: Select all

transform custom_hide:
    pause 0.5
    alpha 1.0
    linear 0.5 alpha 0.0

transform custom_show:
    alpha 0.0
    linear 0.5 alpha 1.0
In the script then do as following:

Code: Select all

show neth b1 with dissolve
n2 "{i}d{w=0.1}e{w=0.1}e{w=0.1}p{w=0.1}{nw} "
show neth b1 at custom_hide
show neth1 at custom_show, middle # or whatever the position is, simply change middle into what applies.
extend "b{w=0.1}r{w=0.1}e{w=0.1}a{w=0.1}t{w=0.1}h{/i}"
And the next time the expression changes do this:

Code: Select all

## b3 only example, add whatever expression should appear now.
show neth b3:
    alpha 1.0   
hide neth1    
with dissolve
Basically neth1 is a dummy. While neth1 shows, neth waits and then gets invisible. And later on when we change the expression again, we simply have neth become visible again with his new expression and dissolve "in" while neth1 hides while dissolving out. So swapping back seemlessly.

From what i tested, this works and there should be no transparent iimages etc. If there is anyhting wrong, let me know!

User avatar
Offworlder
Regular
Posts: 107
Joined: Mon Aug 20, 2018 6:33 pm
Contact:

Re: Prevent dialogue disappearing during sprite transition?

#13 Post by Offworlder » Mon Jan 07, 2019 11:11 am

mitoky wrote:
Mon Jan 07, 2019 10:41 am
From what i tested, this works and there should be no transparent iimages etc. If there is anyhting wrong, let me know!
I've thus far tried the first two codes, but I'm encountering the same issue I did with the other transform posted here. The text doesn't disappear (which is good), but the sprite does. Right at the start of the transition/transform, the entire sprite vanishes, then fades back in.

I would definitely appreciate if you have any suggestions for why this might be!

User avatar
IrinaLazareva
Veteran
Posts: 376
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: IKG
Location: St.Petersburg, Russia
Contact:

Re: Prevent dialogue disappearing during sprite transition?

#14 Post by IrinaLazareva » Mon Jan 07, 2019 11:26 am

Last try

Code: Select all

transform mydissolve(a=2):
    on show:
        alpha 0.0
        linear a alpha 1.0
    on hide:
        alpha 1.0
        linear a alpha 0.0
    on replaced:
        alpha 1.0
        linear a alpha 0.0
    on replace:
        alpha 0.0
        linear a alpha 1.0
        
label start:
    '?'
    show neth b1 at mydissolve(.5), center
    "{i}d{w=0.1}e{w=0.1}e{w=0.1}p{w=0.1}{nw} "
    show neth b2 at mydissolve(1)
    extend "b{w=0.1}r{w=0.1}e{w=0.1}a{w=0.1}t{w=0.1}h{/i}"
There is a light at the end of the tunnel, just pray it's not a train.
___
TODO: unresolved/нерешённое

User avatar
Offworlder
Regular
Posts: 107
Joined: Mon Aug 20, 2018 6:33 pm
Contact:

Re: Prevent dialogue disappearing during sprite transition?

#15 Post by Offworlder » Mon Jan 07, 2019 11:51 am

IrinaLazareva wrote:
Mon Jan 07, 2019 11:26 am
Last try
Still no luck, sadly. :(
With the first transition, the entire sprite disappears before fading back in. With the second transition, the entire sprite partially fades out, then fades back in.

Post Reply

Who is online

Users browsing this forum: Shirral