[XP SCRIPT REQUEST] Shuffling Battle Musics?

LunaticGrace

Villager
Member
Joined
Jun 25, 2014
Messages
13
Reaction score
0
First Language
Indonesia
Primarily Uses
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?
 

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
Reaction score
106
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
 

LunaticGrace

Villager
Member
Joined
Jun 25, 2014
Messages
13
Reaction score
0
First Language
Indonesia
Primarily Uses
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"]endclass 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
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.  :(
 

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
Reaction score
106
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:

LunaticGrace

Villager
Member
Joined
Jun 25, 2014
Messages
13
Reaction score
0
First Language
Indonesia
Primarily Uses
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.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
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).
 

LunaticGrace

Villager
Member
Joined
Jun 25, 2014
Messages
13
Reaction score
0
First Language
Indonesia
Primarily Uses
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?
 

LunaticGrace

Villager
Member
Joined
Jun 25, 2014
Messages
13
Reaction score
0
First Language
Indonesia
Primarily Uses
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).
I did, I use switch 999 on my main project.
 

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
Reaction score
106
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.
 

LunaticGrace

Villager
Member
Joined
Jun 25, 2014
Messages
13
Reaction score
0
First Language
Indonesia
Primarily Uses
Thank you, Milena! You made my day  :D
 

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,574
Latest member
nikisknight
Top