Page 1 of 1

ATL animation + sound effect question (solved)

Posted: Mon Jul 11, 2016 8:05 am
by Modzso
Hi!
First of all I'm out of ideas how to solve this so I have a question - my guess is the answer is very simple again -
So here is a basic animation:

Code: Select all

image anim:
        "images/anim/a1.png"
        pause 0.7
        "images/anim/a2.png" 
        pause 0.7
        "images/anim/a3.png" 
        pause 0.7
        "images/anim/a4.png"
        pause 0.7
This works fine.
I would like to add sound effect to every time the pictures changes, so what and where I have to add?

Code: Select all

        "images/anim/a1.png"
        play sound “effect.ogg”
        pause 0.7

        "images/anim/a2.png"
        play sound “effect.ogg”
        pause 0.7
this doesn't works, because it says: "Line is indented, but the preceding ATL statement does not expect a block. Please check this line's indentation.
play sound “effect.ogg”"

Any idea what to do? I read the tutorial for effects and ATL but I cant put this together. Or it is not possible?

Re: ATL animation + sound effect question

Posted: Mon Jul 11, 2016 10:30 am
by DragoonHP
You can't do that. You will have to manually add sound effects in the script, like

Code: Select all

show anim
play sound "effect.off"

Re: ATL animation + sound effect question

Posted: Tue Jul 12, 2016 12:56 am
by Modzso
Thank you the answer, so I have to replan my plans then. :D

Re: ATL animation + sound effect question (solved)

Posted: Tue Jul 12, 2016 12:37 pm
by Zateinik
try to use the function for this

Code: Select all

init -1 python:
    def play_effect(trans, st, at):
        renpy.play("effect.ogg", channel="sound")


image anim:
    "images/anim/a1.png"
    function play_effect
    0.7
    "images/anim/a2.png"
    function play_effect
    0.7
    "images/anim/a3.png"
    function play_effect
    0.7
   

Re: ATL animation + sound effect question (solved)

Posted: Wed Jul 13, 2016 1:45 am
by Modzso
Thank you!
I solved it another old way, but that works too! :)

Re: ATL animation + sound effect question (solved)

Posted: Thu May 20, 2021 7:35 am
by staffofmagic
Modzso wrote:
Wed Jul 13, 2016 1:45 am
Thank you!
I solved it another old way, but that works too! :)
Hi, I was wondering if you could share what you did? I am looking to do the same thing. Thanks