CMS Re-Write

Started by PhoenixFire, December 27, 2013, 02:07:26 am

Previous topic - Next topic

PhoenixFire

December 27, 2013, 02:07:26 am Last Edit: July 26, 2014, 02:11:58 pm by PhoenixFire
3 Character CMS
Authors: Shinami, Red Eye Dragoon, DigitalSoul
Version: 0.1
Type: Custom Menu System
Key Term: Custom Menu System



Introduction

  The original version of this is NOT written by me, and I am simply re-writing the CMS made by Shinami over on RMRK.net, and in doing so, hoping to learn more about scripting. So what did I do? Well, I've been messing around with the colors of it, and, adapting it away from how it was originally 'installed'. In the first version, you had to copy and paste over all of the scripts it rewrites, and add about three or four scripts separately. This script combines it all into one big re-write, which means you don't lose the original scripts if you decide to get rid of the CMS script. I have also started working on the way it displays certain stats, and where they are displayed. The original version was VERY cluttered, and displayed WAY too much information. I have dropped that down to some of the essentials, and will continue to modify this until it looks even better.


Features


  • Gives you more information about your character, with a quick glance at the pause menu.

  • Visually more attractive than the standard pause menu.

  • Customizable colors and menu items.

  • Incorporates all edits and class re-writes into one script, allowing you to easily install or uninstall the CMS from your game.




Screenshots

Coming soon.



Demo

None at the moment; I have been working on other things, and the link on this seems to be broken. If you reeealllly need a demo, pm me and I'll see what I can do.




Script

Spoiler: ShowHide


#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# 3-Character CMS
# Authors: Shinami, Red Eye Dragoon, DigitalSoul
# Version: 1.01
# Type: Custom Menu System
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#  
#  This work is protected by the following license:
# #----------------------------------------------------------------------------
# #  
# #  Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
# #  ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )
# #  
# #  You are free:
# #  
# #  to Share - to copy, distribute and transmit the work
# #  to Remix - to adapt the work
# #  
# #  Under the following conditions:
# #  
# #  Attribution. You must attribute the work in the manner specified by the
# #  author or licensor (but not in any way that suggests that they endorse you
# #  or your use of the work).
# #  
# #  Noncommercial. You may not use this work for commercial purposes.
# #  
# #  Share alike. If you alter, transform, or build upon this work, you may
# #  distribute the resulting work only under the same or similar license to
# #  this one.
# #  
# #  - For any reuse or distribution, you must make clear to others the license
# #    terms of this work. The best way to do this is with a link to this web
# #    page.
# #  
# #  - Any of the above conditions can be waived if you get permission from the
# #    copyright holder.
# #  
# #  - Nothing in this license impairs or restricts the author's moral rights.
# #  
# #----------------------------------------------------------------------------
#   How to use this script :
#  
#   Place above Main and below any other scripts that re-write Window_Base,
#   Window_Command, Window_MenuStatus, Scene_Title, Scene_Menu. The script
#   re-writes these itself, and as such, it may cause issues.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
class Window_Base < Window

   def initialize(x, y, width, height)
   super()
   @windowskin_name = $game_system.windowskin_name
   self.windowskin = RPG::Cache.windowskin(@windowskin_name)
   self.x = x
   self.y = y
   self.width = width
   self.height = height
   self.z = 100
 end
 
 def draw_actor_face(actor, x, y)
   face = RPG::Cache.character("Faces/" + actor.character_name, actor.character_hue)
   fw = face.width
   fh = face.height
   src_rect = Rect.new(0, 0, fw, fh)
   self.contents.blt(x - fw / 23, y - fh, face, src_rect)
 end
 
def draw_actor_battler_graphic(actor, x, y)
  bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
  cw = bitmap.width
  ch = bitmap.height
  src_rect = Rect.new(0, 0, cw, ch)
  self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
 #--------------------------------------------------------------------------
 # * Dispose
 #--------------------------------------------------------------------------
 def dispose
   # Dispose if window contents bit map is set
   if self.contents != nil
     self.contents.dispose
   end
   super
 end
 #--------------------------------------------------------------------------
 # * Get Text Color
 #     n : text color number (0-7)
 #--------------------------------------------------------------------------
 def text_color(n)
   case n
   when 0
     return Color.new(255, 255, 255, 255)
   when 1
     return Color.new(128, 128, 255, 255)
   when 2
     return Color.new(255, 128, 128, 255)
   when 3
     return Color.new(128, 255, 128, 255)
   when 4
     return Color.new(128, 255, 255, 255)
   when 5
     return Color.new(255, 128, 255, 255)
   when 6
     return Color.new(255, 255, 128, 255)
   when 7
     return Color.new(192, 192, 192, 255)
   else
     normal_color
   end
 end
 #--------------------------------------------------------------------------
 # * Get Text Color Definitions
 #--------------------------------------------------------------------------
 def normal_color
   return Color.new(51, 255, 0, 255)
 end
 def disabled_color
   return Color.new(255, 255, 255, 195)
 end
 def system_color
   return Color.new(51, 255, 0, 255)
 end
 def crisis_color
   return Color.new(255, 255, 64, 255)
 end
 def knockout_color
   return Color.new(255, 64, 0)
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
   super
   # Reset if windowskin was changed
   if $game_system.windowskin_name != @windowskin_name
     @windowskin_name = $game_system.windowskin_name
     self.windowskin = RPG::Cache.windowskin(@windowskin_name)
   end
 end
 #--------------------------------------------------------------------------
 # * Draw Graphic
 #     actor : actor
 #     x     : draw spot x-coordinate
 #     y     : draw spot y-coordinate
 #--------------------------------------------------------------------------
 def draw_actor_graphic(actor, x, y)
   bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
   cw = bitmap.width / 4
   ch = bitmap.height / 4
   src_rect = Rect.new(0, 0, cw, ch)
   self.contents.blt(x - cw / 2, y - ch / 2, bitmap, src_rect) #self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
 end
 #--------------------------------------------------------------------------
 # * Draw Name
 #     actor : actor
 #     x     : draw spot x-coordinate
 #     y     : draw spot y-coordinate
 #--------------------------------------------------------------------------
 def draw_actor_name(actor, x, y)
   self.contents.font.color = normal_color
   self.contents.draw_text(x, y, 120, 32, actor.name)
 end
 
 #--------------------------------------------------------------------------
 # * Draw Class
 #     actor : actor
 #     x     : draw spot x-coordinate
 #     y     : draw spot y-coordinate
 #--------------------------------------------------------------------------
 def draw_actor_class(actor, x, y)
   self.contents.font.color = normal_color
   self.contents.draw_text(x, y, 236, 32, actor.class_name)
 end
 #--------------------------------------------------------------------------
 # * Draw Level
 #     actor : actor
 #     x     : draw spot x-coordinate
 #     y     : draw spot y-coordinate
 #--------------------------------------------------------------------------
 def draw_actor_level(actor, x, y)
   self.contents.font.color = system_color
   self.contents.draw_text(x, y, 32, 32, "Lv")
   self.contents.font.color = normal_color
   self.contents.draw_text(x + 32, y, 24, 32, actor.level.to_s, 2)
 end
 
 def draw_actor_nlevel(actor, x, y)
   self.contents.font.color = system_color
   self.contents.draw_text(x, y, 55, 32, "Next Level")
   self.contents.font.color = normal_color
   self.contents.draw_text(x + 60, y, 60, 32, @actor.next_rest_exp_s, 2)
 end  
 
 #--------------------------------------------------------------------------
 # * Make State Text String for Drawing
 #     actor       : actor
 #     width       : draw spot width
 #     need_normal : Whether or not [normal] is needed (true / false)
 #--------------------------------------------------------------------------
 def make_battler_state_text(battler, width, need_normal)
   # Get width of brackets
   brackets_width = self.contents.text_size("[]").width
   # Make text string for state names
   text = ""
   for i in battler.states
     if $data_states[i].rating >= 1
       if text == ""
         text = $data_states[i].name
       else
         new_text = text + "/" + $data_states[i].name
         text_width = self.contents.text_size(new_text).width
         if text_width > width - brackets_width
           break
         end
         text = new_text
       end
     end
   end
   # If text string for state names is empty, make it [normal]
   if text == ""
     if need_normal
       text = "[Normal]"
     end
   else
     # Attach brackets
     text = "[" + text + "]"
   end
   # Return completed text string
   return text
 end
 #--------------------------------------------------------------------------
 # * Draw State
 #     actor : actor
 #     x     : draw spot x-coordinate
 #     y     : draw spot y-coordinate
 #     width : draw spot width
 #--------------------------------------------------------------------------
 def draw_actor_state(actor, x, y, width = 120)
   text = make_battler_state_text(actor, width, true)
   self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color
   self.contents.draw_text(x, y, width, 32, text)
 end
 #--------------------------------------------------------------------------
 # * Draw EXP
 #     actor : actor
 #     x     : draw spot x-coordinate
 #     y     : draw spot y-coordinate
 #--------------------------------------------------------------------------  
 def draw_actor_exp(actor, x, y)
   self.contents.font.color = system_color
   self.contents.draw_text(x, y, 24, 32, "Exp")
   self.contents.font.color = normal_color
   self.contents.draw_text(x + 25, y, 84, 32, actor.exp_s, 2)
 end  
 #--------------------------------------------------------------------------
 # * Draw HP
 #     actor : actor
 #     x     : draw spot x-coordinate
 #     y     : draw spot y-coordinate
 #     width : draw spot width
 #--------------------------------------------------------------------------
 def draw_actor_hp(actor, x, y, width = 144)
   # Draw "HP" text string
   self.contents.font.color = system_color
   self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
   # Calculate if there is draw space for MaxHP
   if width - 32 >= 108
     hp_x = x + width - 108
     flag = true
   elsif width - 32 >= 48
     hp_x = x + width - 48
     flag = false
   end
   # Draw HP
   self.contents.font.color = actor.hp == 0 ? knockout_color :
     actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
   self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
   # Draw MaxHP
   if flag
     self.contents.font.color = normal_color
     self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
     self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
   end
 end
 #--------------------------------------------------------------------------
 # * Draw SP
 #     actor : actor
 #     x     : draw spot x-coordinate
 #     y     : draw spot y-coordinate
 #     width : draw spot width
 #--------------------------------------------------------------------------
 def draw_actor_sp(actor, x, y, width = 144)
   # Draw "SP" text string
   self.contents.font.color = system_color
   self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
   # Calculate if there is draw space for MaxHP
   if width - 32 >= 108
     sp_x = x + width - 108
     flag = true
   elsif width - 32 >= 48
     sp_x = x + width - 48
     flag = false
   end
   # Draw SP
   self.contents.font.color = actor.sp == 0 ? knockout_color :
     actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
   self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
   # Draw MaxSP
   if flag
     self.contents.font.color = normal_color
     self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
     self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
   end
 end
 #--------------------------------------------------------------------------
 # * Draw Parameter
 #     actor : actor
 #     x     : draw spot x-coordinate
 #     y     : draw spot y-coordinate
 #     type  : parameter type (0-6)
 #--------------------------------------------------------------------------
 def draw_actor_parameter(actor, x, y, type)
   case type
   when 0
     parameter_name = $data_system.words.atk
     parameter_value = actor.atk
   when 1
     parameter_name = $data_system.words.pdef
     parameter_value = actor.pdef
   when 2
     parameter_name = $data_system.words.mdef
     parameter_value = actor.mdef
   when 3
     parameter_name = $data_system.words.str
     parameter_value = actor.str
   when 4
     parameter_name = $data_system.words.dex
     parameter_value = actor.dex
   when 5
     parameter_name = $data_system.words.agi
     parameter_value = actor.agi
   when 6
     parameter_name = $data_system.words.int
     parameter_value = actor.int
   end
   self.contents.font.color = system_color
   self.contents.draw_text(x, y, 120, 32, parameter_name)
   self.contents.font.color = normal_color
   self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
 end
 #--------------------------------------------------------------------------
 # * Draw Item Name
 #     item : item
 #     x    : draw spot x-coordinate
 #     y    : draw spot y-coordinate
 #--------------------------------------------------------------------------
 def draw_item_name(item, x, y)
   if item == nil
     return
   end
   bitmap = RPG::Cache.icon(item.icon_name)
   self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
   self.contents.font.color = normal_color
   self.contents.draw_text(x + 28, y, 212, 32, item.name)
 end
end


#==============================================================================
# ** Window_Command
#------------------------------------------------------------------------------
#  This window deals with general command choices.
#==============================================================================

class Window_Command < Window_Selectable
 #--------------------------------------------------------------------------
 # * Object Initialization
 #     width    : window width
 #     commands : command text string array
 #--------------------------------------------------------------------------
 def initialize(width, commands)
   # Compute window height from command quantity
   super(480, 0, width, commands.size * 32 + 32)
   @item_max = commands.size
   @commands = commands
   self.contents = Bitmap.new(width - 32, @item_max * 32)
   refresh
   self.index = 0
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
   self.contents.clear
   for i in 0...@item_max
     draw_item(i, normal_color)
   end
 end
 #--------------------------------------------------------------------------
 # * Draw Item
 #     index : item number
 #     color : text color
 #--------------------------------------------------------------------------
 def draw_item(index, color)
   self.contents.font.color = color
   rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
   self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
   self.contents.draw_text(rect, @commands[index])
 end
 #--------------------------------------------------------------------------
 # * Disable Item
 #     index : item number
 #--------------------------------------------------------------------------
 def disable_item(index)
   draw_item(index, disabled_color)
 end
end



class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# Set up the window
#--------------------------------------------------------------------------
def initialize
  super(0, 0, 480, 420)  
  self.contents = Bitmap.new(width - 32, height - 32)
  self.contents.font.name = "Tahoma"
  self.contents.font.size = 24
  refresh
  self.active = false
  self.index = -1
end
#--------------------------------------------------------------------------
# Draws info on the screen
#--------------------------------------------------------------------------
def refresh
   self.contents.clear
  @item_max = $game_party.actors.size
 
  for i in 0...$game_party.actors.size
    x = i * 150
    y = 0
    actor = $game_party.actors[i]
    @actor = $game_party.actors[i]
    #draw_actor_face(actor, x, y) this is for drawing actor faces
    #draw_actor_graphic(actor, x, y)  this is for drawing the actor graphics
    draw_actor_battler_graphic(actor, x + 70, y + 220)
    draw_actor_name(actor, x, y - 8)
    draw_actor_level(actor, x, y + 210)
    draw_actor_hp(actor, x, y + 240)
    draw_actor_sp(actor, x, y + 260)
    draw_actor_exp(actor, x, y + 290)
    draw_actor_nlevel(actor, x, y + 320)
    draw_item_name($data_weapons[@actor.weapon_id], x - 2, 350)
 end
end


#--------------------------------------------------------------------------
# Update of Cursor
#--------------------------------------------------------------------------
def update_cursor_rect
  if @index < 0
    self.cursor_rect.empty
  else
    self.cursor_rect.set(@index * 148, 0, self.width - 334, 280)
  end
end
end



#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
#  This class performs title screen processing.
#==============================================================================

class Scene_Title
$map_infos = load_data("Data/MapInfos.rxdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end
 #--------------------------------------------------------------------------
 # * Main Processing
 #--------------------------------------------------------------------------
 def main
   # If battle test
   if $BTEST
     battle_test
     return
   end
   # Load database
   $data_actors        = load_data("Data/Actors.rxdata")
   $data_classes       = load_data("Data/Classes.rxdata")
   $data_skills        = load_data("Data/Skills.rxdata")
   $data_items         = load_data("Data/Items.rxdata")
   $data_weapons       = load_data("Data/Weapons.rxdata")
   $data_armors        = load_data("Data/Armors.rxdata")
   $data_enemies       = load_data("Data/Enemies.rxdata")
   $data_troops        = load_data("Data/Troops.rxdata")
   $data_states        = load_data("Data/States.rxdata")
   $data_animations    = load_data("Data/Animations.rxdata")
   $data_tilesets      = load_data("Data/Tilesets.rxdata")
   $data_common_events = load_data("Data/CommonEvents.rxdata")
   $data_system        = load_data("Data/System.rxdata")
   # Make system object
   $game_system = Game_System.new
   # Make title graphic
   @sprite = Sprite.new
   @sprite.bitmap = RPG::Cache.title($data_system.title_name)
   # Make command window
   s1 = "New Game"
   s2 = "Load Game"
   s3 = "Exit Game"
   @command_window = Window_Command.new(192, [s1, s2, s3])
   @command_window.back_opacity = 160
   @command_window.x = 320 - @command_window.width / 2
   @command_window.y = 288
   # Continue enabled determinant
   # Check if at least one save file exists
   # If enabled, make @continue_enabled true; if disabled, make it false
   @continue_enabled = false
   for i in 0..3
     if FileTest.exist?("Save#{i+1}.rxdata")
       @continue_enabled = true
     end
   end
   # If continue is enabled, move cursor to "Continue"
   # If disabled, display "Continue" text in gray
   if @continue_enabled
     @command_window.index = 1
   else
     @command_window.disable_item(1)
   end
   # Play title BGM
   $game_system.bgm_play($data_system.title_bgm)
   # Stop playing ME and BGS
   Audio.me_stop
   Audio.bgs_stop
   # 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 command window
   @command_window.dispose
   # Dispose of title graphic
   @sprite.bitmap.dispose
   @sprite.dispose
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
   # Update command window
   @command_window.update
   # If C button was pressed
   if Input.trigger?(Input::C)
     # Branch by command window cursor position
     case @command_window.index
     when 0  # New game
       command_new_game
     when 1  # Continue
       command_continue
     when 2  # Shutdown
       command_shutdown
     end
   end
 end
 #--------------------------------------------------------------------------
 # * Command: New Game
 #--------------------------------------------------------------------------
 def command_new_game
   # Play decision SE
   $game_system.se_play($data_system.decision_se)
   # Stop BGM
   Audio.bgm_stop
   # Reset frame count for measuring play time
   Graphics.frame_count = 0
   # Make each type of game object
   $game_temp          = Game_Temp.new
   $game_system        = Game_System.new
   $game_switches      = Game_Switches.new
   $game_variables     = Game_Variables.new
   $game_self_switches = Game_SelfSwitches.new
   $game_screen        = Game_Screen.new
   $game_actors        = Game_Actors.new
   $game_party         = Game_Party.new
   $game_troop         = Game_Troop.new
   $game_map           = Game_Map.new
   $game_player        = Game_Player.new
   # Set up initial party
   $game_party.setup_starting_members
   # Set up initial map position
   $game_map.setup($data_system.start_map_id)
   # Move player to initial position
   $game_player.moveto($data_system.start_x, $data_system.start_y)
   # Refresh player
   $game_player.refresh
   # Run automatic change for BGM and BGS set with map
   $game_map.autoplay
   # Update map (run parallel process event)
   $game_map.update
   # Switch to map screen
   $scene = Scene_Map.new
 end
 #--------------------------------------------------------------------------
 # * Command: Continue
 #--------------------------------------------------------------------------
 def command_continue
   # If continue is disabled
   unless @continue_enabled
     # Play buzzer SE
     $game_system.se_play($data_system.buzzer_se)
     return
   end
   # Play decision SE
   $game_system.se_play($data_system.decision_se)
   # Switch to load screen
   $scene = Scene_Load.new
 end
 #--------------------------------------------------------------------------
 # * Command: Shutdown
 #--------------------------------------------------------------------------
 def command_shutdown
   # Play decision SE
   $game_system.se_play($data_system.decision_se)
   # Fade out BGM, BGS, and ME
   Audio.bgm_fade(800)
   Audio.bgs_fade(800)
   Audio.me_fade(800)
   # Shutdown
   $scene = nil
 end
 #--------------------------------------------------------------------------
 # * Battle Test
 #--------------------------------------------------------------------------
 def battle_test
   # Load database (for battle test)
   $data_actors        = load_data("Data/BT_Actors.rxdata")
   $data_classes       = load_data("Data/BT_Classes.rxdata")
   $data_skills        = load_data("Data/BT_Skills.rxdata")
   $data_items         = load_data("Data/BT_Items.rxdata")
   $data_weapons       = load_data("Data/BT_Weapons.rxdata")
   $data_armors        = load_data("Data/BT_Armors.rxdata")
   $data_enemies       = load_data("Data/BT_Enemies.rxdata")
   $data_troops        = load_data("Data/BT_Troops.rxdata")
   $data_states        = load_data("Data/BT_States.rxdata")
   $data_animations    = load_data("Data/BT_Animations.rxdata")
   $data_tilesets      = load_data("Data/BT_Tilesets.rxdata")
   $data_common_events = load_data("Data/BT_CommonEvents.rxdata")
   $data_system        = load_data("Data/BT_System.rxdata")
   # Reset frame count for measuring play time
   Graphics.frame_count = 0
   # Make each game object
   $game_temp          = Game_Temp.new
   $game_system        = Game_System.new
   $game_switches      = Game_Switches.new
   $game_variables     = Game_Variables.new
   $game_self_switches = Game_SelfSwitches.new
   $game_screen        = Game_Screen.new
   $game_actors        = Game_Actors.new
   $game_party         = Game_Party.new
   $game_troop         = Game_Troop.new
   $game_map           = Game_Map.new
   $game_player        = Game_Player.new
   # Set up party for battle test
   $game_party.setup_battle_test_members
   # Set troop ID, can escape flag, and battleback
   $game_temp.battle_troop_id = $data_system.test_troop_id
   $game_temp.battle_can_escape = true
   $game_map.battleback_name = $data_system.battleback_name
   # Play battle start SE
   $game_system.se_play($data_system.battle_start_se)
   # Play battle BGM
   $game_system.bgm_play($game_system.battle_bgm)
   # Switch to battle screen
   $scene = Scene_Battle.new
 end
end



#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs menu screen processing.
#==============================================================================

class Scene_Menu
 #--------------------------------------------------------------------------
 # * Object Initialization
 #     menu_index : command cursor's initial position
 #--------------------------------------------------------------------------
 def initialize(menu_index = 0)
   @menu_index = menu_index
 end
 #--------------------------------------------------------------------------
 # * Main Processing
 #--------------------------------------------------------------------------
 def main
   # Make command window
   s1 = $data_system.words.item
   s2 = $data_system.words.skill
   s3 = $data_system.words.equip
   s4 = "Status"
   s5 = "Save"
   s6 = "Load"
   s7 = "End Game"
   @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
   @command_window.index = @menu_index
   # If number of party members is 0
   if $game_party.actors.size == 0
     # Disable items, skills, equipment, and status
     @command_window.disable_item(0)
     @command_window.disable_item(1)
     @command_window.disable_item(2)
     @command_window.disable_item(3)
   end
   # If save is forbidden
   if $game_system.save_disabled
     # Disable save
     @command_window.disable_item(4)
   end
   # Make play time window
   @playtime_window = Window_PlayTime.new
   @playtime_window.x = 480
   @playtime_window.y = 255
   # Make steps window
   @steps_window = Window_Steps.new
   @steps_window.x = 480
   @steps_window.y = 340
   # Make status window
   @status_window = Window_MenuStatus.new
   @status_window.x = 0
   @status_window.y = 0
   #makes dummy window with icons
   @dummy_window = Window_Dummy.new
   @dummy_window.x = 480
   @dummy_window.y = 0
   #makes location window
   @map = Window_Mapname.new
   @map.x = 0
   @map.y = 420
   # 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
   @command_window.dispose
   @playtime_window.dispose
   @steps_window.dispose
   @status_window.dispose
   @map.dispose
   @dummy_window.dispose
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
   # Update windows
   @command_window.update
   @playtime_window.update
   @steps_window.update
   @status_window.update
   @map.update
   @dummy_window.update
   # If command window is active: call update_command
   if @command_window.active
     update_command
     return
   end
   # If status window is active: call update_status
   if @status_window.active
     update_status
     return
   end
 end
 #--------------------------------------------------------------------------
 # * Frame Update (when command window is active)
 #--------------------------------------------------------------------------
 def update_command
   # If B button was pressed
   if Input.trigger?(Input::B)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
     # Switch to map screen
     $scene = Scene_Map.new
     return
   end
   # If C button was pressed
   if Input.trigger?(Input::C)
     # If command other than save or end game, and party members = 0
     if $game_party.actors.size == 0 and @command_window.index < 4
       # Play buzzer SE
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     # Branch by command window cursor position
     case @command_window.index
     when 0  # item
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to item screen
       $scene = Scene_Item.new
     when 1  # skill
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Make status window active
       @command_window.active = false
       @status_window.active = true
       @status_window.index = 0
     when 2  # equipment
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Make status window active
       @command_window.active = false
       @status_window.active = true
       @status_window.index = 0
       when 3  # status
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Make status window active
       @command_window.active = false
       @status_window.active = true
       @status_window.index = 0
     when 4  # save
       # If saving is forbidden
       if $game_system.save_disabled
         # Play buzzer SE
         $game_system.se_play($data_system.buzzer_se)
         return
       end
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to save screen
       $scene = Scene_Save.new
     when 5  # end game
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       $scene =  Dummy_Load.new
     when 6  # end game
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to end game screen
       $scene = Scene_End.new
     end
     return
   end
 end
 #--------------------------------------------------------------------------
 # * Frame Update (when status window is active)
 #--------------------------------------------------------------------------
 def update_status
   # If B button was pressed
   if Input.trigger?(Input::B)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
     # Make command window active
     @command_window.active = true
     @status_window.active = false
     @status_window.index = -1
     return
   end
   # If C button was pressed
   if Input.trigger?(Input::C)
     # Branch by command window cursor position
     case @command_window.index
     when 1  # skill
       # If this actor's action limit is 2 or more
       if $game_party.actors[@status_window.index].restriction >= 2
         # Play buzzer SE
         $game_system.se_play($data_system.buzzer_se)
         return
       end
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to skill screen
       $scene = Scene_Skill.new(@status_window.index)
     when 2  # equipment
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to equipment screen
       $scene = Scene_Equip.new(@status_window.index)
     when 3  # status
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to status screen
       $scene = Scene_Status.new(@status_window.index)
     end
     return
   end
 end
end



#==============================================================================
# ** Scene_Load
#------------------------------------------------------------------------------
#  This class performs load screen processing.
#==============================================================================

class Dummy_Load < Scene_File
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
   # Remake temporary object
   $game_temp = Game_Temp.new
   # Timestamp selects new file
   $game_temp.last_file_index = 0
   latest_time = Time.at(0)
   for i in 0..3
     filename = make_filename(i)
     if FileTest.exist?(filename)
       file = File.open(filename, "r")
       if file.mtime > latest_time
         latest_time = file.mtime
         $game_temp.last_file_index = i
       end
       file.close
     end
   end
   super("Which file would you like to load?")
 end
 #--------------------------------------------------------------------------
 # * Decision Processing
 #--------------------------------------------------------------------------
 def on_decision(filename)
   # If file doesn't exist
   unless FileTest.exist?(filename)
     # Play buzzer SE
     $game_system.se_play($data_system.buzzer_se)
     return
   end
   # Play load SE
   $game_system.se_play($data_system.load_se)
   # Read save data
   file = File.open(filename, "rb")
   read_save_data(file)
   file.close
   # Restore BGM and BGS
   $game_system.bgm_play($game_system.playing_bgm)
   $game_system.bgs_play($game_system.playing_bgs)
   # Update map (run parallel process event)
   $game_map.update
   # Switch to map screen
   $scene = Scene_Map.new
 end
 #--------------------------------------------------------------------------
 # * Cancel Processing
 #--------------------------------------------------------------------------
 def on_cancel
   # Play cancel SE
   $game_system.se_play($data_system.cancel_se)
   # Switch to title screen
   $scene = Scene_Menu.new(5)
 end
 #--------------------------------------------------------------------------
 # * Read Save Data
 #     file : file object for reading (opened)
 #--------------------------------------------------------------------------
 def read_save_data(file)
   # Read character data for drawing save file
   characters = Marshal.load(file)
   # Read frame count for measuring play time
   Graphics.frame_count = Marshal.load(file)
   # Read each type of game object
   $game_system        = Marshal.load(file)
   $game_switches      = Marshal.load(file)
   $game_variables     = Marshal.load(file)
   $game_self_switches = Marshal.load(file)
   $game_screen        = Marshal.load(file)
   $game_actors        = Marshal.load(file)
   $game_party         = Marshal.load(file)
   $game_troop         = Marshal.load(file)
   $game_map           = Marshal.load(file)
   $game_player        = Marshal.load(file)
   # If magic number is different from when saving
   # (if editing was added with editor)
   if $game_system.magic_number != $data_system.magic_number
     # Load map
     $game_map.setup($game_map.map_id)
     $game_player.center($game_player.x, $game_player.y)
   end
   # Refresh party members
   $game_party.refresh
 end
end



class Window_Dummy < Window_Base
 def initialize
  super(480, 0, 160, 255)
  self.contents = Bitmap.new(width - 32, height - 32)
  self.contents.font.name = "Tahoma"
  self.contents.font.size = 24
  refresh
end
#--------------------------------------------------------------------------
# Draws info on the screen
#--------------------------------------------------------------------------
def refresh
   self.contents.clear
   bitmap = RPG::Cache.icon("034-Item03")
self.contents.blt(100, 4, bitmap, Rect.new(0, 0, 24, 24))

bitmap = RPG::Cache.icon("050-Skill07")
self.contents.blt(100, 35, bitmap, Rect.new(0, 0, 24, 24))

bitmap = RPG::Cache.icon("013-Body01")
self.contents.blt(100, 70, bitmap, Rect.new(0, 0, 24, 24))

bitmap = RPG::Cache.icon("033-Item02")
self.contents.blt(100, 100, bitmap, Rect.new(0, 0, 24, 24))

bitmap = RPG::Cache.icon("037-Item06")
self.contents.blt(100, 133, bitmap, Rect.new(0, 0, 24, 24))

bitmap = RPG::Cache.icon("039-Item08")
self.contents.blt(100, 164, bitmap, Rect.new(0, 0, 24, 24))

bitmap = RPG::Cache.icon("046-Skill03")
self.contents.blt(100, 195, bitmap, Rect.new(0, 0, 24, 24))

 end
end



#3 Person Custom Menu Script v1.1 written by Shinami
#Written using references from scripts written
#by Constance(his forum is ---> http://www.invisionplus.net/forums/index.php?mforum=rmxp&act=idx)
#and from the FF7 script(for face sets) on the Crankeye forums(http://www.crankeye.com/forums)
#Latest changes:
#1-Added icons to the command window.
#2-Added the choice of using a battler graphic instead of facesets or character graphic.
#3-Added a "Load" option to the main menu
#
#Possible Changes:
#1-A new status screen.
#2-Being able to set the background to look like what you want.*PICTURE WILL BE REQUIRED*
class Window_Mapname < Window_Base

def initialize
super(0, 0, 640, 60)
self.contents = Bitmap.new(width - 52, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 24
refresh
end

def refresh
self.contents.clear

# Map Name
#map = $game_map.name
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 220, 32, "Location")
self.contents.font.color = normal_color
self.contents.draw_text(100, 0, 80, 32, $game_map.name)
#this is gold window
   cx = contents.text_size($data_system.words.gold).width
   self.contents.font.color = normal_color
   self.contents.draw_text(460, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
   self.contents.font.color = system_color
   self.contents.draw_text(580-cx, 0, cx, 32, $data_system.words.gold, 2)
end
end




class Game_Map

def name
$map_infos[@map_id]
end
end



Font.default_name = "Tahoma"





Instructions


Place above Main and any other scripts that re-write Window_Base, Window_Command, Window_MenuStatus, Scene_Title, Scene_Menu. The script re-writes these, so any script that needs to further modify ANY of those, should be placed after this script.



Compatibility

Should work with just about everything, except for other menu systems, and anything that relies on the default classes that it overwrites. I know for sure this works with Tons of Addons, and Kings Tilemap Enhance.



Credits and Thanks


  • Shinami, for the original script, and Red Eye Dragoon for posting it.

  • DigitalSoul - For the edits and improvements.





Author's Notes

Please bear in mind that this is my first script edit of this size. I know it is not 100% optimized yet, nor is it 100% condensed yet. It is definitely a work in progress, and as I learn more about scripting, I will come back and edit this more. I also plan to use this script in the future in a compilation starter kit, along with other class re-writes, so any feedback and suggestions are welcome on this  8)
Quote from: Subsonic_Noise on July 01, 2011, 02:42:19 amNext off, how to create a first person shooter using microsoft excel.

Quote from: Zeriab on September 09, 2011, 02:58:58 pm<Remember when computers had turbo buttons?

PhoenixFire

December 27, 2013, 09:06:00 pm #1 Last Edit: December 27, 2013, 09:45:19 pm by DigitalSoul
Edited the script to properly line up information so it's not all squished on top of each other, and it now looks way better when used with custom battler graphics. Changed all the menu colors to be a little more pleasing to the eye as well.

EDIT: Also uploaded a demo so you can see how it looks without setting it up, including custom character battlers to show how it came out, not using the default RTP (which I guess looks fine too, yanno, if you're into using the RTP and all...)
Quote from: Subsonic_Noise on July 01, 2011, 02:42:19 amNext off, how to create a first person shooter using microsoft excel.

Quote from: Zeriab on September 09, 2011, 02:58:58 pm<Remember when computers had turbo buttons?

G_G

Some screenshots would be nice and following the script template would also make it eligible for the script database.

PhoenixFire

Alrighty, modified the post to follow the template.. I'll get some screenshots at some point soon, I'm just too lazy and tired to do that right now.
Quote from: Subsonic_Noise on July 01, 2011, 02:42:19 amNext off, how to create a first person shooter using microsoft excel.

Quote from: Zeriab on September 09, 2011, 02:58:58 pm<Remember when computers had turbo buttons?