Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Paul Franzen on Wed 27/03/2013 20:45:07

Title: SOLVED: Playing sounds during animations?
Post by: Paul Franzen on Wed 27/03/2013 20:45:07
I'm tearing my hair out here. From what I understand, having a sound play during an animation is pretty straightforward; you just have to:

1) Go to the animation's view, and
2) Set the "Sound" parameter to the sound effect in question.

That's it. So...WHY WON'T IT WORK?! Does it have to be a specific type of file? Does it require some extra coding when I run the animation? I've tried this with two animations, two different sound effects...no go. Help me, AGS forums!
Title: Re: Playing sounds during animations?
Post by: Khris on Wed 27/03/2013 21:11:35
Can you play the sounds by calling NameOfSound.Play(); ?
Title: Re: Playing sounds during animations?
Post by: Paul Franzen on Wed 27/03/2013 22:10:59
I can! I can play the sounds fine in the code itself, but trying to attach a specific sound to a specific frame doesn't do anything.
Title: Re: Playing sounds during animations?
Post by: Paul Franzen on Wed 27/03/2013 22:56:56
So...it just started randomly playing now. I don't know why, but I'll take it!
Title: Re: Playing sounds during animations?
Post by: Crimson Wizard on Thu 28/03/2013 00:05:41
I am wondering, may that be related to scaling? There's an option to change frame sound volume with character scaling... I also heard it does not work properly in AGS 3.2, but never tried myself.
Title: Re: Playing sounds during animations?
Post by: Slasher on Thu 28/03/2013 05:49:30
Scripting sound volume with character scaling does work if the scaling length area is quite long.

A scaling of say 120 to 5 with quite a bit of distance like walking up a long road does work, I have tried it and it is ok..

However, scaling 100 to 70 with not a long distance is not so prominent.

There does appear to be a small issue regarding this with AGS 3.2 but I am sure it is negotiable in most cases.

Most newbees do not know about adding:

Code (AGS) Select
chero.ScaleVolume=true;

No doubt this issue will be approached and better implemented in later AGS vesrsion.





Title: Re: SOLVED: Playing sounds during animations?
Post by: Paul Franzen on Sun 31/03/2013 15:40:33
Yeah, it was just me being dumb. Figured it out--there was nothing wrong with the file or the coding; I was just loading a save file instead of starting a new game, and the save file was made before I added in the sound effects.