Suggestion - Walking Sound

Started by am, Sun 24/08/2003 22:02:16

Previous topic - Next topic

am

How about the ability to define walking sounds?
It should be region-related (diffrent sound for walking on metal/wood/water/etc.)

Just a thought

Captain Mostly

I'm not sure how broadly this would get used, as sound files REALLY bulk out the size of a game... and there's probably more important things that could be implemented...

PLUS, you could probably do this with scripting, without TOO much trouble.

MrColossal

#2
this is SO easily done in scripting that i was super surprised

here we go:

put this in the main global script:
 int footsteptype;

and this in repeatedly execute:


// begin footsteps

footsteptype = GetRegionAt(character[EGO].x,character[EGO].y);
SetFrameSound(1,character[EGO].loop,3,footsteptype);
SetFrameSound(1,character[EGO].loop,6,footsteptype+1);

// end footsteps


that's it...

what happens is i have it so that it checks which region EGO is under and stores that number in footsteptype, then everytime frame 3 is displayed [which is the frame with the left foot touching the ground] it plays whatever sound is the same number as the current region

so if he's walking on region 3 it will play sound3

then when frame 6 comes up which is the OTHER foot hitting the ground, i have it play the sound with the current region's number PLUS 1. So now if we're walking on region 3, the sixth frame will play sound4

the only limit to this is that you have to make sure to use the odd numbered regions. only use 1 and 3 and 5 and 7 and so on, if you use 2 you'll get two different sounds being played

and make sure your sounds line up with the regions. you could even get rid of the whole checking each footstep and just play one sound file of two feet hitting but with a silence in between. but this way if you have the character speed up or slow down the footsteps still line up.

also, if you've already used sound files 1 - 15 or whatever, just add more numbers on the end. if sound 21 is your footstep sound then get the current region and add 20 to it

easy as pie

make sense?

eric loves when scripting works out
"This must be a good time to live in, since Eric bothers to stay here at all"-CJ also: ACHTUNG FRANZ!

am

I see what you mean, of course there should be a if there so the sound only plays when the character is actually moving but it can be done.
Thanks

MrColossal

there doesn't need to be, that was copy and pasted right outta my game

but i guess one wouldn't hurt
"This must be a good time to live in, since Eric bothers to stay here at all"-CJ also: ACHTUNG FRANZ!

SMF spam blocked by CleanTalk