Random Battle Themes
Version: 1.1
Author: DiamondandPlatinum3
Date: July 23, 2012
Planned Future Versions
It looks nice, but you should of made it an array, so people can add more than five or less if they don't want five. Even though, it probably won't add if the string is null, it is more friendly to the user.
You aliased a method and didn't call it!!! !! !
Also you created instance variables when you only needed to create local variables!!!! !!! !! !
Also you can't edit any of this stuff in-game!!!!! !!!! !!! !! !
(Those were my suggestions said in a really annoying way. Nice script.)
OMG!!!!!! !!!!! !!!! !!! !! !
I know, I'm a terrible person; I don't call aliases cause :mad:
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.
Pacman is my hero once again ;D
Quote from: Helladen on July 23, 2012, 09:38:02 AM
It looks nice, but you should of made it an array, so people can add more than five or less if they don't want five. Even though, it probably won't add if the string is null, it is more friendly to the user.
Actually the entire script was a request from someone who asked for a way to change the battle theme and to make it random for
five of their battle themes.
I originally wrote the script for VX, but it didn't work for them; because as always people fail to mention what goddamned maker they're using :mad:
I'm not sure about using an array for this, because that would require people to do some scripting if they exceed the limit (and shit always gets bad when this happens).
I can edit it to make it possible to have 30 random battles themes however (if you've got more than thirty battle themes, you should probably reevaluate your game).
I figure that using common events for this is more efficient, but I was saying that the array can be any size, not limited to the number you specify in the case select. It is easily customized, because I have seen Yanfly do it in many of his scripts.
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
Quote from: D&P3 on July 23, 2012, 10:40:23 AM
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.
Quote from: Pacman on July 23, 2012, 11:21:18 AM
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
Done, thanks a lot Pacman.
I absolutely did not know about that method and it's bound to make any future scripts a helluva lot more easier :) That's what I get for not looking up the basics of ruby :rolleyes:
It occurred to me that people might have battle themes with different volumes and/or pitch (thinking of Amkrogh's music here).
So I have updated the script to allow you to set individual volume and pitch per battle theme. I also think the code looks neater if that matters to anyone :P