Animations repeat on hide

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
Ultra_HR
Regular
Posts: 39
Joined: Tue Dec 02, 2014 4:50 pm
Completed: Surkea, Arcadia, Cerulean
Projects: Missing Stars
Organization: Somnova Studios
IRC Nick: Ultra_HR
Contact:

Animations repeat on hide

#1 Post by Ultra_HR »

Hi all,

Yet another question with a most likely simple answer but I'm too stupid to work it out myself.

So, I have a transform set up like this:

Code: Select all

transform slideinhl:
    on show:
        alpha 0.0 xalign 0.0
        easein 0.5 alpha 1.0 xalign 0.25
    on hide:
        easein 0.5 alpha 0.0 xalign 0.0
and it's used in the script like this:

Code: Select all

show m grin at slideinhl

m grin open "What were you hangin' around for? Can't be that -"
show m confused open
extend " Oh..."
show m confused

"Mitchell pauses in his tracks, with much the same expression as I must have had as he stares up at the towering forest."

hide m
But that comes out like this: https://youtu.be/XlKat4pLpbU

Something that does fix this problem is having "at slideinhl" after every show - but then if you click through the dialogue before the first on show is completed, the animation is repeated.

I'm certain I'm doing something stupid, but I don't know what it is. Any help?

Thanks.
I'm the writing lead for Somnova Studios and the Annaliese route writer for Missing Stars. You can play Act 1 now. I also co-wrote Arcadia and did programming for Cerulean.

philat
Eileen-Class Veteran
Posts: 1912
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Animations repeat on hide

#2 Post by philat »

This seems like an issue with the image being replaced with tags. That said, I can't think of any particularly nice way to deal with this other than to simply bifurcate the process -- which isn't ideal, but hopefully not too much of a burden.

If anyone else has a better idea, by all means.

Code: Select all


transform slideinhl:
    alpha 0.0 xalign 0.0
    easein 0.5 alpha 1.0 xalign 0.25
transform slideouthl:    
    easein 0.5 alpha 0.0 xalign 0.0

## 

show m grin at slideinhl

m grin open "What were you hangin' around for? Can't be that -"
show m confused open
extend " Oh..."
show m confused

"Mitchell pauses in his tracks, with much the same expression as I must have had as he stares up at the towering forest."

show m at slideouthl # instead of hide, show with the slideout transform

"blah blah"

hide m # not hiding images can affect performance if there are a lot of them, but you have to wait for the slide out to finish -- otherwise, it will hide instantaneously.

User avatar
Ultra_HR
Regular
Posts: 39
Joined: Tue Dec 02, 2014 4:50 pm
Completed: Surkea, Arcadia, Cerulean
Projects: Missing Stars
Organization: Somnova Studios
IRC Nick: Ultra_HR
Contact:

Re: Animations repeat on hide

#3 Post by Ultra_HR »

philat wrote:This seems like an issue with the image being replaced with tags. That said, I can't think of any particularly nice way to deal with this other than to simply bifurcate the process -- which isn't ideal, but hopefully not too much of a burden.
Mmhmm, this is the solution I've ended up using. Not the most elegant, but that'll probably have to do it. Thanks for your help!
I'm the writing lead for Somnova Studios and the Annaliese route writer for Missing Stars. You can play Act 1 now. I also co-wrote Arcadia and did programming for Cerulean.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Toma