RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Random Battle Themes

0 Members and 1 Guest are viewing this topic.

*
*crack*
Rep:
Level 64
2012 Best Newbie2012 Most Unsung MemberFor frequently finding and reporting spam and spam bots
Random Battle Themes
Version: 1.1
Author: DiamondandPlatinum3
Date: July 23, 2012



Planned Future Versions

  • None
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

  • Does not actually modify your battle theme but rather plays one selected at random when starting up a battle. Therefore, if you turn it off via an event switch (see Editable Region), it will play the Battle theme you have set to play in the system.
  • Can have as many random battle themes as you would like.
  • Can modify volume & pitch on each battle theme.
Screenshots

Cannot Screenshot Audio, I'm afraid :o


Instructions

  • Paste the script under your materials section in your script editor but above main.
  • Just take a look at the editable region and modify things appropriately.
Script


Get it from here

Credit


  • DP3 / DiamondandPlatinum3


Thanks


  • DoctorTodd ~ For showing me a nicer way to present some code.
  • Pacman ~ Same as Todd :)



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.
« Last Edit: June 27, 2014, 08:50:44 AM by D&P3 »
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3

****
Rep:
Level 71
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

*
*crack*
Rep:
Level 64
2012 Best Newbie2012 Most Unsung MemberFor frequently finding and reporting spam and spam bots
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
« Last Edit: July 22, 2012, 08:46:31 PM by D&P3 »
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3