[RMVX ACE] TRYING TO CHANGE WINDOW BACKGROUND TO ONE OF FOUR DIFFERENT BACKGROUNDS...
Posts
Pages:
1
I'm using an advanced calendar script in my game to have four months, at 31 days each. I have window background images themed for each month/season, and I'm trying to change it so the message window background will change in spring, summer, fall, and winter. I'm only using two custom scripts currently, and those are Selchar's calendar and calendar clock add-on scripts. I've tried to do this myself, but I know nothing about Ruby. I thought I was on the right track, but not according to the massive amount of errors being shoved down my throat.
Any help would be much appreciated! Thanks!
Any help would be much appreciated! Thanks!
In Game_System, there is...
...this function. It might depend on how seasons are stored, but, it might look something like...
...that? Though, I must confess that I'm not 100% sure about @window_tone being passed an array that represents red-green-blue values. Hence, the commented-out lines!
#-------------------------------------------------------------------------- # * Get Window Color #-------------------------------------------------------------------------- def window_tone @window_tone || $data_system.window_tone end
...this function. It might depend on how seasons are stored, but, it might look something like...
def window_tone case $season when 0 #winter #@window_tone = [R, G, B] when 1 #spring #@window_tone = [R, G, B] when 2 #summer #@window_tone = [R, G, B] when 3 #autum #@window_tone = [R, G, B] else @window_tone || $data_system.window_tone end end end
...that? Though, I must confess that I'm not 100% sure about @window_tone being passed an array that represents red-green-blue values. Hence, the commented-out lines!
How do I use a background image instead of a tone? I was using this:
And would I put that block of code in Game_System, or in the Calendar script?
self.windowskin = Cache.system("window_01.png")And would I put that block of code in Game_System, or in the Calendar script?
That particular line of code exists in Window_Base, and normally references a file in the "Graphics/System" directory. So, if you want to use a different background for each season, it would probably look something like...
...that, maybe? It very largely depends on how the calendar system you have works, and how it keeps track of seasons/months!
#-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(x, y, width, height) super case $season when 0 # winter self.windowskin = Cache.system("window_winter") when 1 # spring self.windowskin = Cache.system("window_spring") when 2 # summer self.windowskin = Cache.system("window_summer") when 3 # autumn self.windowskin = Cache.system("window_autum") else # Default processing from the base script! self.windowskin = Cache.system("Window") end end update_padding update_tone create_contents @opening = @closing = false end
...that, maybe? It very largely depends on how the calendar system you have works, and how it keeps track of seasons/months!
$game_variables[MONTH]? Interesting. The fact that "MONTH" is in all-caps suggest it's a constant. Though, wait, we can still do this, since we can turn "case $season" into "case $game_variables[MONTH]", and probably go from there. Though, my guess is that the "when" statements might look more like...
...that.
when 1, 2, 12 # winter self.windowskin = Cache.system("window_winter") when 3 .. 5 # spring self.windowskin = Cache.system("window_spring") when 6 .. 8 # summer self.windowskin = Cache.system("window_summer") when 9 .. 11 # autumn self.windowskin = Cache.system("window_autumn")
...that.
Pages:
1














