(Solved) Repeat only part of an ATL Transform?

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
SypherZent
Veteran
Posts: 331
Joined: Fri Sep 02, 2016 3:14 am
Completed: Multiverse Heroes, Space Hamster in Turmoil
Soundcloud: Chrysopoeist
Location: Puerto Rico
Contact:

(Solved) Repeat only part of an ATL Transform?

#1 Post by SypherZent » Fri Jul 24, 2020 7:03 pm

How can I repeat only a portion of an ATL transform?

For example:

Code: Select all

image animated_image:
    "image_frame_1"
    pause 0.5
    "image_frame_2"
    pause 0.5
    "image_frame_3"
    pause 0.5
^ I want the above animated image to only repeat frames 2 and 3, not frame 1.

Do I need to use parallel? I feel like this should be easy, I just can't think of how to do it off the top of my head.

I'll have some more time to test it later, but figured I'd ask in case anyone can help, since I'm a bit loaded with work right now.

Thanks.
Last edited by SypherZent on Fri Jul 24, 2020 7:38 pm, edited 1 time in total.

User avatar
Andredron
Miko-Class Veteran
Posts: 535
Joined: Thu Dec 28, 2017 2:37 pm
Completed: Kimi ga nozomu renpy-port(demo), Albatross Koukairoku(demo)
Projects: Sisters ~Natsu no Saigo no Hi~(renpy-port)
Location: Russia
Contact:

Re: Repeat only part of an ATL Transform?

#2 Post by Andredron » Fri Jul 24, 2020 7:13 pm

Code: Select all

show logo base:
    xalign 0.0 yalign 0.0
    block:
        linear 1.0 xalign 1.0
        linear 1.0 xalign 0.0
        repeat
    time 11.5
    linear .5 xalign 1.0
    

label start:

Code: Select all

show magic:
        yalign .5 subpixel True
        parallel:
            xalign .5
            linear 3.0 xalign .75
            linear 6.0 xalign .25
            linear 3.0 xalign .5
            repeat
        parallel:
            alpha 1.0 zoom 1.0
            linear .75 alpha .5 zoom .9
            linear .75 alpha 1.0 zoom 1.0
            repeat
        parallel:
            rotate 0
            linear 5 rotate 360
            repeat
            
Last edited by Andredron on Fri Jul 24, 2020 7:23 pm, edited 2 times in total.
I'm writing a Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18

Help me to register in QQ International

Honest Critique

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Repeat only part of an ATL Transform?

#3 Post by Remix » Fri Jul 24, 2020 7:20 pm

block

Code: Select all

image animated_image:
    "image_frame_1"
    pause 0.5
    block:
        "image_frame_2"
        pause 0.5
        "image_frame_3"
        pause 0.5
        repeat # just repeat the block
Frameworks & Scriptlets:

User avatar
SypherZent
Veteran
Posts: 331
Joined: Fri Sep 02, 2016 3:14 am
Completed: Multiverse Heroes, Space Hamster in Turmoil
Soundcloud: Chrysopoeist
Location: Puerto Rico
Contact:

Re: Repeat only part of an ATL Transform?

#4 Post by SypherZent » Fri Jul 24, 2020 7:38 pm

Hey, awesome, thank you! Really appreciate it.
The parallel method works nicely.

Any benefit to using block VS parallel?
Though, honestly, it runs smooth as a hot knife through butter with parallel.
I don't think optimization would even be visually noticeable.
May help for easier writing of the code to use block in the long run, though.

In any case, thank you for the help! Good to know that more than one way is possible. ^^

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]