Main Menu
  • Welcome to The RPG Maker Resource Kit.

Random Battle Themes

Started by D&P3, July 22, 2012, 07:04:23 PM

0 Members and 1 Guest are viewing this topic.

D&P3

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.
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

DoctorTodd

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.

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

D&P3

#2
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
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