Stopping BGM after it played once?

Status
Not open for further replies.

autophagy

tank nerd
Veteran
Joined
Jun 9, 2014
Messages
86
Reaction score
77
First Language
German
Primarily Uses
RMMV
Hello!

I found the threads in this forum very helpful so far, but there's something I just can't seem to figure out, which is why I signed up.

I have created a radio of sorts through common events with parallel process triggers, and it plays random songs from a list of available songs. (Aka a variable is set to random and conditional branches check if the variable is a certain number with every song corresponding to a number. I even figured out how to edit some of the core scripts to prevent the map BGM from playing while the radio is turned on.

So far, so good. However, I want a new random song to be chosen after the current song ends. My current solution is to look up the length of the song, multiply it to get the amount in frames, then make the BGM start playing through the normal event command, then use a script call to tell the event to wait for the duration of the song before stopping the BGM and going back to randomly select a new one.

I feel like this is very error prone.

Now I want to know, is there a way to determine the length of a music file and make the BGM stop playing automatically (and make the event carry on) once the song ends? Would MEs be a better choice? I'm really unsure about this.

Thanks in advance!
 

RyokuHasu

Developer
Veteran
Joined
Jun 23, 2012
Messages
274
Reaction score
37
First Language
English
Primarily Uses
Yes, MEs can be used to play music that just plays once , but I'm not sure if it had any size limitations though.
 

autophagy

tank nerd
Veteran
Joined
Jun 9, 2014
Messages
86
Reaction score
77
First Language
German
Primarily Uses
RMMV
Hmm, thank you for the answer. :) I'll try MEs instead.
 

RyokuHasu

Developer
Veteran
Joined
Jun 23, 2012
Messages
274
Reaction score
37
First Language
English
Primarily Uses
Problem is it cant wait for it to stop either, so you are back to figuring out Timing for yourself
 

autophagy

tank nerd
Veteran
Joined
Jun 9, 2014
Messages
86
Reaction score
77
First Language
German
Primarily Uses
RMMV
That's not as much of a problem, fortunately since the songs are going to be hardcoded into the game. I just hope the wait command doesn't reset itself under certain circumstances, but I guess I'll find out through some testing.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

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,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top