Play Sound On Door Close?

MonkeyFrog

Villager
Member
Joined
Oct 29, 2018
Messages
17
Reaction score
3
First Language
English
Primarily Uses
RMMV
Hello all. I am just learning how to work with RPG Maker MV and am having a little issue. I've create an event that allows me to move a ball over a particular square. Once there, it opens a door somewhere else. If I move the ball off the square, the door closes again. Nice! Works a charm. I also made it so that a door sound plays when the ball is moved over the square. But when I move the ball off the square, I cannot find a way to get it to play a sound. Here's a screen shot of what I've done:



If I simply place the Play SE under the Control Switch under Else (the one that turns off Dungeon Door 2) then it will play the door sound with every push (of course). The end result I want is for the sound to play when the ball is pushed onto the square (and the door opens) and for the sound to play if the ball is pushed off the square (and the door closes). It is important that the player is able to move the ball onto and off of the square.

Any help would be appreciated. Thanks in advance. :)
 

MonkeyFrog

Villager
Member
Joined
Oct 29, 2018
Messages
17
Reaction score
3
First Language
English
Primarily Uses
RMMV
To sum up ... I just need the door sound to play ONCE when the ball is move onto the square and ONCE when the ball is moved off of the square and no other times. ;)
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
You need an extra Condition for the Off push Sound. It can only be pushed off if it was previously pushed on the tile.
So i would suggest Turning an additional Switch to On when the Ball is on the Target.
And everytime you push the rock you check when event not on destination tile, but the switch is ON, than turn Switch OFF and play the Sound and Close the Door.

Insteed of using an Event as target, you could use the Map Coordinates directly, or is your door trigger moving around on the map? (But it doesnt matter, just wanted to mention it)

EDIT: I should read better, you just need to put a conditional branch in the else case, it checks if the switch is on, if yes only than it turns it off and makes the sound and closes the door. So no extra switches needed.

Edit: Remove your direction fixes, i see no use for them.
 
Last edited:

MonkeyFrog

Villager
Member
Joined
Oct 29, 2018
Messages
17
Reaction score
3
First Language
English
Primarily Uses
RMMV
Thanks for the help. I will noodle through that.

Actually, it's not using an event, but a map coordinate. In the "push ball" it checks itself against the map XY coordinates. If it's own coordinates match the "switch" coordinates (simple a graphic on the ground) then it triggers the door opening and the door opening sound.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
No Problem, just let us know if something still aint working or in case its solved or in case it needs to be pimped up.
 

MonkeyFrog

Villager
Member
Joined
Oct 29, 2018
Messages
17
Reaction score
3
First Language
English
Primarily Uses
RMMV
Thank you so much! It works perfectly now (and makes perfect sense)! I truly appreciate your help. :)

 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
Good Job, looking good =).

Maybe demark the Direction Fix on the Lower left if needed.
 
Last edited:

MonkeyFrog

Villager
Member
Joined
Oct 29, 2018
Messages
17
Reaction score
3
First Language
English
Primarily Uses
RMMV
Yeah. I noticed this after posting the screen shot. It's unchecked in the working version. Thanks again.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
Ah one more starter tip. You could make this nearly to a copy paste event for other maps.

You are setting the Variables to the Push Ball Event, you could select "This Event" instead.
Than you safe some editing when copy pasting.

instead of a location you could also ask if the event is on a certain region, like region 42.
That works with the "Get Location Info" Event Command. You just Map the Region on the spot where the Ball should go.
(But this shall only demonstrate that there are several ways to the same outcome)
 
Last edited:

MonkeyFrog

Villager
Member
Joined
Oct 29, 2018
Messages
17
Reaction score
3
First Language
English
Primarily Uses
RMMV
Thanks! I am all for shortening the "code" and for reusing it where possible. So, copy and paste is great. I'll play a bit more and then it is off to make a multi-ball trigger (place three balls on three different squares) to open a door. ;)
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
Does it matter on which positions the balls lie? or is it just to put 3 ball on 3 spots no matter which? or does every ball have a specific spot?
 

MonkeyFrog

Villager
Member
Joined
Oct 29, 2018
Messages
17
Reaction score
3
First Language
English
Primarily Uses
RMMV
Each ball will have their own spot to be on. But I'll figure it out (ounce I get a chance to actually sit down and work on it). If I have an issue, I'll definitely ask.
 

MonkeyFrog

Villager
Member
Joined
Oct 29, 2018
Messages
17
Reaction score
3
First Language
English
Primarily Uses
RMMV
Thanks again for all your help, Bex. Because of it, I was able to get three balls to work with three different switches to open a single door. Woohoo!!!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,860
Messages
1,017,040
Members
137,569
Latest member
Shtelsky
Top