Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / How to get stepsounds?

Author
Message
Snowwolf
17
Years of Service
User Offline
Joined: 13th Feb 2007
Location: Las Pampas
Posted: 28th Jul 2007 23:09
How to get stepsounds? When the player or an NPC moves over a sort of material, so a sound will apppear?



Jane Doe
17
Years of Service
User Offline
Joined: 29th Jun 2007
Location:
Posted: 29th Jul 2007 07:10 Edited at: 29th Jul 2007 21:30
If you need to know which commands to use, check out the LOAD SOUND and PLAY SOUND commands.

There are a couple of ways you can do this. You can base it on time or distance. When your character starts moving, annotate the time or position. After it moves a certain time or distance, play the footstep sound and annotate the time or position again. Keep playing the sound at whatever time or distance interval you choose until the character stops moving.

Note that at differing rates of movement, the interval between footsteps will change. The footstep sound will be played more often if the character is running as opposed to walking.

Edit: Also, if you're going to have your camera bobbing up and down to simulate the walking or running movement, make sure it's syncronised with the footstep sound.

- Jane
Snowwolf
17
Years of Service
User Offline
Joined: 13th Feb 2007
Location: Las Pampas
Posted: 1st Aug 2007 17:11
Thanks..

but how to get it playing another sound on different undergrounds ( i want another sound playing on stone than on grass...)



Sasuke
18
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 1st Aug 2007 19:00 Edited at: 1st Aug 2007 19:00
You could give an object a meterial type like metal, stone and grass and when you collide with the object just change the sound thats playing with the meterial type.
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 1st Aug 2007 23:43
The best way would be to make a "sound image" that is basically a duplicate of the uv map for the object you're walking on. This image has a colour for every type of sound, and the colours are placed down accordingly. Eg; where grass is on the uv map, you might make that entire area green, whereas metal would be grey, and water would be blue. Then you'll need to convert your player's coordinates to UV coordinates on the sound image, grab the colour of the pixel the user is on on the uv map, and play the appropriate sound.

The easier method ofcourse being to have seperate objects for seperate materials, then just check which object the user is colliding with and play the appropriate sound.


Login to post a reply

Server time is: 2024-09-27 02:29:06
Your offset time is: 2024-09-27 02:29:06