Preventing Sound Effect on 'Pokemon' Boulder

Hey guys I just designed a little pokemon boulder for my game (I dont know what the official name of this is called), basically a boulder when you walk into it, it moves in that direction 1 space. I have a pic below of the event page, but I was wondering if you could think of a way of preventing the sound effect of the boulder moving... well, if it doesnt move. So as you can see, if a player has the Boulder against a blocked way to its left and the player moves into the building pushing it to its left, the boulder wont move but it still will make the sound effect as if it did. Any solutions?

dlrx2s.png
ok, I got this! there's probs a less convoluted way to do this, but I feel like conceptually it's pretty simple. the trick is keeping track of the X and Y positions of the boulder, so you can compare them after the move. 

SM6YkzO.png


so for you to change yours, a few steps:

1) remove the SE calls from your move routes

2) set up X and Y variables for your boulder at the start of your event (after strength = yes) (also: make sure to keep an eye on the index of your event! mine was 8, in your post your event is 38, so you'll want to use $game_map.events[38]

3) at the very end of your event, after the end of the move routes, set up NewX and NewY variables

4) compare them! if X != NewX or Y != NewY, play the sound 🙂

(also: oops, I forgot to remove the text box! that was just me making sure the variables were being set correctly. you won't need it, haha)
genius 🙂 I thought this question was going to be lost

much appreciated!
no probs! it was fun to solve 🙂
Does that work? It seems as if the boulder would move first and THEN the SE would play - a delayed sound.


What if you just put the SE after the move, and check the Skip if Cannot Move box?


In addition, you don't have to check which direction the player is facing and tell it to move in the appropriate direction. You can do it all in a single action without ANY conditions, by using the Move Away from Player move route command.
Shaz, how could that work? It will simply skip the move if there cannot be a move and then play the SE after
No - Skip means skip the rest of the move route, not just that one movement. The "skip if cannot move" is on the move route, not the Move [in direction] command.
I just tested it, it only skips the one movement.

Edit: Since I'm so new, I'm going to assume I am wrong somehow 🙂 FYI
Yeah, you're right. Sorry. I thought it skipped the whole move route.

Original thread: https://forums.rpgmakerweb.com/threads/preventing-sound-effect-on-pokemon-boulder.23979/