Footstep Sound Problems

I wanted to make my own footsteps sounds without a plugin so I could have full control over the timing of the sounds myself. Everything is fine except for 2 things. I don't know how to adjust the sounds when an NPC is walking faster and I noticed the sounds only match the tile ID the player is on. For example if an NPC is on grass and the player is in water, the water sound will play for the NPC even though it should be playing grass. The player is given priority over the NPC when the sounds shouldn't match up like that. Also, I am using Region IDs. I don't know how to use Terrain Tags. What can be done to solve the issue? Is there a script that will check to see if the NPC is on a certain tile separately? I think that could help perhaps.


Player Footstep Instructions:

Player Footsteps 1.PNG
Player Footsteps 2.PNG


NPC Footstep Instructions:

NPC Foosteps 1.PNG
Because you're using the same Region ID variable in both events.

When you have multiple parallel events running at the same time, they weave into each other, alternating lines. So one event writes to the Region ID variable then the other event reads it.

Just give Eliot his own Region ID variable.
Because you're using the same Region ID variable in both events.

When you have multiple parallel events running at the same time, they weave into each other, alternating lines. So one event writes to the Region ID variable then the other event reads it.

Just give Eliot his own Region ID variable.
Thank you I will try this out. What about changing the speed of footstep sounds when the event is running. Already know how to do this for the player, but what about NPCs? Obviously it would work differently. Thankfully if I can't figure this out I'll just give them a general speed (like about 15 wait frames). Not the perfect solution since it won't be exact timing, but it should work for now. Also feel free to let me know about any useful scripts I could use as well. For example, things I could use in conditional branches that I don't have already.

Also the script $gamePlayer.isMoving() does not deactivate when the script $gamePlayer.isDashing() is used. This seems to be true when I use an else branch as well. This causes an overlap of sounds for both walking and dashing. Since I have separate sounds for dashing this sounds very strange. Any solutions?
You've defined 18 frames as how frequently the sound is played. If you want it to play more quickly, then you would shorten that wait to, say, 6 frames, and instead of the script call for isMoving(), you'd compare the event's X/Y coordinates to what they were the last time the event ran to see if it's changed.
You've defined 18 frames as how frequently the sound is played. If you want it to play more quickly, then you would shorten that wait to, say, 6 frames, and instead of the script call for isMoving(), you'd compare the event's X/Y coordinates to what they were the last time the event ran to see if it's changed.
Thanks for your advice but what do you mean by not using the isMoving() script? How exactly does one compare the event's X/Y coordinates in the way you described?

Sorry to repeat myself but just edited this in (note this is for the player character): Also the script $gamePlayer.isMoving() does not deactivate when the script $gamePlayer.isDashing() is used. This seems to be true when I use an else branch as well. This causes an overlap of sounds for both walking and dashing. Since I have separate sounds for dashing this sounds very strange. Any solutions?

Update: The NPC's footsteps are perfect and speed up and slow down appropriately no matter how much I change the speed or frequency. I didn't know how to apply your advice but they seem perfect anyway unless I find some other problem. Thank you for your help so far!
Thanks for your advice but what do you mean by not using the isMoving() script? How exactly does one compare the event's X/Y coordinates in the way you described?
1724173088960.png
Is this in regards to the player character or NPC? I am actually happy with how the NPC is now but if you think this can be used to solve the player character's sound overlap problem I explained earlier feel free to explain. I will also experiment with the NPC just to see what it does. I am assuming you will also need to do this with Y.

Something like:
If New X is not equal to Old X
and if new Y is not equal to Old Y then... etc...

Will try and figure the rest out but feel free to explain further if you want.
Wherever you want. Like I said, I would not use the isMoving() script call at all, personally. That's going to repeat the sounds based on the wait time you've entered at the bottom of the event, and have nothing to do with whether or not they've actually gone into a new space.
Wherever you want. Like I said, I would not use the isMoving() script call at all, personally. That's going to repeat the sounds based on the wait time you've entered at the bottom of the event, and have nothing to do with whether or not they've actually gone into a new space.
NPC Footsteps.PNG

This is an example of what I think you want me to do. I used this in a test Common Event and the NPC just repeated footsteps extremely fast and even when I added wait frames, the footsteps sounds were overlapping and it sounded very grating. Obviously I'm doing something wrong but at least I know this alternate method produces a sound and responds to ID changes appropriately. If I cannot figure this out I will just use my other method.
You're not actually setting the New NPC X and New NPC Y anyplace. So as far as that logic can tell, the X and Y will never match which means it's always moving.

The other logic in error is you have the two conditional branches nested, so it will only all go off if both the X and the Y have changed. But that's only true for diagonal movement. Almost 100% of the actual time you'll only have moved on one of those axes, so you'd need two separate conditionals for X and Y with the same events in each (or jumping to a label with them.

A wait of 20 frames is also really long, it doesn't take that long to move between tiles. (also, what's the point of the random number and conditional thing? It looks like you're playing the same sound effect both times)

Here's an example of what you could do - again, there are also plugins to automate all of this, etc.

1724202814085.png
You're not actually setting the New NPC X and New NPC Y anyplace. So as far as that logic can tell, the X and Y will never match which means it's always moving.

The other logic in error is you have the two conditional branches nested, so it will only all go off if both the X and the Y have changed. But that's only true for diagonal movement. Almost 100% of the actual time you'll only have moved on one of those axes, so you'd need two separate conditionals for X and Y with the same events in each (or jumping to a label with them.

A wait of 20 frames is also really long, it doesn't take that long to move between tiles. (also, what's the point of the random number and conditional thing? It looks like you're playing the same sound effect both times)

Here's an example of what you could do - again, there are also plugins to automate all of this, etc.

View attachment 315293
It works but I have no idea how to swap between IDs (grass is 1, water is 2, dark grass is 3). The method I used does not work for your alternate way, as the sounds constantly play. I'm sorry you've had to basically guide me through every step but I think I've perfected my other method at this point so it's no big deal if I'm not able to figure it out.
Region ID.PNG
If what you have works, there's no need to entirely rewrite it.

It works but I have no idea how to swap between IDs (grass is 1, water is 2, dark grass is 3).
It's right here.

1724248385252.png
If what you have works, there's no need to entirely rewrite it.


It's right here.

View attachment 315334
Footsteps NPC.PNG


Footsteps NPC 2.PNG


Footstep Sounds 3.PNG

I don't want to waste your time so here's everything. Your changes fixed the sound issue, but the sounds will not swap between regions. It is silent everywhere else except for grass (ID 1).
I think you need to try going through the lines and, like, saying out loud to yourself what the instruction (or conditional question) is doing. A lot of what you added makes no logical sense.

It's like you're pasting the entire event in again at the bottom instead of just the logic that says "Okay, the region ID was not 1, so is it 2? Is it 3?"

I don't understand any reason to have more waits or assigning variables or getting location info or jumping to labels again...you've already done all of that.
I think you need to try going through the lines and, like, saying out loud to yourself what the instruction (or conditional question) is doing. A lot of what you added makes no logical sense.

It's like you're pasting the entire event in again at the bottom instead of just the logic that says "Okay, the region ID was not 1, so is it 2? Is it 3?"
Yes that makes sense. Sometimes it's best to go through things and take your time. However, I have solved the problems with my other solution. Remember when I said the player character had an overlap of dashing sounds and regular walking sounds? By using a label and jump to label command in the right places, I can now ignore the moving code when I'm dashing, which solves the issue. Only one sound plays when I'm moving and or dashing respectively. So now my choices are, perfect your more efficient method, or go with the less 'optimal' one which works just fine in my case. As an experiment, I will attempt to perfect your approach. Since this has gone on long enough, I think my issue has been solved. Thank you for your help and patience!

Original thread: https://forums.rpgmakerweb.com/threads/footstep-sound-problems.171166/