|
  |
Window_GameCompletion, Unknown Author |
|
|
|
|
Dec 14 2009, 08:55 AM
|

The King of Spades

Group: Revolutionary
Posts: 400
Type: Developer
RM Skill: Intermediate

|
Version 1.0 Author Unknown Release Date: Unknown Introduction Like the step count, gold, and Playtime scripts. This script adds the Game Completion Window in the menu.
Script
CODE #============================================================================== # ■ Window_Window_GameCompletion #------------------------------------------------------------------------------ #============================================================================== class Window_GameCompletion < Window_Base #-------------------------------------------------------------------------- # Set up #-------------------------------------------------------------------------- def initialize super(0, 0, 160, 54) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = "Verdana" self.contents.font.size = 16 refresh end #-------------------------------------------------------------------------- # Draws percentage #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = system_color self.contents.draw_text(4, -14, 120, 36, "Game Completion") self.contents.font.color = normal_color #Everything below is Changeable game_percent = ("0%") if $game_switches[1] == true game_percent = ("1%") end if $game_switches[2] == true game_percent = ("2%") end if $game_switches[3] == true game_percent = ("3%") end if $game_switches[4] == true game_percent = ("16%") end if $game_switches[5] == true game_percent = ("17%") end if $game_switches[6] == true game_percent = ("18%") end if $game_switches[7] == true game_percent = ("19%") end if $game_switches[8] == true game_percent = ("33%") end if $game_switches[9] == true game_percent = ("34%") end if $game_switches[10] == true game_percent = ("35%") end if $game_switches[11] == true game_percent = ("36%") end if $game_switches[12] == true game_percent = ("66%") end if $game_switches[13] == true game_percent = ("67%") end if $game_switches[14] == true game_percent = ("68%") end if $game_switches[15] == true game_percent = ("69%") end if $game_switches[16] == true game_percent = ("83%") end if $game_switches[17] == true game_percent = ("84%") end if $game_switches[18] == true game_percent = ("85%") end if $game_switches[19] == true game_percent = ("86%") end if $game_switches[20] == true game_percent = ("95%") end if $game_switches[21] == true game_percent = ("96%") end if $game_switches[22] == true game_percent = ("97%") end if $game_switches[23] == true game_percent = ("98%") end if $game_switches[24] == true game_percent = ("99%") end if $game_switches[25] == true game_percent = ("100%") end #Everything Above is Changeable self.contents.draw_text(50, 0, 120, 32, game_percent) end end Instructions Insert the script anywhere above Main, perferable right after Window_PlayTime.
Then in Scene Menu after line 40 add:
CODE # Make Game Completion window @percent_window = Window_GameCompletion.new @percent_window.x = 0 @percent_window.y = 224
Then go down and find the lines that look like this:
CODE # Dispose of windows @command_window.dispose @playtime_window.dispose @steps_window.dispose @gold_window.dispose @status_window.dispose end
And add this to it:
CODE @percent_window.dispose
After that go down and the same thing here:
CODE #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update windows @command_window.update @playtime_window.update @steps_window.update @gold_window.update @status_window.update
Configuration You might not see at first because other window are blocking the view.
If you haven't customize your menu yet with some elses script. This is the default script, just change the _window.y on all of them to fix the windows in.
CODE # Make Game Completion window @percent_window = Window_GameCompletion.new @percent_window.x = 0 @percent_window.y = 224 @playtime_window = Window_PlayTime.new @playtime_window.x = 0 @playtime_window.y = 224 # Make steps window @steps_window = Window_Steps.new @steps_window.x = 0 @steps_window.y = 320 # Make gold window @gold_window = Window_Gold.new @gold_window.x = 0 @gold_window.y = 416
FAQ If you have any troubles I can try to install it for you if you using a customized menu, but I mostly may have trouble with it so a mod could probably do a better job at helping.
Credits You Find the person who created script, tell me so I can add him/her.
__________________________
     Use Dropbox to upload your files. Much simpler than other upload sites, you can simply place a folder on your desktop that will sync with your DropBox account.  QUOTE ('Exiled One') "If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others."
|
|
|
|
|
|
|
|
|
Dec 15 2009, 03:44 PM
|

The King of Spades

Group: Revolutionary
Posts: 400
Type: Developer
RM Skill: Intermediate

|
Did anyone find this useful
__________________________
     Use Dropbox to upload your files. Much simpler than other upload sites, you can simply place a folder on your desktop that will sync with your DropBox account.  QUOTE ('Exiled One') "If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others."
|
|
|
|
|
|
|
|
|
Dec 19 2009, 06:28 PM
|

The King of Spades

Group: Revolutionary
Posts: 400
Type: Developer
RM Skill: Intermediate

|
QUOTE (Redd @ Dec 19 2009, 06:09 PM)  Here's an edit I created. It shows a percent off of what Variable 1 is. So if Variable 1 was 3, it would say 3% inside the menu! The instructions are inside the script. It also switches the Steps window out for it. CODE #=============================================================================== # Window_GameCompletion #------------------------------------------------------------------------------- # Shows how much percentage of the game is completed by calling how much a # variable is. #=============================================================================== # Edited by Redd with the following features: # ¤ Shows percentage with a variable # ¤ Replaces the Steps window # ¤ Fully compatible with Redd's Icons #=============================================================================== # Instructions #=============================================================================== # Configuration #------------------------------------------------------------------------------- # # After adding this script above Main, find the script Scene_Menu and find the # following code (it's around 45 somewhere) # # # Make steps window # @percent_window = Window_Steps.new # @percent_window.x = 0 # @percent_window.y = 320 # # And replace it with this: # # # Make Game Completion window # @percent_window = Window_GameCompletion.new # @percent_window.x = 0 # @percent_window.y = 320 # # Then go down to the lines that look like this: # # # Dispose of windows # @command_window.dispose # @playtime_window.dispose # @steps_window.dispose # @gold_window.dispose # @status_window.dispose # end # # And replace it with this: # # # Dispose of windows # @command_window.dispose # @playtime_window.dispose # @percent_window.dispose # @gold_window.dispose # @status_window.dispose # end # # Then find the following code, which is under Frame Update: # # def update # # Update windows # @command_window.update # @playtime_window.update # @steps_window.update # @gold_window.update # @status_window.update # # And replace it with this: # # def update # # Update windows # @command_window.update # @playtime_window.update # @percent_window.update # @gold_window.update # @status_window.update #------------------------------------------------------------------------------- # Displaying Percentage #------------------------------------------------------------------------------- # To display the percentage in the menu, you will have to change Variable 1 # to how much percentage you want your menu to have. For instance, if I set # Variable 1 to 33, it would change the percent to 33% in the menu. #=============================================================================== class Window_GameCompletion < Window_Base #-------------------------------------------------------------------------- # Set up #-------------------------------------------------------------------------- def initialize super(0, 0, 160, 96) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = "Arial" self.contents.font.size = 22 refresh end #-------------------------------------------------------------------------- # Draws percentage #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = system_color self.contents.draw_text(4, -14, 120, 50, "Progress") self.contents.font.color = normal_color #Everything below is Changeable game_percent = ("0%") if $game_variables[1] == 1 game_percent = ("1%") end if $game_variables[1] == 2 game_percent = ("2%") end if $game_variables[1] == 3 game_percent = ("3%") end if $game_variables[1] == 4 game_percent = ("4%") end if $game_variables[1] == 5 game_percent = ("5%") end if $game_variables[1] == 6 game_percent = ("6%") end if $game_variables[1] == 7 game_percent = ("7%") end if $game_variables[1] == 8 game_percent = ("8%") end if $game_variables[1] == 9 game_percent = ("9%") end if $game_variables[1] == 10 game_percent = ("10%") end if $game_variables[1] == 11 game_percent = ("11%") end if $game_variables[1] == 12 game_percent = ("12%") end if $game_variables[1] == 13 game_percent = ("13%") end if $game_variables[1] == 14 game_percent = ("14%") end if $game_variables[1] == 15 game_percent = ("15%") end if $game_variables[1] == 16 game_percent = ("16%") end if $game_variables[1] == 17 game_percent = ("17%") end if $game_variables[1] == 18 game_percent = ("18%") end if $game_variables[1] == 19 game_percent = ("19%") end if $game_variables[1] == 20 game_percent = ("20%") end if $game_variables[1] == 21 game_percent = ("21%") end if $game_variables[1] == 22 game_percent = ("22%") end if $game_variables[1] == 23 game_percent = ("23%") end if $game_variables[1] == 24 game_percent = ("24%") end if $game_variables[1] == 25 game_percent = ("25%") end if $game_variables[1] == 26 game_percent = ("26%") end if $game_variables[1] == 27 game_percent = ("27%") end if $game_variables[1] == 28 game_percent = ("28%") end if $game_variables[1] == 29 game_percent = ("29%") end if $game_variables[1] == 30 game_percent = ("30%") end if $game_variables[1] == 31 game_percent = ("31%") end if $game_variables[1] == 32 game_percent = ("32%") end if $game_variables[1] == 33 game_percent = ("33%") end if $game_variables[1] == 34 game_percent = ("34%") end if $game_variables[1] == 35 game_percent = ("35%") end if $game_variables[1] == 36 game_percent = ("36%") end if $game_variables[1] == 37 game_percent = ("37%") end if $game_variables[1] == 38 game_percent = ("38%") end if $game_variables[1] == 39 game_percent = ("39%") end if $game_variables[1] == 40 game_percent = ("40%") end if $game_variables[1] == 41 game_percent = ("41%") end if $game_variables[1] == 42 game_percent = ("42%") end if $game_variables[1] == 43 game_percent = ("43%") end if $game_variables[1] == 44 game_percent = ("44%") end if $game_variables[1] == 45 game_percent = ("45%") end if $game_variables[1] == 46 game_percent = ("46%") end if $game_variables[1] == 47 game_percent = ("47%") end if $game_variables[1] == 48 game_percent = ("48%") end if $game_variables[1] == 49 game_percent = ("49%") end if $game_variables[1] == 50 game_percent = ("50%") end if $game_variables[1] == 51 game_percent = ("51%") end if $game_variables[1] == 52 game_percent = ("52%") end if $game_variables[1] == 53 game_percent = ("53%") end if $game_variables[1] == 54 game_percent = ("54%") end if $game_variables[1] == 55 game_percent = ("55%") end if $game_variables[1] == 56 game_percent = ("56%") end if $game_variables[1] == 57 game_percent = ("57%") end if $game_variables[1] == 58 game_percent = ("58%") end if $game_variables[1] == 59 game_percent = ("59%") end if $game_variables[1] == 60 game_percent = ("60%") end if $game_variables[1] == 61 game_percent = ("61%") end if $game_variables[1] == 62 game_percent = ("62%") end if $game_variables[1] == 63 game_percent = ("63%") end if $game_variables[1] == 64 game_percent = ("64%") end if $game_variables[1] == 65 game_percent = ("65%") end if $game_variables[1] == 66 game_percent = ("66%") end if $game_variables[1] == 67 game_percent = ("67%") end if $game_variables[1] == 68 game_percent = ("68%") end if $game_variables[1] == 69 game_percent = ("69%") end if $game_variables[1] == 70 game_percent = ("70%") end if $game_variables[1] == 71 game_percent = ("71%") end if $game_variables[1] == 72 game_percent = ("72%") end if $game_variables[1] == 73 game_percent = ("73%") end if $game_variables[1] == 74 game_percent = ("74%") end if $game_variables[1] == 75 game_percent = ("75%") end if $game_variables[1] == 76 game_percent = ("76%") end if $game_variables[1] == 77 game_percent = ("77%") end if $game_variables[1] == 78 game_percent = ("78%") end if $game_variables[1] == 79 game_percent = ("79%") end if $game_variables[1] == 80 game_percent = ("80%") end if $game_variables[1] == 81 game_percent = ("81%") end if $game_variables[1] == 82 game_percent = ("82%") end if $game_variables[1] == 83 game_percent = ("83%") end if $game_variables[1] == 84 game_percent = ("84%") end if $game_variables[1] == 85 game_percent = ("85%") end if $game_variables[1] == 86 game_percent = ("86%") end if $game_variables[1] == 87 game_percent = ("87%") end if $game_variables[1] == 88 game_percent = ("88%") end if $game_variables[1] == 89 game_percent = ("89%") end if $game_variables[1] == 90 game_percent = ("90%") end if $game_variables[1] == 91 game_percent = ("91%") end if $game_variables[1] == 92 game_percent = ("92%") end if $game_variables[1] == 93 game_percent = ("93%") end if $game_variables[1] == 94 game_percent = ("94%") end if $game_variables[1] == 95 game_percent = ("95%") end if $game_variables[1] == 96 game_percent = ("96%") end if $game_variables[1] == 97 game_percent = ("97%") end if $game_variables[1] == 98 game_percent = ("98%") end if $game_variables[1] == 99 game_percent = ("99%") end if $game_variables[1] == 100 game_percent = ("100%") end #Everything Above is Changeable self.contents.draw_text(50, 0, 120, 80, game_percent) end end Enjoy! Okay, what's wrong with the one I posted???? I'm isn't the same thing but uses variables instead.
__________________________
     Use Dropbox to upload your files. Much simpler than other upload sites, you can simply place a folder on your desktop that will sync with your DropBox account.  QUOTE ('Exiled One') "If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others."
|
|
|
|
|
|
|
|
|
Dec 20 2009, 03:22 AM
|

Level 50

Group: +Gold Member
Posts: 1,520
Type: Scripter
RM Skill: Undisclosed

|
Hmmmmmmm......... there's a very different design intent between those two versions, the original was designed to be in the menu with everything else, and follows switches that get activated at key points during the game, but Redd's is designed to replace the Window_Steps, and follow a master variable. Both have their uses, but I was just wondering, BigAce, would you mind posting the y values you have, because the ones you have under configuration are just the default ones, and I can't get it to look very nice  @> Redd: Sorry to say this, but: CODE game_percent = $game_variables[1].to_s + '%' probably would have been very useful to you.... I'll also mention it'd improve your code a lot of you overwrote the refresh in Window_Steps, instead of making your own window, just so you don't need to change @steps_window = Window_Steps.new to Window_GameCompletion.new
__________________________
K.I.S.S. Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question. Most important guide ever: Newbie's Guide to Switches
|
|
|
|
|
|
|
|
|
Dec 20 2009, 10:25 AM
|

The King of Spades

Group: Revolutionary
Posts: 400
Type: Developer
RM Skill: Intermediate

|
Night_Runner, knowing how to script way way better then me I thought you'll be able to figure this easy thing out.  XD JK well heres the piece u wanted. Hey, runner you mean like this:
menu.png ( 129.33K )
Number of downloads: 32here's all the 'Y' coordinates I use in my Monster Album: CODE # Make play time window @percent_window = Window_GameCompletion.new @percent_window.x = 0 @percent_window.y = 224 # Make Map name window @map_window = Window_Mapname.new @map_window.x = 0 @map_window.y = 278 # Make play time window @playtime_window = Window_PlayTime.new @playtime_window.x = 0 @playtime_window.y = 334 # Make steps window @steps_window = Window_Steps.new @steps_window.x = 0 @steps_window.y = 390 # Make gold window @gold_window = Window_Gold.new @gold_window.x = 0 @gold_window.y = 435 # Make status window @status_window = Window_MenuStatus.new @status_window.x = 160 @status_window.y = 0 # Execute transition Graphics.transition # Main loop loop do # Update game screen Graphics.update # Update input information Input.update # Frame update update # Abort loop if screen is changed if $scene != self break end end # Prepare for transition Graphics.freeze # Dispose of windows @map_window.dispose @command_window.dispose @playtime_window.dispose @steps_window.dispose @gold_window.dispose @status_window.dispose @percent_window.dispose end
__________________________
     Use Dropbox to upload your files. Much simpler than other upload sites, you can simply place a folder on your desktop that will sync with your DropBox account.  QUOTE ('Exiled One') "If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others."
|
|
|
|
|
|
|
|
|
Dec 21 2009, 02:39 AM
|

Level 50

Group: +Gold Member
Posts: 1,520
Type: Scripter
RM Skill: Undisclosed

|
Ahhhh, you recoded the windows  I was hoping that there was a easier way to do it.... As for the overlapping, there's a hard way, and a easy way to fix that  The easy way is simple, under the CODE @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6]) line, have something like CODE @command_window.height = 224 This forces the command window to be 224 high, and it just puts a down arrow on the menu to show there's more options  The hard way requires you going back into the window that you've made for the command window, including something like: CODE #-------------------------------------------------------------------------- # * Object Initialization # width : window width # commands : command text string array #-------------------------------------------------------------------------- def initialize(width, commands) # Compute window height from command quantity super(0, 0, width, 224) # Change the max height to 224 @item_max = commands.size @commands = commands self.contents = Bitmap.new(width - 32, @item_max * 32) refresh self.index = 0 end and then go into your refresh method and change the rect = line to: CODE rect = Rect.new(4, 27 * index, self.contents.width - 8, 32) # Notice that they are now spaced apart by 27, not 32 or something like that, squishing them up, and then you'd have to redo the cursor to be smaller..... meh, it's a straight copy and paste of the update_cursor_rect out of the window_selectable, but changing the 32 to 27....
__________________________
K.I.S.S. Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question. Most important guide ever: Newbie's Guide to Switches
|
|
|
|
|
|
|
|
  |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
RPG RPG Revolution is an Privacy
Policy and Legal
|
|