MorsVictrix

Veteran
Veteran
Joined
Jun 25, 2017
Messages
39
Reaction score
5
First Language
Slovenian
Primarily Uses
RMMV
Hi!

I would like to make a paralell event, that plays a BGS (a few minutes of background sound), but stops everytime the player stops walking and then continues playback when the player is walking again.

If it is impossible to make the BGS continue playback where it stopped (like a pause effect), then at leat that it restarts each time the player starts walking.

Thank you!
 

coucassi

Veteran
Veteran
Joined
Sep 23, 2019
Messages
155
Reaction score
217
First Language
German
Primarily Uses
RMMV
Not sure if it will work like this, but it's worth a try (and posting here might bring people who do know more about that stuff to correct me and help you out).

The script call to check if the player is moving should be:

$gamePlayer.isMoving()

If you create a conditional brach with this as a condittion, you should be able to save & fade bgm, every time the player stops moving. When he starts moving again, the condition returns true and the saved bgm will play again.

Something like this:

Conditional Brach: Script: $gamePlayer.isMoving()

Play BGM again

Else

Save BGM
Fade Out BGM
 

MorsVictrix

Veteran
Veteran
Joined
Jun 25, 2017
Messages
39
Reaction score
5
First Language
Slovenian
Primarily Uses
RMMV
Thanks for you advice. Means a lot to me.

I tried it and the script ''$gamePlayer.isMoving()'' makes the BGM repeat over and over before you can even hear it, because most BGM have a slow fade in. So while most BGM don't even make a sound, SE repeat over and over untill you stop walking - they are shorter audio and don't have a long fade in...

If I put a ''Wait 999 frames'' command after the ''play BGM'', then the BGM plays normally, but doesn't stop when I stop despite the ''else Fade Out BGM in 1 frame'' command... :/

Also I'm sorry, but I do not know of a ''Save BGM'' command. Couldn't find it. You sure there is such a thing?

Thank you for trying to help me.
 

coucassi

Veteran
Veteran
Joined
Sep 23, 2019
Messages
155
Reaction score
217
First Language
German
Primarily Uses
RMMV
I am pretty sure, there is a command that lets you save the bgm that's currently playing as well as one that plays this saved bgm again. It may be a translation issue though, since I am using the german version. Those commands let you play the bgm withouthaving it starting all over again.

But anyway, this does not solve your problem :( As it seems this script command returns false everytime you step on a new tile, regardless of you holding the movement key, that's why the music isn't playing continuesly, but fades out and then starts again, while you are moving. I played around a bit, but did not find a solution yet.
The best effect I could create is the music fading in and out all the time without playing from the beginning so, while you move and stop as soon as the music stops, but this sounds really awkward xD

Maybe I'll come up with something, if not I hope someone else will be able to help you.


EDIT: Found a solution for you! However this is only working when your players are using the keyboard for movement, instead of the mouse:

You'll need a parallel event with two pages

If: Key (left) is pressed
Play BGM again
Self Switch A: ON
Else
If: Key (right) is pressed
Play BGM again
Self Switch A: ON
Else
If: Key (up) is pressed
Play BGM again
Self Switch A: ON
Else
If: Key (down) is pressed
Play BGM again
Self Switch A: ON

If: Key (left) is pressed
-
Else
If: Key (right)] is pressed
-
Else
If: Key (up) is pressed
-
Else
If: Key (down) is pressed
-
Else
Save BGM
Fade out BGM: 1 Second
Self Switch A: Off

I know it looks a bit messy, but it's really simple: On the first page you check if any of the direction keys is pressed. If so, it starts the saved BGM from the point it last stopped. Then it activates the self switch to turn to page two, which prevents the event from starting all over again.

On page 2, the condtinional branch checks if none of the moving keys is pressed, that's why all these branches are empty. This way it only activates if none of the keys is pressed, aka the player stopped moving. Then the music will be saved at it's current playtime and then fade out. Then the self switch is deactivated what brings us back to page one. Here things only go on if one of the moving keys is pressed again and so on.

Sorry, that I can't provide screenshots, it's all in german for me, so they wouldn't help to much^^.
As for the Save BGM and Play BGM again commands, they are on page two of the event command window, third & fourth button under Audio & Video.

These functions aren't available for BGS however, so if you really want to use BGS for that, it will start from the beginning everytime instead continuing where it stopped. If it's just about the slow fade in of the songs, you could either cut the silence at the beginning of the BGM out or use BGS as BGM by copying them into the BGM file.

EDIT: Sorry, messed up the spoiler section. Now everything should be clean.
 
Last edited:

MorsVictrix

Veteran
Veteran
Joined
Jun 25, 2017
Messages
39
Reaction score
5
First Language
Slovenian
Primarily Uses
RMMV
OH MY GOD!!! Thank you sooo much! You're a genius!! I got it working thanks to you! Yaaaay!!!!
 

coucassi

Veteran
Veteran
Joined
Sep 23, 2019
Messages
155
Reaction score
217
First Language
German
Primarily Uses
RMMV
Haha, happy to help. And who knows, this might come in handy for myself too at some point. It is definitely a way to add some atmosphere to sneaky action and such :D
 

MorsVictrix

Veteran
Veteran
Joined
Jun 25, 2017
Messages
39
Reaction score
5
First Language
Slovenian
Primarily Uses
RMMV
Yeah, hope it help you as well. Thanks!!!
 

Latest Threads

Latest Posts

Latest Profile Posts

I want to learn Javascript to create a custom menu, but I don't really know where to start.
One uncomfortable truth that has withstood the test of time, is how most people will stand by while they see a crime happening, unless it's illegal to stand by. We probably wouldn't have stories about "special heroes" or games about heroes if the "everyday common folk" were largely capable of being heroes. Heroes face dangers that most people are not willing to.
I'm having toooo much fun designing the new MP (Mental Psyche) system. I've only worked it out for enemies so far, but it's fun to stun them, then go after their MP and delete them instead to farm for better item drops.
anyone know of a place I can promote my game? sorta like game awards but for indie devs, like a place where I can drop a trailer and like stir up some hype
Doing RPG Maker News for 17th October 2021

Forum statistics

Threads
115,885
Messages
1,093,702
Members
151,126
Latest member
LAB00M
Top