MV Plugin that skips playing SE in a moveroute if "skip if can not move" is active & Event can't move

The usecase here would be your typical pushable statue, rock, whatever. By default you "could" simply do this:
1736982464263.png

And be fine, but many of you will know that if you keep pushing the thing against the wall, or any other place it can not move to, the SE will keep playing over and over as long as you hold the button.

Now of course you "could" also set up variables and conditional branches, but that seems like a lot of work for something so minor, and in my unknowing mind, making a plugin that includes skipping the SE seems like a quick thing to make for anyone skilled in js.

Alternatively, if I'm missing some incredibly easy way to accomplish this, feel free to let me know, otherwise I'll be thankful for a plugin!
You could do something like this in your move route
Code:
if(this.canPass(this.x,this.y, this._direction)){AudioManager.playSe({name: 'hammer', pan: 0, pitch: 100, volume: 100});}

Replace the sound effect filename and data with your own
Hmmm, doesn't that script use the direction of the event? Shouldn't it check if it can move in the direction the player is facing?
You could do something like this in your move route
Code:
if(this.canPass(this.x,this.y, this._direction)){AudioManager.playSe({name: 'hammer', pan: 0, pitch: 100, volume: 100});}

Replace the sound effect filename and data with your own
So with this, it seems like it'll only play the SE if I push it to the left. It will stop playing the SE if it can't move, but it seems like there's more needed. It'll also still spam the SE if I try to push it up/down.
1736984893273.png


Another thing I should probably mention is that I'm using region restriction to block the movement in places. Perhaps that is important, I wouldn't know.
Did you try instead of this._direction to use $gamePlayer._direction (or $gamePlayer.direction() I think they should be same)?
Did you try instead of this._direction to use $gamePlayer._direction (or $gamePlayer.direction() I think they should be same)?
That actually seems to work perfectly! I'll give it some more testing and report back, should anything arise, otherwise many thanks!
This thread is closed due to being reported as solved. If you need it reopened, report it to let us know. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/plugin-that-skips-playing-se-in-a-moveroute-if-skip-if-can-not-move-is-active-event-cant-move.174734/