ATL animation + sound effect question (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
Modzso
Newbie
Posts: 24
Joined: Fri Jun 24, 2016 5:38 am
Projects: Ghosts of Fablees - Chapter 1.
Tumblr: captainmodzso
Deviantart: nephle
Contact:

ATL animation + sound effect question (solved)

#1 Post 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?
Last edited by Modzso on Tue Jul 12, 2016 12:57 am, edited 1 time in total.

DragoonHP
Miko-Class Veteran
Posts: 758
Joined: Tue Jun 22, 2010 12:54 am
Completed: Christmas
IRC Nick: DragoonHP
Location: Zion Island, Solario
Contact:

Re: ATL animation + sound effect question

#2 Post 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"

User avatar
Modzso
Newbie
Posts: 24
Joined: Fri Jun 24, 2016 5:38 am
Projects: Ghosts of Fablees - Chapter 1.
Tumblr: captainmodzso
Deviantart: nephle
Contact:

Re: ATL animation + sound effect question

#3 Post by Modzso »

Thank you the answer, so I have to replan my plans then. :D

Zateinik
Newbie
Posts: 5
Joined: Tue Oct 27, 2015 2:24 am
Projects: Porting MGQ
Location: Uralmash Yekaterinburg
Contact:

Re: ATL animation + sound effect question (solved)

#4 Post 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
   

User avatar
Modzso
Newbie
Posts: 24
Joined: Fri Jun 24, 2016 5:38 am
Projects: Ghosts of Fablees - Chapter 1.
Tumblr: captainmodzso
Deviantart: nephle
Contact:

Re: ATL animation + sound effect question (solved)

#5 Post by Modzso »

Thank you!
I solved it another old way, but that works too! :)

staffofmagic
Newbie
Posts: 11
Joined: Fri Sep 20, 2019 3:07 pm
Contact:

Re: ATL animation + sound effect question (solved)

#6 Post 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

Post Reply

Who is online

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