[XP SCRIPT REQUEST] Shuffling Battle Musics?

Discussion in 'RGSS Script Requests' started by LunaticGrace, Apr 10, 2015.

  1. LunaticGrace

    LunaticGrace Villager Member

    Messages:
    13
    Likes Received:
    0
    First Language:
    Indonesia
    For my personal taste, I find battling in basic RPGs is kind of boring because it's repetitive, but of course we need to do some battle-stuffs in order to make our hero stronger to beat the game.

    I think the battle will be less 'repetitive' if the battles have different musics.

    I need a script which allow me to 'shuffle' some battle musics which I selected, but I also need an instruction how to turn the script off (because I want the Boss Battles to be fixed in 1 spesific battle music)

    So, is anyone willing to help?
     
    #1
  2. Milena

    Milena The woman of many questions Veteran

    Messages:
    1,282
    Likes Received:
    106
    Location:
    Ireland
    First Language:
    Irish
    Primarily Uses:
    N/A
    module LunaticGrace


    RANDOM_BATTLE_BGM_SWTCH = 1 # ID of Switch to turn on and off the


    # random battle music


    # list of battle music randomply played when switch is ON.


    BGM = ["001-Battle01", "002-Battle02", "003-Battle03", "004-Battle04"]


    end


    class Scene_Map


    #--------------------------------------------------------------------------


    # * Battle Call


    #--------------------------------------------------------------------------


    def call_battle


    # Clear battle calling flag


    $game_temp.battle_calling = false


    # Clear menu calling flag


    $game_temp.menu_calling = false


    $game_temp.menu_beep = false


    # Make encounter count


    $game_player.make_encounter_count


    # Memorize map BGM and stop BGM


    $game_temp.map_bgm = $game_system.playing_bgm


    $game_system.bgm_stop


    # Play battle start SE


    $game_system.se_play($data_system.battle_start_se)


    # Play battle BGM


    if $game_switches[LunaticGrace::RANDOM_BATTLE_BGM_SWTCH]


    music = LunaticGrace::BGM[rand(LunaticGrace::BGM.size)]


    Audio.bgm_play("Audio/BGM/" + music, 100, 100)


    else


    $game_system.bgm_play($game_system.battle_bgm)


    end


    # Straighten player position


    $game_player.straighten


    # Switch to battle screen


    $scene = Scene_Battle.new


    end


    end
     
    #2
  3. LunaticGrace

    LunaticGrace Villager Member

    Messages:
    13
    Likes Received:
    0
    First Language:
    Indonesia
    Wow, thanks, I never thought I get a fast script.

    But I get a few problem :

    I tried using your script, but somehow it only stuck in 1 music and the music battle keep going after the battle ended.

    And I also tried to select [none] in battle BGM (in the system menu) and it still doesn't work.

    And the 3rd problem, I also get a minor lag when I tried to load the game and when the battle appeared.

    Do I need to move your script? I put it on the above of the Main Script, and I also have some scripts on top of it.

    I appreciate your help  :)   :)   :)

    P.S I'll have The National Final Examination on this weeks, so I'll probably be active again after 15 th April, so, sorry for slow reply.  :(
     
    #3
  4. Milena

    Milena The woman of many questions Veteran

    Messages:
    1,282
    Likes Received:
    106
    Location:
    Ireland
    First Language:
    Irish
    Primarily Uses:
    N/A
    What do you mean it gets stuck with 1 music? I tried it in a vanilla project and it works fine. You should turn on the switch I indicated in the script as well. You should put more battle bgm not just 4, because chances are randomizing only happens on how many items in the bgm list are. So you'll notice that the music will get chosen often.
     
    Last edited by a moderator: Apr 11, 2015
    #4
  5. LunaticGrace

    LunaticGrace Villager Member

    Messages:
    13
    Likes Received:
    0
    First Language:
    Indonesia
    I already turned my switch on and I put 5 BGMs.

    The battle musics which I put on your script are cannot be played. Instead, it's stuck in the one which I put it on the 'System' (Database) Menu. I tried to put the battle BGM in the database menu to 'none', and... still no luck.

    I also tried to put it on my other project which has only 1 other script (which is Ccoa's Messaging System), 'cuz I thought the problem is I had too many scripts that it messes with yours. And it didn't work .

    :|   I feel stupid because your script is almost like a 'plug 'n play' script.
     
    #5
  6. bgillisp

    bgillisp Global Moderators Global Mod

    Messages:
    12,402
    Likes Received:
    12,634
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    Try a different switch instead of 1. Some scripts use switch 1 already and it might be that your other script is using switch one for its own work. Try switch 101 instead (change the first line and then turn on switch 101 in your project).
     
    #6
  7. LunaticGrace

    LunaticGrace Villager Member

    Messages:
    13
    Likes Received:
    0
    First Language:
    Indonesia
    Oh, nevermind! It's suprisingly worked after I put a text above my 'turning switch' command.  :guffaw: Well, it's better than nothing. But it still doesn't work on my main project, probably the problem is I have to delete or substitute few script (because I have 1 kinda heavy script)

    So, how should I credit you? Should I put 'Milena' or your real name in the credit section?

    Do you mind putting this script for my commercial project or just my non-commercials?
     
    #7
  8. LunaticGrace

    LunaticGrace Villager Member

    Messages:
    13
    Likes Received:
    0
    First Language:
    Indonesia
    I did, I use switch 999 on my main project.
     
    #8
  9. Milena

    Milena The woman of many questions Veteran

    Messages:
    1,282
    Likes Received:
    106
    Location:
    Ireland
    First Language:
    Irish
    Primarily Uses:
    N/A
    Yeah sure, name is fine enough, or you don't have to, really. Maybe you have a script that changes this part again of the script, so I advice you to put this script below all your scripts. It should be above Main.
     
    #9
  10. LunaticGrace

    LunaticGrace Villager Member

    Messages:
    13
    Likes Received:
    0
    First Language:
    Indonesia
    Thank you, Milena! You made my day  :D
     
    #10

Share This Page