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
- 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 (http://www.diamondandplatinum3.net/rpg-maker-scripts/rgss3-vxa/battle-scripts/random-battle-theme-rgss3/)
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 (http://www.diamondandplatinum3.net/rpg-maker-scripts/terms-of-use/).
You can have unlimited choices of themes by using this logic:
ary = ["an item", "another item", "moar itmz"]
num = rand(ary.size) + 1
get = ary[num]
str = "Audio/BGM/" + get
then the play music thing or whatever
You can edit the stuff in-game though (I know you know how to do so, Pacman), changing it from an instance variable to a local would make it impossible to change in-game though.
I actually don't. Because as far as I can see, you can't.
1. There's no way to access the variables from outside the instance.
2. The variables are redefined as the values set in the module every time the method is called.
3. Editing modules in-game is silly (this isn't really a setback, more of an observation).
I would do this by storing the values in Game_System or another like class (such that it is accessible at any given time during the game), and attr_accessor the variables. That way users can use simple script calls like:
$game_system.bgm_volume = 50
or super-complex ones like:$game_system.battle_themes.reject! {|i|i.length >= 7}; $game_system.battle_themes.compact
even though that wouldn't fit in the box :D
Don't take any of this negatively. These are just ideas.
You can have unlimited choices of themes by using this logic:
ary = ["an item", "another item", "moar itmz"]
num = rand(ary.size) + 1
get = ary[num]
str = "Audio/BGM/" + get
then the play music thing or whatever
You know something, that looks a hell of a lot more easier (and better) than what I had in mind :)
I guess I'll put it in a somewhat dynamic array, then :D