Jump to content
Sign in to follow this  
Galv

Pushing a Boulder with sound and 'can't push' message

Recommended Posts

So, I created a boulder that I could push around - just an event that when the user interacted with it, it would take a step away from the player and would skip the movement if it couldn't move.

I wanted a sound effect to go with this, but the sound effect would play even if the boulder could not be pushed (Which was silly in game).

 

My Solution:

I created the following Common Event (so it can be used for interacting with any boulder event).

 

 

push-boulder.jpg

 

 

Explanation of my common event in steps:

1. Store the current location (x and y) of the boulder you are pushing into variables.

2. Move the boulder event away from player as normal ("wait" must be off and "skip" on)

3. Wait:1 frame (this is important else the event won't grab the next location variables after the boulder has moved)

4. Store the boulder's location after the attempt to push it.

5. Conditional branch - If boulder's location x or y didn't move after the attempt to push it... display the "Can't push it" message and exit event processing (so the sound will not play).

6. If the boulder's location changed after the attempt to push it - THEN we can play the sound effect. (I also have a wait on the player so he can't chase the boulder and try to attempt to push it during it's movement).

 

The "Label: Can Move" isn't actually necessary and I didn't mean to leave it in there for the screenshot.

 

The Boulder Event:

Basically a normal event that calls your above common event on player pressing the action button. I set the speed to "2: x4 slower".

 

 

This is the solution that I came up with - if anyone else has done something different, I'm definitely interested.

Share this post


Link to post
Share on other sites

This is nice. Audio when the event can't move always bugs me, but it's fiddly trying to fix it.

 

You could probably do something similar inside the move route, using the script command, but it wouldn't be pretty.

Share this post


Link to post
Share on other sites

So, I created a boulder that I could push around - just an event that when the user interacted with it, it would take a step away from the player and would skip the movement if it couldn't move.

I wanted a sound effect to go with this, but the sound effect would play even if the boulder could not be pushed (Which was silly in game).

 

My Solution:

I created the following Common Event (so it can be used for interacting with any boulder event).

 

 

push-boulder.jpg

 

 

Explanation of my common event in steps:

1. Store the current location (x and y) of the boulder you are pushing into variables.

2. Move the boulder event away from player as normal ("wait" must be off and "skip" on)

3. Wait:1 frame (this is important else the event won't grab the next location variables after the boulder has moved)

4. Store the boulder's location after the attempt to push it.

5. Conditional branch - If boulder's location x or y didn't move after the attempt to push it... display the "Can't push it" message and exit event processing (so the sound will not play).

6. If the boulder's location changed after the attempt to push it - THEN we can play the sound effect. (I also have a wait on the player so he can't chase the boulder and try to attempt to push it during it's movement).

 

The "Label: Can Move" isn't actually necessary and I didn't mean to leave it in there for the screenshot.

 

The Boulder Event:

Basically a normal event that calls your above common event on player pressing the action button. I set the speed to "2: x4 slower".

 

 

This is the solution that I came up with - if anyone else has done something different, I'm definitely interested.

I was just making a boulder puzzle and got stuck with the repeating SE when the boulder cant move, but this solved it thanks!

I also tweaked it a little bit so that the boulder can roll normal speed and the sound effect matches up with its movement from the start, I'd post pics of my tweaks but I cant post images for some odd reason in this topic :\

Share this post


Link to post
Share on other sites

Holy necropost, Batman. Seriously, dude, this thread was literally more than a year old. Look at the date of the last post before posting.

So? most tutorials I read are quite old, and the OP did say "if anyone else has done something different, I'm definitely interested."

So I posted something different, nothing wrong with adding new info is there? if it improves a feature/tut.

 

If I asked about fixing a boulder issue Id most likely be linked to this tut, if I wanna ask a question about the tut then what?, just talk back and forth between my new thread and this old one? smh

Edited by glenjj

Share this post


Link to post
Share on other sites

I technically have agree with you on that one. I realize I'm the one who posted off topic. Sorry.

 

It's ok, I just wanted to thank the OP and add some new input if they were curious on my tweaks.

Share this post


Link to post
Share on other sites

Yes, please don't post off topic - both of you. If you have concerns about a post please use the report function.

For further information on necroposting this forum section, please read the tutorial section rules:

http://www.rpgmakervxace.net/topic/10818-tutorials-rmvx-ace-rules/

You can necropost only if you have something detailed on topic to add.

 

I'm glad this helped but I think I'll close this one seeing as it is so old :)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×