Yo. I started editing AJNR95's CMS and so far, with my absolutely non-existent RGSS abilities, I managed to adjust the menus the way I wanted to. The menu system and the clock window for it (+ extra poop) are now like this:
#==============================================================================
# ** Window_PlayTime
#------------------------------------------------------------------------------
# This window displays play time on the menu screen.
#==============================================================================
class Window_PlayTime < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
text = sprintf("%02d", hour)
text2 = sprintf("%02d", min)
text3 = sprintf("%02d", sec)
self.contents.font.color = normal_color
self.contents.draw_text(0, 0, 90, 32, text3, 2)
self.contents.draw_text(0, 0, 95, 32, " ", 2)
self.contents.draw_text(0, 0, 60, 32, text2, 2)
self.contents.draw_text(0, 0, 65, 32, ":", 2)
self.contents.draw_text(0, 0, 30, 32, text, 2)
self.contents.draw_text(0, 0, 35, 32, ":", 2)
#self.contents.font.color = system_color
#self.contents.draw_text(0, 16, 70, 135, "Play Time", 2)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
There are just three more things to do that I just can't pull off on my own. These are:
1. Set a background picture for the menu.
2. Add the battler of the first hero in party to the empty space in the menu. (The battler will change during the game, so I can't just set one specific pic.)
3. Add an icon to the clock window to function as a "currency" or something like that. (I have a clock icon that I want to add to it.)
Would someone be so kind as to help me with this? I understand that I'm a total newb concerning scripting and RGSS and that these things should be fairly simple. I can set the graphics as needed, like the position for the battler and which pic to show, so that's not too specific.
Thanks in advance! :)
The background is simple. If you looked at Scene_Title, you'd see these lines
# Make title graphic
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
# And later below that...this is where the "loop do" is at
# Dispose of title graphic
@sprite.bitmap.dispose
@sprite.dispose
It's exactly the same format (and under method
main in about the same spot--before and after the "loop do"); you only need to replace
$data_system.title_name with the filename of your graphic, in quotes.
I don't know how you want to add the battler; the menu is pretty bare and open for me to guess where you want it.
To draw an icon to the window
icon = RPG::Cache.icon('icon_filename')
rect = Rect.new(0,0,24,24)
self.contents.blt(x, y, icon, rect) # Change the x and y to something you like
I'd suggest putting this in the
initialize method of the Window_Playtime since it really only needs to be drawn once, not every second when the playtime updates.
Thanks a bunch! I got the background picture to work properly and I got the icon to appear!
Too bad the Garbage Collector (?) removes the icon pretty fast. How can I get around this problem? //Nevermind, I already solved it. I just put it to the refresh area as I was told not to lol
Also, I just want the battler of the first actor in party (oh well, also the only actor in the game) to float somewhere in the empty space in the menu. No movement, no tint or opacity changes, no nothing, just stay put there. I'm using a very large battler so it should be fine. I can adjust the position of it, but it should be the battler of the actor, not just that one battler with the specific filename because the actor's battler will change during the game.
Is that clear enough? :D
EDIT:
Because bumping is epic. (or not)
No double posting within 24 hours please. If you edit your last post, it'll show up as unread to other people. ~ G_G
I tried it first and it didn't work ;___; Oh well, let's just say I got impatient lol. Looks like it didn't work this time either.
Because 24 hours have already passed.
And because bumping is epic. (or not)
Yeah sorry. I was busy today. I'll have time tomorrow to help you out. It's not much different from making your background though. Instead, you use
battler_sprite = Sprite.new
battler_sprite.bitmap = RPG::Cache.battler('filename', 0)
and perhaps change the sprite's X/Y coordinates
battler_sprite.x = 200
battler_sprite.y = 100
and don't forget to dispose the sprite and its bitmap in a similar fashion. Of course, the "changing the graphic based on ____ events" will have to be explained.
Quote from: Ranquil on January 14, 2014, 03:52:44 am
//Nevermind, I already solved it. I just put it to the refresh area as I was told not to lol
lol forgot about the self.contents.clear. But yeah, that's all you needed to do. Sure it's extra drawing = more processing = worse performance, but it should not even be noticeable in the slightest.
Thank you! Now I have a battler floating there, yay~
Okay, time for a more thorough explanation. Now that I'm looking back at what I said about the battler, I don't wonder why you didn't understand what I meant lol.
So, the appearance of the actor with the ID of 001 (the only actor in the game btw) will change during the events of the game. I want a picture of the actor to show in the pause menu and reflect the changes as well. How I, with my complete lack of programming skills, imagined it would be the easiest to do would be by showing the battler of the actor, set in the database, in the menu so I could change the picture with events during the game, thus making the picture in the menu change.
I suppose there could be an another way to do it as well, but that how I though it would be the easiest to do. So, how can I set the script the get the filename of the battler of the actor?
Or do you have a better solution on hand?
I'd just like to note at this point that you've a great help so far KK20, because at this point I couldn't have figured all that out by myself. :)
Yes, you can use the 'Change Actor Graphic' command and do
@battler_sprite.bitmap = RPG::Cache.battler($game_player.battler_name, 0)
Glad to be of help~
I tried that and the game just gave me an error message and then crashed every time I tried to open the menu. It said:
Script 'Scene_Menu' line 25: NoMethodError occurred.
undefined method `battler_name' for #<Game_Player:0x3cd6980>
I'm not sure but I think I'm supposed to specify which actor's battler is supposed to be shown. :D
Right, Game_Player < Game_Character, not Game_Battler.
If your actor is going to be the same, you can do
$game_actors[ID].battler_name
Thank you! Now it's working perfectly! :)