Trying to Add New Option on the Menu!!

Joined
Oct 21, 2014
Messages
30
Reaction score
8
First Language
English
Primarily Uses
RMVXA
Hello, I am trying to add a new option to the Menu Window, I wanted the key items aka Evidence out on the menu like in the picture below but I just don't know how to get the key item menu to pop up when I hit Evidence?

I don't know much about scripting but I am trying to learn it.

Any help is appriciated :3
 

Attachments

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,674
Reaction score
566
First Language
English
Primarily Uses
RMVXA
What scripts are you using? Are you using a script to limit the menu to only a few options?
 
Joined
Oct 21, 2014
Messages
30
Reaction score
8
First Language
English
Primarily Uses
RMVXA
What scripts are you using? Are you using a script to limit the menu to only a few options?
Nope, I'm not using a script to limit the Menu, I just went into the actual script of some of the RPG Maker basics and ended up taking out a few things that I didn't need.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,674
Reaction score
566
First Language
English
Primarily Uses
RMVXA
Well then you know enough to mess with the code. But, you should not change the original scripts. Instead make a new script with that code to overwrite the original.
I asked about a script because you could limit the commands with yanfly's ace menu script. That may have been better as it would have also allowed you an easy option to add optional commands.
Maybe make a backup of you script file, start with a fresh project script file and put in yanfly's script, then modify that.

I believe you could direct to the keyitems with SceneManager.call(Scene_KeyItem) like it says in this post
https://www.rpgmakercentral.com/topic/32065-only-2-item-categories/
 
Joined
Oct 21, 2014
Messages
30
Reaction score
8
First Language
English
Primarily Uses
RMVXA
Well then you know enough to mess with the code. But, you should not change the original scripts. Instead make a new script with that code to overwrite the original.
I asked about a script because you could limit the commands with yanfly's ace menu script. That may have been better as it would have also allowed you an easy option to add optional commands.
Maybe make a backup of you script file, start with a fresh project script file and put in yanfly's script, then modify that.

I believe you could direct to the keyitems with SceneManager.call(Scene_KeyItem) like it says in this post
https://www.rpgmakercentral.com/topic/32065-only-2-item-categories/
Thanks I will check that out :3
 

A-Moonless-Night

WINTER IS COMING
Veteran
Joined
Mar 17, 2012
Messages
682
Reaction score
446
First Language
English
Primarily Uses
RMVXA
This should work with Yanfly's Menu Script or on its own:
Code:
$imported ||= {}

class Window_MenuCommand < Window_Command
  if $imported["YEA-AceMenuEngine"]
    alias amn_keyitem_windowmenucommand_make_command_list make_command_list
    def make_command_list
      amn_keyitem_windowmenucommand_make_command_list
      @list.insert(1, {:name=>Vocab::key_item, :symbol=>:key_item, :enabled=>main_commands_enabled, :ext=>nil}) if YEA::MENU::COMMANDS.include?(:key_item)
    end
  end
 
  unless $imported["YEA-AceMenuEngine"]
    def add_main_commands
      add_command(Vocab::item,      :item,      main_commands_enabled)
      add_command(Vocab::key_item,  :key_item,  main_commands_enabled)
      add_command(Vocab::status,    :status,    main_commands_enabled)
    end
  end
 
  def add_formation_command
  end
 
end

class Window_ItemCategory < Window_HorzCommand
  attr_accessor :categories

  alias amn_keyitem_windowitemcategory_init  initialize
  def initialize
    @categories = :none
    amn_keyitem_windowitemcategory_init
  end
 
  def col_max
    return 2
  end

  def make_command_list
    case @categories
    when :item
      add_command(Vocab::item,     :item)
    when :key_item
      add_command(Vocab::key_item, :key_item)
    end
  end

end

class Scene_Item < Scene_ItemBase
 
  def prepare(symbol)
    @categories = symbol
    @category_window.categories = @categories if @category_window
  end
 
  alias amn_keyitem_sceneitem_createcategorywind  create_category_window
  def create_category_window
    amn_keyitem_sceneitem_createcategorywind
    @category_window.categories = @categories
    @category_window.make_command_list
    @category_window.refresh
  end
 
  def pre_terminate
    prepare(:none)
  end
 
end

class Scene_Menu < Scene_MenuBase

  alias amn_keyitem_scenemenu_createcommandwindow create_command_window
  def create_command_window
    amn_keyitem_scenemenu_createcommandwindow
    @command_window.set_handler(:key_item,  method(:command_key_item))
  end

  def command_key_item
    SceneManager.call(Scene_Item)
    SceneManager.scene.prepare(:key_item)
  end 
 
  alias amn_keyitem_scenemenu_commanditem command_item
  def command_item
    amn_keyitem_scenemenu_commanditem
    SceneManager.scene.prepare(:item)
  end
 
end
 
Joined
Oct 21, 2014
Messages
30
Reaction score
8
First Language
English
Primarily Uses
RMVXA
This should work with Yanfly's Menu Script or on its own:
Code:
$imported ||= {}

class Window_MenuCommand < Window_Command
  if $imported["YEA-AceMenuEngine"]
    alias amn_keyitem_windowmenucommand_make_command_list make_command_list
    def make_command_list
      amn_keyitem_windowmenucommand_make_command_list
      @list.insert(1, {:name=>Vocab::key_item, :symbol=>:key_item, :enabled=>main_commands_enabled, :ext=>nil}) if YEA::MENU::COMMANDS.include?(:key_item)
    end
  end
 
  unless $imported["YEA-AceMenuEngine"]
    def add_main_commands
      add_command(Vocab::item,      :item,      main_commands_enabled)
      add_command(Vocab::key_item,  :key_item,  main_commands_enabled)
      add_command(Vocab::status,    :status,    main_commands_enabled)
    end
  end
 
  def add_formation_command
  end
 
end

class Window_ItemCategory < Window_HorzCommand
  attr_accessor :categories

  alias amn_keyitem_windowitemcategory_init  initialize
  def initialize
    @categories = :none
    amn_keyitem_windowitemcategory_init
  end
 
  def col_max
    return 2
  end

  def make_command_list
    case @categories
    when :item
      add_command(Vocab::item,     :item)
    when :key_item
      add_command(Vocab::key_item, :key_item)
    end
  end

end

class Scene_Item < Scene_ItemBase
 
  def prepare(symbol)
    @categories = symbol
    @category_window.categories = @categories if @category_window
  end
 
  alias amn_keyitem_sceneitem_createcategorywind  create_category_window
  def create_category_window
    amn_keyitem_sceneitem_createcategorywind
    @category_window.categories = @categories
    @category_window.make_command_list
    @category_window.refresh
  end
 
  def pre_terminate
    prepare(:none)
  end
 
end

class Scene_Menu < Scene_MenuBase

  alias amn_keyitem_scenemenu_createcommandwindow create_command_window
  def create_command_window
    amn_keyitem_scenemenu_createcommandwindow
    @command_window.set_handler(:key_item,  method(:command_key_item))
  end

  def command_key_item
    SceneManager.call(Scene_Item)
    SceneManager.scene.prepare(:key_item)
  end
 
  alias amn_keyitem_scenemenu_commanditem command_item
  def command_item
    amn_keyitem_scenemenu_commanditem
    SceneManager.scene.prepare(:item)
  end
 
end
Thanks :3 I will check it out :3
 

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

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,036
Messages
1,018,461
Members
137,821
Latest member
Capterson
Top