Syncing into looped transform animation[solved]

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
SONTSE
Regular
Posts: 96
Joined: Sun Nov 24, 2013 10:49 pm
Completed: 11 VN's so far
Discord: jkx0282_10798
Contact:

Syncing into looped transform animation[solved]

#1 Post by SONTSE »

lets assume i have an image with some transform:

Code: Select all

transform some_transform:
    zoom 1
    ease 1 zoom 2
    ease 1 zoom 1
    repeat

show some_image at some_transform
and then, after some storytelling i want to add image another_image with same (or similar) transform
in such way, that both images performs their transforms as if they started at the same time.

i mean if i just show it

Code: Select all

"blah blah blah"
show another_image at some_transform
it will appear when key pressed, and start its transform just from the start, so images will perform unsynced and bounce one after another.

and currently i left this part that way:

Code: Select all

"blah blah blah"
hide some_image
show some_image, another_image at some_transform
it does make images to bounce simultaneously after key pressed, but due to some_image's transform reset, you will see a twitch, which is not very neat.

i hope i managed to explain my needs. Any suggests?
Thank you! :wink:
Last edited by SONTSE on Sun Jul 20, 2014 8:05 am, edited 1 time in total.

Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Syncing into looped transform animation

#2 Post by Asceai »

What if you try using the 'animation' timebase:

Code: Select all

transform some_transform:
    animation
    zoom 1
    ease 1 zoom 2
    ease 1 zoom 1
    repeat
.. showing something invisible with the another_image tag at the same time you show some_image:

Code: Select all

show some_image at some_transform
show expression '#0000' as another_image at some_transform
then replacing it with the real another_image later.

Code: Select all

show another_image
This is entirely untested, but in theory it should work.

User avatar
SONTSE
Regular
Posts: 96
Joined: Sun Nov 24, 2013 10:49 pm
Completed: 11 VN's so far
Discord: jkx0282_10798
Contact:

Re: Syncing into looped transform animation

#3 Post by SONTSE »

Well, it's interesting, but it works almost perfect Without this "animation" line

Code: Select all

transform some_transform:
#    animation
    zoom 1
    ease 1 zoom 2
    ease 1 zoom 1
    repeat
so in this edition Asceai's code works with some miniscule lag between some_image and another_image.
however if "animation" line is used - the lag is huge (and seems constant). maybe it works but need further modifying. what does it do anyway? it cannot easily find this in docs

Anyway, thank you once more, Asceai-sama. The issue is almost solved for now =3

Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Syncing into looped transform animation

#4 Post by Asceai »

I wouldn't think there would be any difference - both of them are created at the exact same interaction so they will share timebases. I can only assume the code is more complex than anything you've revealed and you've left something important out.

'animation' just means the animation timebase is used rather than the shown timebase, but I only included it to be safe - because the animation is never replaced the shown timebase shouldn't be reset anyway. So it is an optional line. One example where it could screw you up is if you've had one or both of those images around on the screen before showing it with the transform - then it will carry over the old timebase. So it may be better to remove the 'animation' line - I was just overthinking the problem.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Majestic-12 [Bot], Sugar_and_rice