Is there a way to make BGM not automatically loop?

JDevain

Veteran
Veteran
Joined
Oct 21, 2018
Messages
121
Reaction score
46
First Language
English
Primarily Uses
RMMV
Hello. Let me describe what I'm trying to do. You're on Map 1 and a song (BGM) starts. You transfer to Map 2 and the song continues uninterrupted. So far, no problem. Then that song ends, and a parallel process is checking every 60 frames to see if a BGM is playing. If not, then it starts a new (randomly chosen) BGM.

The problem is that BGM instantly loops, so that same song will just play over and over. I know how to check if a BGM is playing, and it works fine if a BGM hasn't already started, but once one starts, it just continually loops with no pause between the end and beginning.

Now, MEs (Music Effects) don't automatically loop, they actually stop when they are done, so theoretically I could just put my BGM files in the ME folder and play those as full songs, but I can't figure out how to check to see if an ME is currently playing.

By the way, the way I'm checking to see if a BGM is playing is like this:

(parallel process)
wait : 60 frames
set variable : variable 20 = AudioManager._currentBgm.name
if : variable 20 = 0
play random song
end

This works fine (if a BGM isn't already playing), but there doesn't seem to be a corresponding script call for MEs. For example, this does NOT work:

set variable : variable 20 = AudioManager._currentMe.name

Therefor I'm wondering if there's a way to make BGMs not auto-loop, as that seems like a solution, but of course any other solution is also more than welcome.

Thanks!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
_currentBGM.name is simply the name of the BGM that was last asked to play. It doesn't change to nothing when the BGM stops playing. It changes to nothing when there's a command to stop playing BGM (which includes going to a map with no BGM where the previous map's BGM is not meant to continue).

There is no command to see "have I reached the end of the track", even if it didn't loop by default.
 

BrentBAM

Veteran
Veteran
Joined
Jul 22, 2020
Messages
69
Reaction score
33
First Language
English
Primarily Uses
RMVXA
Right there is no command to end loop.

It would be a hard thing to do but...

if you really wanted to, I would make a parallel processing event add each second of time to a variable.

then once that variable is high enough, you can just stop the song.
 
Last edited:

JDevain

Veteran
Veteran
Joined
Oct 21, 2018
Messages
121
Reaction score
46
First Language
English
Primarily Uses
RMMV
@Shaz Thanks, Shaz. I understand what you're saying. So I guess the question then is: how in the world does one create a playlist that isn't just the same song looping over and over again?

I mean, I know a way to do it if you stay on the same map the whole time, but what if you are traveling from map to map? I would like the songs to not abruptly change to a new song every time the player goes through a door.

@BrentBAM I'm sorry, but I just don't know what you're talking about. What variable? You mean based on the length of the song? I don't get it.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
You could have an event on each map that's set to parallel process with the following commands: Fadeout BGM in 10 seconds, Wait 10 seconds, Play new BGM, Erase Event.
 

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

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,034
Messages
1,018,447
Members
137,820
Latest member
georg09byron
Top