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.

New menu ! (fixed)

vertical status horizontal menu
Version: 1.0

Introduction

new cooler menu
my first script

Features


  • Vertical menu status
    horizontal menu

Screenshots

http://img511.imageshack.us/img511/6863/screeniehorizvertjh7.th.jpg[/img]

Script



Code:
#==============================================================================


#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  This window displays party member status on the menu screen.
#==============================================================================

class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     x : window X coordinate
  #     y : window Y coordinate
  #--------------------------------------------------------------------------
  def initialize(x, y)
    super(0, 57, 544, 302)
    refresh
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.members.size
    for actor in $game_party.members
      draw_actor_face(actor, actor.index * 96 + 2, 2, 92)
      x = actor.index * 97 + WLH / 2
      y = 104
      draw_actor_name(actor, x, y)
      draw_actor_graphic(actor, x + 70, 92)
      draw_actor_class(actor, x , y + 120)
      draw_actor_level(actor, x, y + WLH * 1)
      draw_actor_state(actor, x, y + WLH * 2)
      draw_actor_hp(actor,  x + 5 , y + 60, 60)
      draw_actor_mp(actor, x + 5, y + 80, 60)
    end
  end
  #--------------------------------------------------------------------------
  # * Update cursor
  #--------------------------------------------------------------------------
  def update_cursor
    if @index < 0               # No cursor
      self.cursor_rect.empty
    elsif @index < @item_max    # Normal
      self.cursor_rect.set( @index * 96, 0, 96, 250)
    elsif @index >= 100         # Self
      self.cursor_rect.set(0, (@index - 100) * 96, contents.width, 96)
    else                        # All
      self.cursor_rect.set(0, 0, contents.width, @item_max * 96)
    end
  end
end

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

class Scene_Menu < Scene_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     menu_index : command cursor's initial position
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    create_command_window

    @gold_window = Window_Gold.new(0, 360)
    @status_window = Window_MenuStatus.new(160, 0)
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @command_window.dispose
    @gold_window.dispose
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    @command_window.update
    @gold_window.update
    @status_window.update
    if @command_window.active
      update_command_selection
    elsif @status_window.active
      update_actor_selection
    end
  end
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = Vocab::item
    s2 = Vocab::skill
    s3 = Vocab::equip
    s4 = Vocab::status
    s5 = Vocab::save
    s6 = "End"
    @command_window = Window_Command.new(544, [s1, s2, s3, s4, s5, s6], 6, 0, 10)
    @command_window.index = @menu_index
    if $game_party.members.size == 0          # If number of party members is 0
      @command_window.draw_item(0, false)     # Disable item
      @command_window.draw_item(1, false)     # Disable skill
      @command_window.draw_item(2, false)     # Disable equipment
      @command_window.draw_item(3, false)     # Disable status
    end
    if $game_system.save_disabled             # If save is forbidden
      @command_window.draw_item(4, false)     # Disable save
    end
  end
  #--------------------------------------------------------------------------
  # * Update Command Selection
  #--------------------------------------------------------------------------
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 4
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0      # Item
        $scene = Scene_Item.new
      when 1,2,3  # Skill, equipment, status
        start_actor_selection
      when 4      # Save
        $scene = Scene_File.new(true, false, false)
      when 5      # End Game
        $scene = Scene_End.new
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Start Actor Selection
  #--------------------------------------------------------------------------
  def start_actor_selection
    @command_window.active = false
    @status_window.active = true
    if $game_party.last_actor_index < @status_window.item_max
      @status_window.index = $game_party.last_actor_index
    else
      @status_window.index = 0
    end
  end
  #--------------------------------------------------------------------------
  # * End Actor Selection
  #--------------------------------------------------------------------------
  def end_actor_selection
    @command_window.active = true
    @status_window.active = false
    @status_window.index = -1
  end
  #--------------------------------------------------------------------------
  # * Update Actor Selection
  #--------------------------------------------------------------------------
  def update_actor_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      end_actor_selection
    elsif Input.trigger?(Input::C)
      $game_party.last_actor_index = @status_window.index
      Sound.play_decision
      case @command_window.index
      when 1  # skill
        $scene = Scene_Skill.new(@status_window.index)
      when 2  # equipment
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # status
        $scene = Scene_Status.new(@status_window.index)
      end
    end
  end
end

Instructions

place above main! below materials!

Compatibility

Unknown

Credits and Thanks
   
   me


Terms and Conditions

    Dont claim as yours.
 
Okay, first... congrats on your first script, as that's always an accomplishment. Unfortunately, mostly those are the ones which aren't really what they could be... for obvious reasons. Well, let's talk about it, shall we:

Mainly, the placement, alignment and sizing of your windows is horrible... the upper left corner is stuffed, while the lower right has nothing in it. That wouldn't be as bad if you wouldn't have any chance to change it, but yeah... you actually have tons, because your windows scream for being resized. The "Game End" string gets narrowed because the width of the command window part is too small, which means you should extend it to the full 544px width RMVX uses.
Same goes for Window_MenuStatus, as there's nothing wrong with extending it over the whole width, especially because you wouldn't be able to fit much on the ~90px left there either way.
Lastly, you should have Window_MenuStatus bound with Window_Gold's border, as the little space in there is simply annoying.

For your coding, it looks good overall, aside from a couple of things like you don't need the .opacity=255 (which is the default value) sets. You're also choosing random numbers for your object positions and dimensions, while it's usually more comfortable to work with multiples of 8, or even 16 (as in 8, 16, 24, 32, ... I'm sure those numbers are what you've mostly seen yourself in scripts. Therefore, you wouldn't set a window's width to 450, for example, but to 448. Following such guidelines makes it easier for others and yourself to adjust to it and work with it).
In general, you seem to go for a clean coding though, which looks promising enough for me to write down this wall of text :p

As additional advice, I'd like to point you to the opacity of the windows (which I dislike being different from each other, though that's a personal thing and not generally wrong), and the commands alignment, which I think looks better centered (which is align=1).


Nice posting time, btw.
 
thanks for the advice ill try to improve it :lol:
Now that you mention it it does look like its shoved in one corner lol
hopefully ill get better though.
 
It looks a lot better now, but don't you think you should also center the actors across the whole window? Unless you want this menu to support 5 people by default.. by the way adding new party members doesn't work.

Otherwise, this is a good menu. Very different. :)
 
I must certainly applaude you for making your first attempt to working with scripting. Good work, LIFEFLIES.
The script does have potential to more diverse window options on the menu, i.e: location, game completion, etc., etc.
 
Nice menu style. I liked it! It feels more like "chrono cross" feel kinda. ^^

Onto my comment:

I feel uncomfortable when choosing my characters by pressing arrows "up" and "down" instead of "left" and "right" pads. You might want to change that but that's just me. Also, In the char selection, I'm guessing you are placing the extra space for another char, what I mean is, is there an option that limits the border to fit only 3 or 4 characters in menu style? 
 

ikos

Member

The only issue I find is that when you're selecting a character, you have to press up or down, not left or right. :\
 

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