Random Battle BGM

Karberus

The other Victor
Veteran
Joined
Jun 2, 2012
Messages
67
Reaction score
64
First Language
Spanish
Random Battle BGM 
by Karberus
 ​
 ​
 ​
Versions:
Current Version: 1.2

v1.0        25 Oct 2015 -  Initial Release.v1.1        25 Oct 2015 -  Added Plugin Commands to override random battle bgm and be able to set it through an event.v1.11 25 Oct 2015 - Cleaned up a tiny bit of the code.v1.2 26 Oct 2015 - Fixed a bug that caused other scripts plugin commands to affect this script's plugin commands. (lol) v2.0 07 Dec 2015 - Almost completely rewritten. Fixed issues with Yanfly's Party System.
 
 ​
Introduction:
Whenever battle starts, this plugin will randomly play one of the BGM's that you choose.
 
 
Features:

  • You may declare up to 30 BGM's 
  • One of those BGM's will be chosen at random before each battle 
  • You may turn this plugin on or off at any time through plugin commands.

How to use:

  • Add the plugin to your game and set up what battle BGM's you wish to use by typing the filename in the parameter settings.

Plugin Commands:

  • RandomBGM on/off             //Turns this plugin on or off 
Plugin:
RandomBattleBGM
 
 
Dependencies:
None
 
 
Known Bugs:
Changing the battle's bgm through an event doesn't work.

Yanfly's Party System would cause the bgm to change in the middle of battle 
 
 
Credit/Terms of use:
No need to credit me or anything, and it may be used however you wish; commercial or non-commercial.
 
 
Author's Notes
This is my first plugin ever, I've never coded before. I'm still learning and I am quite sure I made tons of mistakes so any help is appreciated lol. Hopefully it works as intended at least :)
 
Last edited by a moderator:

atasuke10

Veteran
Veteran
Joined
Apr 1, 2014
Messages
276
Reaction score
138
First Language
English
Primarily Uses
Thanks a lot :D
Wwhile it's not that hard to set up in maker, it's a nice thing to have as plugin :)
Imma use it because it reminded me that I should have this.
I remember "The world ends with you" having random bgms in battle out of like 5.
It was refreshing to hear different ones playing.
Anyway u'll get credited because I can't live with myself without crediting people xd
 

Karberus

The other Victor
Veteran
Joined
Jun 2, 2012
Messages
67
Reaction score
64
First Language
Spanish
Hey I'm glad you find it useful xD

I actually did this just to practice the little I've learned of Javascript and how to make plugins for MV.

Hopefully I'll make better plugins in the future when I learn more :p

and Thanks! lol
 

Myst Desdemona

The Snark Knight
Veteran
Joined
Nov 18, 2015
Messages
72
Reaction score
15
First Language
English/Swedish
Hey Karberus, love this plugin. It makes random battles always a different tone.

There is one little bug/inconvenience thing so I thought I'd ask.

If I use this with yanfly's formation menu (his/her party system) The song would randomly change once you go back to the battle. They made a fix that would preserve the same song but it didn't have an effect.

I tried to use your plugin commands in order to choose a specific song , although it crashes and can't load it. I made sure that I wrote the name of it correctly.

Normally it's fine, although for boss fights I wouldn't want it to change the music because it becomes one of the randomly designated songs for normal battles.

Thanks for the plugin though, it's really helpful :)
 

Karberus

The other Victor
Veteran
Joined
Jun 2, 2012
Messages
67
Reaction score
64
First Language
Spanish
@Myst Desdemona - When I tried out Yanfly's Party System, that's the first thing I noticed and I was like "Noooooooooo" but I think I finally fixed it.

I will update this asap. EDIT: updated.

Thank you so much for your feedback :)
 
Last edited by a moderator:

Myst Desdemona

The Snark Knight
Veteran
Joined
Nov 18, 2015
Messages
72
Reaction score
15
First Language
English/Swedish
Happy to help! Thank you for updating it :)
 

Oberon

Villager
Member
Joined
May 11, 2018
Messages
17
Reaction score
2
First Language
English
Primarily Uses
RMMV
I can't get this to work for the life of me. It says 'Failed to load undefined.ogg'. I'm using exact filenames from audio/bgm/. What am I doing wrong?
 

sieben43

Veteran
Veteran
Joined
Oct 25, 2015
Messages
66
Reaction score
11
First Language
German, English
Primarily Uses
RMMV
I can't get this to work for the life of me. It says 'Failed to load undefined.ogg'. I'm using exact filenames from audio/bgm/. What am I doing wrong?
Do you have your audio files saved as .m4a and .ogg in your bgm folder?
 

Oberon

Villager
Member
Joined
May 11, 2018
Messages
17
Reaction score
2
First Language
English
Primarily Uses
RMMV
Ja! For example, "Battle 1" and "Battle 2" are m4a and .ogg in the bgm folder...but I list them in the activated plugin settings and get the "undefined" message in game. Do all 30 slots need to be filled?
 

sieben43

Veteran
Veteran
Joined
Oct 25, 2015
Messages
66
Reaction score
11
First Language
German, English
Primarily Uses
RMMV
Ja! For example, "Battle 1" and "Battle 2" are m4a and .ogg in the bgm folder...but I list them in the activated plugin settings and get the "undefined" message in game. Do all 30 slots need to be filled?
No they don't.
The only thing I know you could check would be spell checking, but I guess in this case you would have got a proper error message.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,696
Reaction score
3,005
First Language
Tagalog
Primarily Uses
RMVXA
Try to remove spaces in your filenames and see if that works, I think newer versions of the engine doesnt work with spaces in filenames anymore.
 

Oberon

Villager
Member
Joined
May 11, 2018
Messages
17
Reaction score
2
First Language
English
Primarily Uses
RMMV
Yeah, I still can't get it to work. Damn, I have no idea what's wrong with it.

[EDIT] I had an extra space in the .js filename. You gotta have it RandomBattleBGM.js. Yes, I'm an idiot.
 
Last edited:

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

Latest Threads

Latest Posts

Latest Profile Posts

In the strangest turn of events, my animations now live in the characters folder, and my character images now live in the pictures folder. It's a complicated world, but weirdly a more resource efficient one. :LZSexcite:
Did you know that we use robotic spy animals to learn about how different species behave in the wild? We're only a step away from robotic spy humans, and then Terminator. :p
Not being able to do a commission/request after all and having to give back the money is so heartbreaking.

Sometimes I'm just way too eager to help people out and suddenly find myself in a very deep hole because I'm not gonna be able to finish it. I really hope I don't come across as unprofessional to these people and in general. =n="
Learning Action Sequences!

Forum statistics

Threads
98,046
Messages
948,814
Members
129,310
Latest member
eillajones309
Top