Random Battle BGM

Discussion in 'JS Plugin Releases (RMMV)' started by Karberus, Oct 25, 2015.

  1. Karberus

    Karberus The other Victor Veteran

    Messages:
    67
    Likes Received:
    62
    Location:
    Orison
    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: Dec 8, 2015
    #1
    Uzuki, MMMm and sieben43 like this.
  2. atasuke10

    atasuke10 Veteran Veteran

    Messages:
    276
    Likes Received:
    138
    Location:
    Hungary
    First Language:
    English
    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
     
    #2
    Karberus likes this.
  3. Karberus

    Karberus The other Victor Veteran

    Messages:
    67
    Likes Received:
    62
    Location:
    Orison
    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
     
    #3
  4. Myst Desdemona

    Myst Desdemona The Snark Knight Veteran

    Messages:
    69
    Likes Received:
    14
    Location:
    Sweden
    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 :)
     
    #4
  5. Karberus

    Karberus The other Victor Veteran

    Messages:
    67
    Likes Received:
    62
    Location:
    Orison
    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: Dec 8, 2015
    #5
  6. Myst Desdemona

    Myst Desdemona The Snark Knight Veteran

    Messages:
    69
    Likes Received:
    14
    Location:
    Sweden
    First Language:
    English/Swedish
    Happy to help! Thank you for updating it :)
     
    #6
  7. Oberon

    Oberon Villager Member

    Messages:
    16
    Likes Received:
    1
    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?
     
    #7
  8. sieben43

    sieben43 Veteran Veteran

    Messages:
    66
    Likes Received:
    11
    First Language:
    German, English
    Primarily Uses:
    RMMV
    Do you have your audio files saved as .m4a and .ogg in your bgm folder?
     
    #8
    Oberon likes this.
  9. Oberon

    Oberon Villager Member

    Messages:
    16
    Likes Received:
    1
    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?
     
    #9
  10. sieben43

    sieben43 Veteran Veteran

    Messages:
    66
    Likes Received:
    11
    First Language:
    German, English
    Primarily Uses:
    RMMV
    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.
     
    #10
  11. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,544
    Likes Received:
    2,900
    Location:
    Philippines
    First Language:
    Tagalog
    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.
     
    #11
  12. Oberon

    Oberon Villager Member

    Messages:
    16
    Likes Received:
    1
    First Language:
    English
    Primarily Uses:
    RMMV
    Yeah, I still can't get it to work. dayum, 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: Jul 21, 2018
    #12

Share This Page