Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Custom Menu System!(mock up included)

Ok, so I was trying to make my very first script which was going to be a menu script but unfortunately I couldn?t. So I was wondering if someone could make it for me :D. I think it would be a nice addition to the many Scripts made. Any who pretty much it is a Custom menu system. I included a preview below(it?s a crappy preview but its good enough).



http://img406.imageshack.us/img406/7440/untitledik6.jpg[/IMG]

Pretty much its just like the normal menu except the command thing has been placed on the top and each selection is in a different window. When u press left it goes to the next window?
 
I'll take it if you want a SDK2.2 version.

EDIT: here is your CMS
Code:
#==============================================================================
# ** ichabod's CMS
#------------------------------------------------------------------------------
# Tibuda
# 1.00
# 04.28.2007
# SDK Version : 2.2
#==============================================================================

#--------------------------------------------------------------------------
# * SDK Log Script
#--------------------------------------------------------------------------
SDK.log('ichabod\'s CMS', 'tibuda', 1, '04.28.2007')
SDK.check_requirements(2.2, [1, 3])
#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if SDK.enabled?('ichabod\'s CMS')
#==============================================================================
class Window_MenuStatus
  #--------------------------------------------------------------------------
  def oh
    return (self.height - 32) / 4
  end
  #--------------------------------------------------------------------------
  SDK.log_overwrite(:Window_MenuStatus, :initialize)
  def initialize
    super(0, 64, 480, 416)
    @item_max = $game_party.actors.size
    self.contents = Bitmap.new(width - 32, @item_max * oh)
    refresh
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  def draw_actor(i)
    x = 64
    y = i * oh
    actor = $game_party.actors[i]
    draw_actor_graphic(actor, x - 40, y + 80)
    draw_actor_name(actor, x, y)
    draw_actor_class(actor, x + 144, y)
    draw_actor_level(actor, x, y + 32)
    draw_actor_state(actor, x + 90, y + 32)
    draw_actor_exp(actor, x, y + 64)
    draw_actor_hp(actor, x + 236, y + 32)
    draw_actor_sp(actor, x + 236, y + 64)
  end
  #--------------------------------------------------------------------------
  SDK.log_overwrite(:Window_MenuStatus, :refresh)
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      draw_actor(i)
    end
  end
  #--------------------------------------------------------------------------
  SDK.log_overwrite(:Window_MenuStatus, :update_cursor_rect)
  def update_cursor_rect
    super
  end
  #--------------------------------------------------------------------------
end
#==============================================================================
class Scene_Menu
  #--------------------------------------------------------------------------
  alias_method :ichabod_cms_scnmenu_main_cmdwin, :main_command_window
  def main_command_window
    ichabod_cms_scnmenu_main_cmdwin
    @command_window.visible = false
    w = 640 / @command_window.commands.size
    @command_windows = []
    @last_index = @command_window.index
    for i in 0...@command_window.commands.size
      command = @command_window.commands[i]
      window = Window_Command.new(w, [command])
      window.x = w * i
      window.active = i == @last_index
      window.index  = i == @last_index ? 0 : -1
      @command_windows << window
    end
  end
  #--------------------------------------------------------------------------
  alias_method :ichabod_cms_scnmenu_update_cmd, :update_command
  def update_command
    ichabod_cms_scnmenu_update_cmd
    if @command_window.active
      if Input.trigger?(Input::RIGHT)
        @command_window.index = [@command_window.index+1,@command_window.commands.size-1].min
      elsif Input.trigger?(Input::LEFT)
        @command_window.index = [@command_window.index-1,0].max
      end
      if @command_window.index != @last_index
        @command_windows[@last_index].index  = -1
        @command_windows[@last_index].active = false
        @last_index = @command_window.index
        @command_windows[@last_index].index  = 0
        @command_windows[@last_index].active = true
      end
    end
  end
  #--------------------------------------------------------------------------
  alias_method :ichabod_cms_scnmenu_main_win, :main_window
  def main_window
    ichabod_cms_scnmenu_main_win
    @status_window.y   = 64
    @playtime_window.y = 64
    @steps_window.y    = 160
    @gold_window.y     = 256
  end
  #--------------------------------------------------------------------------
end
#==============================================================================
#--------------------------------------------------------------------------
# * SDK End
#--------------------------------------------------------------------------
end
It requires SDK2.2 parts I & III and this window selectable from SephirothSpawn:
Code:
#==============================================================================
# ** Window_Selectable
#==============================================================================
class Window_Selectable < Window_Base
  #-------------------------------------------------------------------------
  #   Name:      oh
  #   Info:      Used to determine row height. This is used to overwrite
  #              the top_row, top_row=, page_row_max & update_cursor_rect
  #              methods replacing the constant 32 with a variable amout.
  #   Author:    SephirothSpawn
  #   Call Info: No Arguments
  #   Returns:   Returns Command Offset Height
  #-------------------------------------------------------------------------
  def oh
    return 32
  end
  #--------------------------------------------------------------------------
  # * Get Top Row
  #--------------------------------------------------------------------------
  def top_row
    return self.oy / self.oh
  end
  #--------------------------------------------------------------------------
  # * Set Top Row
  #--------------------------------------------------------------------------
  def top_row=(row)
    self.oy = [[row, 0].max, row_max - 1].min * self.oh
  end
  #--------------------------------------------------------------------------
  # * Get Number of Rows Displayable on 1 Page
  #--------------------------------------------------------------------------
  def page_row_max
    return (self.height - 32) / self.oh
  end
  #--------------------------------------------------------------------------
  # * Update Cursor Rectangle
  #--------------------------------------------------------------------------
  def update_cursor_rect
    # If cursor position is less than 0
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # Get current row
    row = @index / @column_max
    # If current row is before top row
    if row < self.top_row
      # Scroll so that current row becomes top row
      self.top_row = row
    end
    # If current row is more to back than back row
    if row > self.top_row + (self.page_row_max - 1)
      # Scroll so that current row becomes back row
      self.top_row = row - (self.page_row_max - 1)
    end
    # Calculate cursor width
    cursor_width = self.width / @column_max - 32
    # Calculate cursor coordinates
    x = @index % @column_max * (cursor_width + 32)
    y = @index / @column_max * self.oh - self.oy
    # Update cursor rectangle
    self.cursor_rect.set(x, y, cursor_width, self.oh)
  end
end
 
Try this
Code:
#==============================================================================
# ** ichabod's CMS
#------------------------------------------------------------------------------
# Tibuda
# 1.10
# 04.28.2007
# SDK Version : 2.2
#==============================================================================

#--------------------------------------------------------------------------
# * SDK Log Script
#--------------------------------------------------------------------------
SDK.log('ichabod\'s CMS', 'tibuda', 1.10, '04.28.2007')
SDK.check_requirements(2.2, [1, 3])
#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if SDK.enabled?('ichabod\'s CMS')
#==============================================================================
class Window_MenuStatus
  #--------------------------------------------------------------------------
  def oh
    return (self.height - 32) / 4
  end
  #--------------------------------------------------------------------------
  SDK.log_overwrite(:Window_MenuStatus, :initialize)
  def initialize
    super(0, 64, 480, 416)
    @item_max = $game_party.actors.size
    self.contents = Bitmap.new(width - 32, @item_max * oh)
    refresh
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  def draw_actor(i)
    x = 64
    y = i * oh
    actor = $game_party.actors[i]
    draw_actor_graphic(actor, x - 40, y + 80)
    draw_actor_name(actor, x, y)
    draw_actor_class(actor, x + 144, y)
    draw_actor_level(actor, x, y + 32)
    draw_actor_state(actor, x + 90, y + 32)
    draw_actor_exp(actor, x, y + 64)
    draw_actor_hp(actor, x + 236, y + 32)
    draw_actor_sp(actor, x + 236, y + 64)
  end
  #--------------------------------------------------------------------------
  SDK.log_overwrite(:Window_MenuStatus, :refresh)
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      draw_actor(i)
    end
  end
  #--------------------------------------------------------------------------
  SDK.log_overwrite(:Window_MenuStatus, :update_cursor_rect)
  def update_cursor_rect
    super
  end
  #--------------------------------------------------------------------------
end
#==============================================================================
class Scene_Menu
  #--------------------------------------------------------------------------
  alias_method :ichabod_cms_scnmenu_main_cmdwin, :main_command_window
  def main_command_window
    ichabod_cms_scnmenu_main_cmdwin
    @command_window.visible = false
    w = 640 / @command_window.commands.size
    @command_windows = []
    @last_index = @command_window.index
    for i in 0...@command_window.commands.size
      command = @command_window.commands[i]
      window = Window_Command.new(w, [command])
      window.x = w * i
      window.active = i == @last_index
      window.index  = i == @last_index ? 0 : -1
      if i == @last_index
        window.width += 16
        window.z     += 1
        if i > 0
          window.x     -= 16
          window.width += 16 if i < @command_window.commands.size
        end
        window.refresh
      end
      @command_windows << window
    end
  end
  #--------------------------------------------------------------------------
  alias_method :ichabod_cms_scnmenu_update_cmd, :update_command
  def update_command
    ichabod_cms_scnmenu_update_cmd
    if @command_window.active
      if Input.trigger?(Input::RIGHT)
        @command_window.index = [@command_window.index+1,@command_window.commands.size-1].min
      elsif Input.trigger?(Input::LEFT)
        @command_window.index = [@command_window.index-1,0].max
      end
      if @command_window.index != @last_index
        @command_windows[@last_index].index  = -1
        @command_windows[@last_index].active = false
        @command_windows[@last_index].width -= ((@last_index == 0 ||
            @last_index == @command_window.commands.size - 1) ? 16 : 32)
        @command_windows[@last_index].x = @last_index * @command_windows[@last_index].width
        @command_windows[@last_index].z -= 1
        @command_windows[@last_index].refresh
        @last_index = @command_window.index
        @command_windows[@last_index].index  = 0
        @command_windows[@last_index].active = true
        @command_windows[@last_index].width += ((@last_index == 0 ||
            @last_index == @command_window.commands.size - 1) ? 16 : 32)
        @command_windows[@last_index].x -= 16 if @last_index > 0
        @command_windows[@last_index].z += 1
        @command_windows[@last_index].refresh
      end
    end
  end
  #--------------------------------------------------------------------------
  alias_method :ichabod_cms_scnmenu_main_win, :main_window
  def main_window
    ichabod_cms_scnmenu_main_win
    @status_window.y   = 64
    @playtime_window.y = 64
    @steps_window.y    = 160
    @gold_window.y     = 256
  end
  #--------------------------------------------------------------------------
end
#==============================================================================
#--------------------------------------------------------------------------
# * SDK End
#--------------------------------------------------------------------------
end
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top