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 / Walking Sounds

Author
Message
NeoHavic
21
Years of Service
User Offline
Joined: 4th Dec 2002
Location:
Posted: 5th Feb 2003 19:09
How do you do a walking sound loop when you walk? i have this:

If Upkey()=1 or Downkey()=1 or Leftkey()=1 or Rightkey()=1
Loop Sound 4
Else
Stop Sound 4
Endif

But when you walk it just goes "BBBBBBBBBB" and sounds like it is continuously restarting. thanks!
Hockey07
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: United States
Posted: 5th Feb 2003 23:35
Well, I know why. It is looping so it is playing over and over and over and over, and it is not going to just play the sound each step from that code.. Someone should be able to fix it for you, but all I know is why it only makes that noise.

AlamDV, NHL, NHL 2K3....... The best combination ever!
hexGEAR
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 5th Feb 2003 23:46
well, the method i use is:

do

sound = 0
if upkey() = 1 then sound = 1
goto sound_ctrl

sync
loop

sound_ctrl



return

your birth was a blessing, sent to live and die on earth as a lesson, we each have a star all you have to do is find it, once you do, everyone who sees it will be blinded - DMX
hexGEAR
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 5th Feb 2003 23:49
sorry about that, the gosub sound_ctrl would contain:

sound_ctrl

if sound<>old_sound
if sound = 0 then stop sound 4
if sound = 1 then loop sound 4
old_sound = sound
endif

return

that should work with some tweaking, this mthd can aslo be use for animations

your birth was a blessing, sent to live and die on earth as a lesson, we each have a star all you have to do is find it, once you do, everyone who sees it will be blinded - DMX
Dr DooMer
21
Years of Service
User Offline
Joined: 22nd Dec 2002
Location: United Kingdom
Posted: 6th Feb 2003 01:21
Well, I would use a counter to add a delay between each footstep. If the counter is zero, play the sound and put the counter up to some fixed value (smaller value if running, or something like that). Here's pseudo-code, which assumes the character is moving:

if counter = 0 then play sound and set counter to 20,
if counter > 0 then subtract one from counter.

This will repeat the footstep sound every twenty frames. This should be about right for a light jog on a game running at 30fps; however, you'll probably need to tweak it to get the best result. Does this help?

"I am a living, thinking entity who was created in the sea of information."
Hockey07
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: United States
Posted: 6th Feb 2003 02:17
ACtually I KNOW I THINK!!!!

Ya know when you are coding yourself to move in it? Well if your game is first-person then when you are coding you will be doing things about if the mousebutton()=1 then move the camera a little bit and stuff.. So you should just somehow code that for each certain distance the camera moves, play the sound.. I think that may work if there is a way to accomplish it.

AlamDV, NHL, NHL 2K3....... The best combination ever!
CarlTaylor
21
Years of Service
User Offline
Joined: 13th Jan 2003
Location: United States
Posted: 6th Feb 2003 07:56
but if you just based it off distance, you wouldnt have the timing right for running and walking, plus if youre going to incorporate jumping then itll be even more off. Dr Doo's idea sounds good.

baseball = life
Chenak
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 6th Feb 2003 18:06
i think this may solve ur probs.

if sound playing(1)=0 then loop sound 1

cheers

Once you start down the Dark Path, forever will it dominate your destiny...
koolaid
21
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Cyberspace
Posted: 8th Feb 2003 07:03
i have a similar problem my objetc has animation and a sound of it walking but the sound is playing to fast and does correspond with the actual footsteps,no anything anyone post it in topic "couple of problems" in forum dark basic discussion

Login to post a reply

Server time is: 2024-09-19 03:04:14
Your offset time is: 2024-09-19 03:04:14