Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: JRock on Fri 20/01/2006 02:31:31

Title: Walking sound effects??? (SOLVED)
Post by: JRock on Fri 20/01/2006 02:31:31
I created a walking animation (view) for my character and I have added
a footstep sound effect to the view.

What I wanted to know (if it's even possible) is if I can change that sound for
certain periods of time (i.e. when the character steps on something wet, then change it back to the default sound after the character leaves the wet area.)

I'm not sure how I would do that.....

If anybody could help me, that would be awesome!Ã,  Thanx!
Title: Re: Walking sound effects???
Post by: Gilbert on Fri 20/01/2006 02:35:29
Check out the SetFrameSound() function in the manual.

You may use regions, which change the sound when the character walks into a region, and change it back when he walks away from the region.
Title: Re: Walking sound effects???
Post by: JRock on Fri 20/01/2006 02:52:24
I tried it like this:

Player walks onto reigon:


SetFrameSound(1,0,3,3);
SetFrameSound(1,1,3,3);Ã, 
SetFrameSound(1,2,3,3);
SetFrameSound(1,3,3,3);


(1) being the view number, (0-3) being all of the loops in the walking view,
(3) being the frame number in each loop where the footstep sound plays,
and the last (3) being the sound to change to.

then, I did
Player walks off reigon:


SetFrameSound (1,0,3,1);Ã, 
SetFrameSound (1,1,3,1);
SetFrameSound (1,2,3,1);
SetFrameSound (1,3,3,1);


The first three columns being the same as above, but the last column changed
to (1), which is the original sound effect for the footstep.

But all of this did not work. When the character is on the area, it plays a combination of both sounds
(3) and (1), and after the character leaves the area, it plays sound (1) twice every frame instead of the usual once.

I know this may seem confusing, but any help would be awesome!!!

Thanks!!!
Title: Re: Walking sound effects???
Post by: ScottDoom on Fri 20/01/2006 05:03:46
You might need to only assign foot sounds to regions, and not the character view animation, although that could take a lot of work. You could also make sure the sound of normal walking somehow mutes when on regions.
Title: Re: Walking sound effects???
Post by: JRock on Fri 20/01/2006 05:30:05
oh boy.  that WOULD be a pain in the a$$! 

I guess that's an option that I might consider.  Until then,
anyone else have any ideas??
Title: Re: Walking sound effects???
Post by: strazer on Fri 20/01/2006 10:50:28
Please try my CharacterRegionSounds module (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=21795).
Title: Re: Walking sound effects???
Post by: Barbarian on Fri 20/01/2006 11:12:50
Yes, I've been using Strazer's wonderful CharacterRegionSounds module in my current project, and so far it seems to work great!  Takes a little getting used to (but then again, so does most things when it comes to programming in AGS), but once you get the hang of it, I think it's fairly easy to use.
Title: Re: Walking sound effects???
Post by: hedgefield on Fri 20/01/2006 14:49:17
Instead of 'player walks onto region', put that bit in 'while player stands on region'. Works for me.
Title: Re: Walking sound effects??? (SOLVED)
Post by: JRock on Fri 20/01/2006 15:26:28
Thanks Strazer!Ã,  Your module is working well for me!Ã,  Problem solved!
Title: Re: Walking sound effects??? (SOLVED)
Post by: strazer on Fri 20/01/2006 16:43:00
Glad to hear it. You're welcome. :)