Pushing object, check if can’t move.

I have objects you can push in my game. They make sound when you push them. My problem is, they still make a sound when they don’t move when you push them against a wall. I know I can make a convoluted variable maze to count the times it’s been pushed and to what direction, but it seems a lot of work for a very minor thing.

Anyone got some simple solution in mind? Is there an ”if then” solution to this?
you can use the control vasriable commands to get the current position and then calculate from direction where it is being pushed to.
then use get locastion info to check the target tile

there might be a script function that's easier still - however that would have to wait for an answer by someone who knows the internal javascript better.
Maybe share the event code if possible, and some solutions could be found.

I'd be interested to see it anyway- I have some draggable objects, and it's always fun to see the implementation of that, whether or not a plugin is being used!
There's a very straightforward solution to this using script calls. They can be used in a conditional branch, and will return a true value only if the pushable event can be moved in the desired direction, so you can place your sound command under that branch and it will only play when the object can move.
Maybe share the event code if possible, and some solutions could be found.
I’ll post a screencap when I’m back home.

There's a very straightforward solution to this using script calls
Unfortunately nothing with scripts is straightforward to me. Managed to do the whole game without ever using them.
This is the script you can put in your conditionals to check if the pushable event can move to a direction:

$gameMap.event(Id).canPass($gameMap.event(Id).x, $gameMap.event(Id).y, direction)

direction = 2 down, 6 right, 8 up, 4 left


EDIT:
So you make the events like:

If player is facing up
->If that script call with direction 8
->play SE + move the event up

etc

Original thread: https://forums.rpgmakerweb.com/threads/pushing-object-check-if-cant-move.160476/