Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Play sound when walking?
ZortaEnzane Offline
Junior Member

Posts: 26
Threads: 2
Joined: Jun 2011
Reputation: 0
#1
Play sound when walking?

Is it possible to make a specific sound to play whenever the player takes a step? (other than the footstep sound of course, and I don't this sound to replace the footsteps either if that's at all possible)

To be more precise, say I wanted it to sound like there are chains dragging along with you... how would I do that?

I am a voice actress, here is my portfolio so far: http://soundcloud.com/zorta-enzane
06-14-2011, 12:24 AM
Find
Nye Offline
Senior Member

Posts: 250
Threads: 8
Joined: Jan 2011
Reputation: 2
#2
RE: Play sound when walking?

(06-14-2011, 12:24 AM)ZortaEnzane Wrote: Is it possible to make a specific sound to play whenever the player takes a step? (other than the footstep sound of course, and I don't this sound to replace the footsteps either if that's at all possible)

To be more precise, say I wanted it to sound like there are chains dragging along with you... how would I do that?

Besides doing some sort of full-conversion; I can think of some vague idea. I suppose you could create several columned areas across the map, eg. 30 script areas in columned strips. Each time the player collides with a strip, you play the guisound of a chain rattle? You would need lots of different chain rattle sounds to avoid it getting annoying, and you would need to create a timer on each chain rattle, which prevents the rattles from stacking, ie. using local variables to allow only one rattle every 5 seconds max.

At least, that's how I would do it.

|
|__ If you need any help with this, PM me or add my MSN (joenye@hotmail.co.uk)

EDIT: Your voice acting portfolio is really good! I would love for you to record a few lines for my next custom story, if that is okay (not needed for a few weeks yet) Big Grin

(This post was last modified: 06-14-2011, 01:01 AM by Nye.)
06-14-2011, 12:53 AM
Find
xiphirx Offline
Senior Member

Posts: 662
Threads: 16
Joined: Nov 2010
Reputation: 5
#3
RE: Play sound when walking?

This is quite easy to do with scripting. First, you need the sound effects, I suppose you already have them.

In OnEnter
AddTimer("tmrChainRattle", 0.1f, "ChainRattle");

Then this function
void ChainRattle(string &in asTimer)
{
    if (GetPlayerSpeed() > 0.0f)
    {
        PlaySoundAtEntity(SOUNDNAME, SOUNDFILE, 'Player', 0.0f, false);
        AddTimer('tmrChainRattle', GetPlayerSpeed(), 'ChainRattle');
    }
    else
    {
        AddTimer('tmrChainRattle', 0.1f, 'ChainRattle');
    }
}

What this does is continually check whether the player is moving, if the player is moving, then play the chain rattle sound, and set a timer off that will continue to play the sound in-sync with the stepping sounds.

NOTE: It may be out of sync right now, you will have to mess with the timings. Also, for the different states of walking or running, you can do a if block to target specific player speeds. Use debug messages to see how fast the player moves Smile

06-14-2011, 01:28 AM
Find
Nye Offline
Senior Member

Posts: 250
Threads: 8
Joined: Jan 2011
Reputation: 2
#4
RE: Play sound when walking?

^ I didn't think of using getplayerspeed, that's a better way of doing this I think Smile

06-14-2011, 01:32 AM
Find




Users browsing this thread: 1 Guest(s)