Walking sound effects??? (SOLVED)

Started by JRock, Fri 20/01/2006 02:31:31

Previous topic - Next topic

JRock

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!

Gilbert

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.

JRock

#2
I tried it like this:

Player walks onto reigon:

Code: ags

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:

Code: ags

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!!!

ScottDoom

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.

JRock

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??


Barbarian

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.
Conan: "To crush your enemies, see them driven before you, and to hear the lamentation of the women!"
Mongol General: "That is good."

Blade of Rage: www.BladeOfRage.com

hedgefield

Instead of 'player walks onto region', put that bit in 'while player stands on region'. Works for me.

JRock

Thanks Strazer!Ã,  Your module is working well for me!Ã,  Problem solved!

strazer


SMF spam blocked by CleanTalk