The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX => VX Scripts Database => Topic started by: D&P3 on July 22, 2012, 07:04:23 PM

Title: Random Battle Themes
Post by: D&P3 on July 22, 2012, 07:04:23 PM
Random Battle Themes
Version: 1.1
Author: DiamondandPlatinum3
Date: July 23, 2012



Planned Future Versions

Description

This script allows you to play a random battle theme upon starting a battle, it can be turned off before a boss battle via switch so that the appropriate battle theme still plays for them.

Features

Screenshots

Cannot Screenshot Audio, I'm afraid :o


Instructions

Script


Get it from here (http://www.diamondandplatinum3.net/rpg-maker-scripts/rpg-maker-vx/random-battle-themes/)

Credit




Thanks





Support


Post in this thread or PM me.

Known Compatibility Issues
I am unaware of any scripts it doesn't work with; if you find any, post in this thread.

Demo


A demo is unnecessary for a script such as this.

Author's Notes

This weeks scripting has been brought to you by the letter A, as in
'AAAHHHH, I'm so freaking far behind in my game developments that I'm opting to do some Ruby scripting'.

Terms of Use


You may find my Terms of Use Here (http://www.diamondandplatinum3.net/rpg-maker-scripts/terms-of-use/).
Title: Re: Random Battle Themes
Post by: DoctorTodd on July 22, 2012, 08:35:47 PM
Cool.  :)
But why not use case rather than use if? It doesn't really make a difference it just saves a bit of time and looks better in my opinion.
Code: [Select]
case @bt
when 1
@battle_bgm   = "Audio/BGM/" + RNDM_Battle_Themes::First_Random_Battle_Theme
Audio.bgm_play(@battle_bgm, @bgm_volume, @bgm_pitch)
when 2
@battle_bgm   = "Audio/BGM/" + RNDM_Battle_Themes::Second_Random_Battle_Theme
Audio.bgm_play(@battle_bgm, @bgm_volume, @bgm_pitch)
when 3
 @battle_bgm   = "Audio/BGM/" + RNDM_Battle_Themes::Third_Random_Battle_Theme
 Audio.bgm_play(@battle_bgm, @bgm_volume, @bgm_pitch)
when 4
 @battle_bgm   = "Audio/BGM/" + RNDM_Battle_Themes::Fourth_Random_Battle_Theme
  Audio.bgm_play(@battle_bgm, @bgm_volume, @bgm_pitch)
when 5
  @battle_bgm   = "Audio/BGM/" + RNDM_Battle_Themes::Fifth_Random_Battle_Theme
   Audio.bgm_play(@battle_bgm, @bgm_volume, @bgm_pitch)
else
      $game_system.battle_bgm.play
end
Title: Re: Random Battle Themes
Post by: D&P3 on July 22, 2012, 08:43:03 PM
You know something, that DOES look better :)

I didn't know that case worked with variable IDs like that :o Not in RGSS at least

Edited script and added you to thanks list :D