Simple, basic menu

Ephexis

Warper
Member
Joined
Jun 10, 2016
Messages
4
Reaction score
1
First Language
Swedish
Primarily Uses
Hi, I have zero knowledge when it comes to scripting but I'm in desperate need of a really simple menu.


I want it to look like the one on the right, completely zero info except for names, and I would also like to be able to specify what image files to use for the character portraits.


I've tried to search for similar scripts, but I'm all out of luck, and I would really appreciate it if someone could lend me a hand.


 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,107
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
What are the images you want to use?  Where do you have them saved in your project, and what size are they?  Got a sample?
 

DevAesthetic

Villager
Member
Joined
Oct 10, 2016
Messages
15
Reaction score
1
First Language
English
Primarily Uses
N/A
I'm pretty sure there's none... 
But I have a question.
What type of game would it be?
Is it gonna be a Horror game?
 

Ephexis

Warper
Member
Joined
Jun 10, 2016
Messages
4
Reaction score
1
First Language
Swedish
Primarily Uses
What are the images you want to use?  Where do you have them saved in your project, and what size are they?  Got a sample?
I would prefer png-files (96x96 or 48x48) inside its own folder in the Pictures folder, to avoid too much clutter, and if it's possible.


For example; if one player is called Peter, I want the script to use the png-file called Peter.

I'm pretty sure there's none... 
But I have a question.
What type of game would it be?
Is it gonna be a Horror game?
No it's a very simple RPG where we focus more on the story than game mechanics; I don't really know how to explain it better than that.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,107
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
I will see if I can do this in the next couple of days for you, if nobody else gets to it first.  I've had enough of my computer for today and need a break :)
 

DevAesthetic

Villager
Member
Joined
Oct 10, 2016
Messages
15
Reaction score
1
First Language
English
Primarily Uses
N/A
I would prefer png-files (96x96 or 48x48) inside its own folder in the Pictures folder, to avoid too much clutter, and if it's possible.


For example; if one player is called Peter, I want the script to use the png-file called Peter.


No it's a very simple RPG where we focus more on the story than game mechanics; I don't really know how to explain it better than that.
So an Rpg with just a basic Fight, Items, and Run commands in battle, Right?
 
 

Ephexis

Warper
Member
Joined
Jun 10, 2016
Messages
4
Reaction score
1
First Language
Swedish
Primarily Uses
I will see if I can do this in the next couple of days for you, if nobody else gets to it first.  I've had enough of my computer for today and need a break :)
I would be extremely happy grateful if you did, thank you for even considering it :)

So an Rpg with just a basic Fight, Items, and Run commands in battle, Right?
 
Something like that, yeah.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,107
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
Here you go @Ephexis - put this into a new script slot just above main:

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

class Scene_Menu
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make command window
    s1 = $data_system.words.item
    s2 = "Save"
    s3 = "End Game"
    @command_window = Window_Command.new(160, [s1, s2, s3])
    @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)
    end
    # If save is forbidden
    if $game_system.save_disabled
      # Disable save
      @command_window.disable_item(1)
    end
    # Make play time window
    @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
    # 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
    @command_window.dispose
    @playtime_window.dispose
    @steps_window.dispose
    @gold_window.dispose
    @status_window.dispose
  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 < 1
        # 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  # 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 2  # 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
end

#==============================================================================
# ** Scene_Save
#------------------------------------------------------------------------------
#  This class performs save screen processing.
#==============================================================================

class Scene_Save < Scene_File
  alias simple_menu_on_decision on_decision
  alias simple_menu_on_cancel on_cancel
  #--------------------------------------------------------------------------
  # * Decision Processing
  #--------------------------------------------------------------------------
  def on_decision(filename)
    simple_menu_on_decision(filename)
    $scene = Scene_Menu.new(1)
  end
  #--------------------------------------------------------------------------
  # * Cancel Processing
  #--------------------------------------------------------------------------
  def on_cancel
    simple_menu_on_cancel
    $scene = Scene_Menu.new(1)
  end
end

#==============================================================================
# ** Scene_End
#------------------------------------------------------------------------------
#  This class performs game end screen processing.
#==============================================================================

class Scene_End
  alias simple_menu_update update
  alias simple_menu_command_cancel command_cancel
  
  def update
    simple_menu_update
    if Input.trigger?(Input::B)
      $scene = Scene_Menu.new(2)
      return
    end
  end
  
  def command_cancel
    simple_menu_command_cancel
    $scene = Scene_Menu.new(2)
  end
end

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

class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      x = 64
      y = i * 116
      actor = $game_party.actors[i]
      draw_actor_portrait(actor, x - 40, y + 32) 
      draw_actor_name(actor, x, y)
    end
  end

  #--------------------------------------------------------------------------
  # * Draw Portrait
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_actor_portrait(actor, x, y)
    bitmap = RPG::Cache.portrait(actor.name)
    self.contents.blt(x / 2, y, bitmap, bitmap.rect)
  end
end

module RPG
  module Cache
    def self.portrait(filename)
      self.load_bitmap("Graphics/Pictures/Portraits/", filename)
    end
  end
end





In your Graphics/Pictures folder, create a subfolder called Portraits and save your images there.  They should be the actor's name and have a .png extension.  Experiment a bit with the size if you want.  The default character sprites are 32x48 and there's a bit of vertical leeway there.  I suspect 96 might be a bit too big - cause them to overlap the next person's name.
 

Ephexis

Warper
Member
Joined
Jun 10, 2016
Messages
4
Reaction score
1
First Language
Swedish
Primarily Uses
Thank you so much! I'm really grateful for your help! I wish there was something I could do for you as thanks.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Frostorm wrote on Featherbrain's profile.
Hey, so what species are your raptors? Any of these?
... so here's my main characters running around inside "Headspace", a place people use as a safe place away from anxious/panic related thinking.
Stream will be live shortly! I will be doing some music tonight! Feel free to drop by!
Made transition effects for going inside or outside using zoom, pixi filter, and a shutter effect
I have gathered enough feedback from a few selected people. But it is still available if you want to sign up https://forums.rpgmakerweb.com/index.php?threads/looking-for-testers-a-closed-tech-demo.130774/

Forum statistics

Threads
105,992
Messages
1,018,195
Members
137,773
Latest member
Kirakirna
Top