[RGSS3] Drawing item icons on main menu.

I am currently editing this menu script, and I've hit a wall in my extremely limited scripting knowledge.

Spoiler
#===============================================================================## DT's One Person Menu# Author: DoctorTodd# Date (02/19/2012)# Type: (Menu)# Version: (1.0.0) (VXA)# Level: (Simple)# Email: [email hidden]##===============================================================================## NOTES: 1)This script will only work with ace, you can find my VX version on# RMRK.net and the rpg maker web forums.##===============================================================================## Description: A menu that is modified to work as if you are only using one# actor.## Credits: Me (DoctorTodd)##===============================================================================## Instructions# Paste above main.##===============================================================================## Free for any use, no credit required. Just don't claim as your own.##===============================================================================## Editing begins 40 and ends on 59.##===============================================================================module DTOPM #Window skin to use, place in system. WINDOW = ('Window') #Status Window X SX = 200 #Status Window Y SY = 75 #Gold window X GX = 35 #Gold Window Y GY = 302 #Variable Window X VX = 35 #Variable Window Y VY = 302 #Command Window X CX = 35 #Command Window Y CY = 77 #The ID of the variable to display. VARIABLE = 1 #The ID of the hunger variable. HVARIABLE = 41 #The ID of the thirst variable. TVARIABLE = 43 #The ID of the fatigue variable. FVARIABLE = 44 #The ID of the plague variable. PVARIABLE = 42 #The name of picture for the actor's portrait. Must be in Graphics/System. FACEFILENAME = "pic.png" end class Scene_Menu < Scene_MenuBase #-------------------------------------------------------------------------- # * Start processing #-------------------------------------------------------------------------- def start super create_background create_command_window create_status_window# create_gold_window create_variable_window @ActorPortrait = Sprite.new @ActorPortrait.bitmap = Cache.system(DTOPM::FACEFILENAME) @ActorPortrait.z = 3 @ActorPortrait.x = 0 @ActorPortrait.y = 0 end #-------------------------------------------------------------------------- # * Create Variable Window #-------------------------------------------------------------------------- def create_variable_window @var_window = Window_Variable.new(0,0) @var_window.x = (DTOPM::VX) @var_window.y = (DTOPM::VY) @var_window.windowskin = Cache.system(DTOPM::WINDOW)end #-------------------------------------------------------------------------- # * Terminate #-------------------------------------------------------------------------- def terminate @ActorPortrait.dispose#@gold_window.dispose@status_window.dispose@command_window.dispose@[email hidden] #-------------------------------------------------------------------------- # * Create Gold Window #-------------------------------------------------------------------------- def create_gold_window @gold_window = Window_Gold.new @gold_window.x = (DTOPM::GX) @gold_window.y = (DTOPM::GY) @gold_window.windowskin = Cache.system(DTOPM::WINDOW) @gold_window.height = 56 @gold_window.width = 160 end #-------------------------------------------------------------------------- # * Create Status Window #-------------------------------------------------------------------------- def create_status_window @status_window = Window_MenuInfo.new((DTOPM::SX), (DTOPM::SY)) @status_window.windowskin = Cache.system(DTOPM::WINDOW) end #-------------------------------------------------------------------------- # * Create Command Window #-------------------------------------------------------------------------- def create_command_window @command_window = Window_MenuCommand.new @command_window.set_handler🙂item, method🙂command_item))# @command_window.set_handler🙂skill, method🙂command_skill)) @command_window.set_handler🙂equip, method🙂command_equip)) @command_window.set_handler🙂modify, method🙂command_modify)) @command_window.set_handler🙂boost, method🙂command_boost)) # @command_window.set_handler🙂diary, method🙂command_diary)) @command_window.set_handler🙂save, method🙂command_save)) @command_window.set_handler🙂records, method🙂command_records)) @command_window.set_handler🙂game_end, method🙂command_game_end)) @command_window.set_handler🙂cancel, method🙂return_scene)) @command_window.x = (DTOPM::CX) @command_window.y = (DTOPM::CY) end end#-------------------------------------------------------------------------- # * [Item] Command #-------------------------------------------------------------------------- def command_item SceneManager.call(Scene_Item) end #-------------------------------------------------------------------------- # * [Equipment] Command #-------------------------------------------------------------------------- def command_equip @actor = $game_party.members[0] SceneManager.call(Scene_Equip) end def command_modify @actor = $game_party.members[0] SceneManager.call(Scene_TOCrafting) end def command_boost @actor = $game_party.members[0] SceneManager.call(Scene_Status_Distribution) end def command_records @actor = $game_party.members[0] SceneManager.call(Scene_Records) end #-------------------------------------------------------------------------- # * [Status] Command #-------------------------------------------------------------------------- #-------------------------------------------------------------------------- # * [Class] Command #-------------------------------------------------------------------------- def command_diary @actor = $game_party.members[0] SceneManager.call(Scene_Quest) end #-------------------------------------------------------------------------- # * [Save] Command #-------------------------------------------------------------------------- def command_save SceneManager.call(Scene_Save) end #-------------------------------------------------------------------------- # * [Skill] Command #-------------------------------------------------------------------------- def command_skill @actor = $game_party.members[0] SceneManager.call(Scene_Skill) end #===================================================================# ** Window_MenuStatus#------------------------------------------------------------------------------# This window displays the characters status on the menu screen.#============================================================================== class Window_MenuInfo < Window_Base #-------------------------------------------------------------------------- # * Object Initialization # x : window X coordinate # y : window Y coordinate #-------------------------------------------------------------------------- def initialize(x, y) super(x, y, 300, 221) refresh end #-------------------------------------------------------------------------- # * Get variable Hunger #-------------------------------------------------------------------------- def variableH return $game_variables[DTOPM::HVARIABLE] end #-------------------------------------------------------------------------- # * Get variable Thirst #-------------------------------------------------------------------------- def variableT return $game_variables[DTOPM::TVARIABLE] end #-------------------------------------------------------------------------- # * Get variable Fatigue #-------------------------------------------------------------------------- def variableF return $game_variables[DTOPM::FVARIABLE] end #-------------------------------------------------------------------------- # * Get variable Plague #-------------------------------------------------------------------------- def variableP return $game_variables[DTOPM:😛VARIABLE] end def variableK return $game_variables[10] end def variableS return $game_variables[11] end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear self.z = 2 @actor = $game_party.members[0] draw_actor_name(@actor, 0, 5) draw_actor_icons(@actor, 5, 120, width = 6) draw_text(0, 57, 120, line_height, "Plague") draw_text(0, 80, 120, line_height, "Hunger") draw_text(0, 104, 120, line_height, "Thirst") draw_text(0, 128, 120, line_height, "Fatigue") draw_text(100, 57 , 140, line_height, variableP) draw_text(100, 80 , 140, line_height, variableH) draw_text(100, 104 , 140, line_height, variableT) draw_text(100, 128 , 140, line_height, variableF) draw_text(100, 173, 140, line_height, variableK) draw_text(25, 173, 115, line_height, variableS) end end#==============================================================================# ** Window_MenuCommand#------------------------------------------------------------------------------# This command window appears on the menu screen.#============================================================================== class Window_MenuCommand < Window_Command #-------------------------------------------------------------------------- # * Initialize Command Selection Position (Class Method) #-------------------------------------------------------------------------- def self.init_command_position @@last_command_symbol = nil end #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0) select_last self.z = 1 end #-------------------------------------------------------------------------- # * Get Window Width #-------------------------------------------------------------------------- def window_width return 160 end #-------------------------------------------------------------------------- # * Get Number of Lines to Show #-------------------------------------------------------------------------- def visible_line_number item_max end #-------------------------------------------------------------------------- # * Create Command List #-------------------------------------------------------------------------- def make_command_list add_main_commands add_original_commands add_save_command add_game_end_command end #-------------------------------------------------------------------------- # * Add Main Commands to List #-------------------------------------------------------------------------- def add_main_commands # add_command(Vocab::item, :item, main_commands_enabled) # add_command(Vocab::skill, :skill, main_commands_enabled) # add_command(Vocab::equip, :equip, main_commands_enabled) # add_command("Craft", :modify, main_commands_enabled) add_command("Journal", :records, main_commands_enabled) end #-------------------------------------------------------------------------- # * For Adding Original Commands #-------------------------------------------------------------------------- def add_original_commands# add_command("Notepad", :diary, main_commands_enabled) end #-------------------------------------------------------------------------- # * Add Save to Command List #-------------------------------------------------------------------------- def add_save_command add_command(Vocab::save, :save, save_enabled) end #-------------------------------------------------------------------------- # * Add Exit Game to Command List #-------------------------------------------------------------------------- def add_game_end_command add_command(Vocab::game_end, :game_end) end #-------------------------------------------------------------------------- # * Get Activation State of Main Commands #-------------------------------------------------------------------------- def main_commands_enabled $game_party.exists end #-------------------------------------------------------------------------- # * Get Activation State of Formation #-------------------------------------------------------------------------- def formation_enabled $game_party.members.size >= 2 && !$game_system.formation_disabled end #-------------------------------------------------------------------------- # * Get Activation State of Save #-------------------------------------------------------------------------- def save_enabled !$game_system.save_disabled end #-------------------------------------------------------------------------- # * Processing When OK Button Is Pressed #-------------------------------------------------------------------------- def process_ok @@last_command_symbol = current_symbol super end #-------------------------------------------------------------------------- # * Restore Previous Selection Position #-------------------------------------------------------------------------- def select_last select_symbol(@@last_command_symbol) endend #===================================================================# ** Window_Variable#------------------------------------------------------------------------------# This window displays a variable on the menu screen.#============================================================================== class Window_Variable < Window_Base #-------------------------------------------------------------------------- # * Object Initialization # x : window X coordinate # y : window Y coordinate #-------------------------------------------------------------------------- def initialize(x, y) super(x, y, 160, 56) refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear self.z = 1 draw_text(self.contents.rect, " #{variable} SP") end #-------------------------------------------------------------------------- # * Get variable #-------------------------------------------------------------------------- def variable return $game_variables[DTOPM::VARIABLE] end end  
This may sound like a strange request, so I'll try to word it as simply as possible. In my game, you can only carry four items at a time - this doesn't really warrant an entire item menu just for that. What I would like would to be able to do is draw the icon for each item you're currently carrying onto the main menu, obviously with adjustable x/y coordinates. 

Here's a screenshot of what I mean (ignore the bottom two icons, they're just part of the actor picture) -

nVmSrG4.png


Obviously they would appear/disappear as you lose or gain the item. 

I'm not sure if this'd be something really simple or difficult, but I'd appreciate the help :] thanks~

EDIT: Perhaps it might be easier doing it this way.

Rather than using item icons I could just use state icons signifying the items - though adding states doesn't seem to add any icons to the menu. I have a feeling it's this line that deals with that: draw_actor_icons(@actor, 100, 110, width = 96)

...but upon adding a state, there's no icon showing.
I copied and slightly edited some methods from the default scripts. Hope it works.

Spoiler
#==============================================================================## DT's One Person Menu# Author: DoctorTodd# Date (02/19/2012)# Type: (Menu)# Version: (1.0.0) (VXA)# Level: (Simple)# Email: [email hidden]##==============================================================================## NOTES: 1)This script will only work with ace, you can find my VX version on# RMRK.net and the rpg maker web forums.##==============================================================================## Description: A menu that is modified to work as if you are only using one# actor.## Credits: Me (DoctorTodd)##==============================================================================## Instructions# Paste above main.##==============================================================================## Free for any use, no credit required. Just don't claim as your own.##==============================================================================## Editing begins 40 and ends on 59.##==============================================================================module DTOPM #Window skin to use, place in system. WINDOW = ('Window') #Status Window X SX = 200 #Status Window Y SY = 75 #Gold window X GX = 35 #Gold Window Y GY = 302 #Variable Window X VX = 35 #Variable Window Y VY = 302 #Command Window X CX = 35 #Command Window Y CY = 77 #The ID of the variable to display. VARIABLE = 1 #The ID of the hunger variable. HVARIABLE = 41 #The ID of the thirst variable. TVARIABLE = 43 #The ID of the fatigue variable. FVARIABLE = 44 #The ID of the plague variable. PVARIABLE = 42 #The name of picture for the actor's portrait. Must be in Graphics/System. FACEFILENAME = "Shadow.png" # Items coordinates Added by MHL ITEMS_X = 0 ITEMS_Y = 0 end class Scene_Menu < Scene_MenuBase #-------------------------------------------------------------------------- # * Start processing #-------------------------------------------------------------------------- def start super create_background create_command_window create_status_window# create_gold_window create_variable_window @ActorPortrait = Sprite.new @ActorPortrait.bitmap = Cache.system(DTOPM::FACEFILENAME) @ActorPortrait.z = 3 @ActorPortrait.x = 0 @ActorPortrait.y = 0 end #-------------------------------------------------------------------------- # * Create Variable Window #-------------------------------------------------------------------------- def create_variable_window @var_window = Window_Variable.new(0,0) @var_window.x = (DTOPM::VX) @var_window.y = (DTOPM::VY) @var_window.windowskin = Cache.system(DTOPM::WINDOW) end #-------------------------------------------------------------------------- # * Terminate #-------------------------------------------------------------------------- def terminate @ActorPortrait.dispose# @gold_window.dispose @status_window.dispose @command_window.dispose @var_window.dispose @gametimeclock.disposeend #-------------------------------------------------------------------------- # * Create Gold Window #-------------------------------------------------------------------------- def create_gold_window @gold_window = Window_Gold.new @gold_window.x = (DTOPM::GX) @gold_window.y = (DTOPM::GY) @gold_window.windowskin = Cache.system(DTOPM::WINDOW) @gold_window.height = 56 @gold_window.width = 160 end #-------------------------------------------------------------------------- # * Create Status Window #-------------------------------------------------------------------------- def create_status_window @status_window = Window_MenuInfo.new((DTOPM::SX), (DTOPM::SY)) @status_window.windowskin = Cache.system(DTOPM::WINDOW) end #-------------------------------------------------------------------------- # * Create Command Window #-------------------------------------------------------------------------- def create_command_window @command_window = Window_MenuCommand.new @command_window.set_handler🙂item, method🙂command_item))# @command_window.set_handler🙂skill, method🙂command_skill)) @command_window.set_handler🙂equip, method🙂command_equip)) @command_window.set_handler🙂modify, method🙂command_modify)) @command_window.set_handler🙂boost, method🙂command_boost))# @command_window.set_handler🙂diary, method🙂command_diary)) @command_window.set_handler🙂save, method🙂command_save)) @command_window.set_handler🙂records, method🙂command_records)) @command_window.set_handler🙂game_end, method🙂command_game_end)) @command_window.set_handler🙂cancel, method🙂return_scene)) @command_window.x = (DTOPM::CX) @command_window.y = (DTOPM::CY) end end #-------------------------------------------------------------------------- # * [Item] Command #-------------------------------------------------------------------------- def command_item SceneManager.call(Scene_Item) end #-------------------------------------------------------------------------- # * [Equipment] Command #-------------------------------------------------------------------------- def command_equip @actor = $game_party.members[0] SceneManager.call(Scene_Equip) end def command_modify @actor = $game_party.members[0] SceneManager.call(Scene_TOCrafting) end def command_boost @actor = $game_party.members[0] SceneManager.call(Scene_Status_Distribution) end def command_records @actor = $game_party.members[0] SceneManager.call(Scene_Records) end #-------------------------------------------------------------------------- # * [Status] Command #-------------------------------------------------------------------------- #-------------------------------------------------------------------------- # * [Class] Command #-------------------------------------------------------------------------- def command_diary @actor = $game_party.members[0] SceneManager.call(Scene_Quest) end #-------------------------------------------------------------------------- # * [Save] Command #-------------------------------------------------------------------------- def command_save SceneManager.call(Scene_Save) end #-------------------------------------------------------------------------- # * [Skill] Command #-------------------------------------------------------------------------- def command_skill @actor = $game_party.members[0] SceneManager.call(Scene_Skill) end #==============================================================================# ** Window_MenuStatus#------------------------------------------------------------------------------# This window displays the characters status on the menu screen.#============================================================================== class Window_MenuInfo < Window_Base #-------------------------------------------------------------------------- # * Object Initialization # x : window X coordinate # y : window Y coordinate #-------------------------------------------------------------------------- def initialize(x, y) super(x, y, 300, 221) refresh end #-------------------------------------------------------------------------- # * Get Rectangle for Drawing Items Added by MHL #-------------------------------------------------------------------------- def item_rect(index) rect = Rect.new(x, y, 24, 24) rect.x = index % 4 * (24 + 2); rect.y = index / 4 * 24 rect end #-------------------------------------------------------------------------- # * Get Number of Items Added by MHL #-------------------------------------------------------------------------- def item_max; return 4; end #-------------------------------------------------------------------------- # * Get Item Added by MHL #-------------------------------------------------------------------------- def item; @data && index >= 0 ? @data[index] : nil; end #-------------------------------------------------------------------------- # * Include in Item List? Added by MHL #-------------------------------------------------------------------------- def include?(item); return true; end #-------------------------------------------------------------------------- # * Create Item List Added by MHL #-------------------------------------------------------------------------- def make_item_list @data = $game_party.all_items.select {|item| include?(item) } @data.push(nil) if include?(nil) end #-------------------------------------------------------------------------- # * Draw Item Icon Added by MHL #-------------------------------------------------------------------------- def draw_item_icon(item, x, y); draw_icon(item.icon_index, x, y); end #-------------------------------------------------------------------------- # * Draw Item Added by MHL #-------------------------------------------------------------------------- def draw_item(index) item = @data[index] if item; rect = item_rect(index) draw_item_icon(item, rect.x + DTOPM::ITEMS_X, rect.y + DTOPM::ITEMS_Y) end end #-------------------------------------------------------------------------- # * Draw All Items Added by MHL #-------------------------------------------------------------------------- def draw_all_items; item_max.times {|i| draw_item(i) }; end #-------------------------------------------------------------------------- # * Get variable Hunger #-------------------------------------------------------------------------- def variableH return $game_variables[DTOPM::HVARIABLE] end #-------------------------------------------------------------------------- # * Get variable Thirst #-------------------------------------------------------------------------- def variableT return $game_variables[DTOPM::TVARIABLE] end #-------------------------------------------------------------------------- # * Get variable Fatigue #-------------------------------------------------------------------------- def variableF return $game_variables[DTOPM::FVARIABLE] end #-------------------------------------------------------------------------- # * Get variable Plague #-------------------------------------------------------------------------- def variableP return $game_variables[DTOPM:😛VARIABLE] end def variableK return $game_variables[10] end def variableS return $game_variables[11] end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear self.z = 2 @actor = $game_party.members[0] draw_actor_name(@actor, 0, 5) draw_actor_icons(@actor, 5, 120, width = 6) draw_text(0, 57, 120, line_height, "Plague") draw_text(0, 80, 120, line_height, "Hunger") draw_text(0, 104, 120, line_height, "Thirst") draw_text(0, 128, 120, line_height, "Fatigue") draw_text(100, 57 , 140, line_height, variableP) draw_text(100, 80 , 140, line_height, variableH) draw_text(100, 104 , 140, line_height, variableT) draw_text(100, 128 , 140, line_height, variableF) draw_text(100, 173, 140, line_height, variableK) draw_text(25, 173, 115, line_height, variableS) make_item_list # Added by MHL draw_all_items # Added by MHL endend#==============================================================================# ** Window_MenuCommand#------------------------------------------------------------------------------# This command window appears on the menu screen.#============================================================================== class Window_MenuCommand < Window_Command #-------------------------------------------------------------------------- # * Initialize Command Selection Position (Class Method) #-------------------------------------------------------------------------- def self.init_command_position @@last_command_symbol = nil end #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0) select_last self.z = 1 end #-------------------------------------------------------------------------- # * Get Window Width #-------------------------------------------------------------------------- def window_width return 160 end #-------------------------------------------------------------------------- # * Get Number of Lines to Show #-------------------------------------------------------------------------- def visible_line_number item_max end #-------------------------------------------------------------------------- # * Create Command List #-------------------------------------------------------------------------- def make_command_list add_main_commands add_original_commands add_save_command add_game_end_command end #-------------------------------------------------------------------------- # * Add Main Commands to List #-------------------------------------------------------------------------- def add_main_commands# add_command(Vocab::item, :item, main_commands_enabled)# add_command(Vocab::skill, :skill, main_commands_enabled)# add_command(Vocab::equip, :equip, main_commands_enabled)# add_command("Craft", :modify, main_commands_enabled) add_command("Journal", :records, main_commands_enabled) end #-------------------------------------------------------------------------- # * For Adding Original Commands #-------------------------------------------------------------------------- def add_original_commands# add_command("Notepad", :diary, main_commands_enabled) end #-------------------------------------------------------------------------- # * Add Save to Command List #-------------------------------------------------------------------------- def add_save_command add_command(Vocab::save, :save, save_enabled) end #-------------------------------------------------------------------------- # * Add Exit Game to Command List #-------------------------------------------------------------------------- def add_game_end_command add_command(Vocab::game_end, :game_end) end #-------------------------------------------------------------------------- # * Get Activation State of Main Commands #-------------------------------------------------------------------------- def main_commands_enabled $game_party.exists end #-------------------------------------------------------------------------- # * Get Activation State of Formation #-------------------------------------------------------------------------- def formation_enabled $game_party.members.size >= 2 && !$game_system.formation_disabled end #-------------------------------------------------------------------------- # * Get Activation State of Save #-------------------------------------------------------------------------- def save_enabled !$game_system.save_disabled end #-------------------------------------------------------------------------- # * Processing When OK Button Is Pressed #-------------------------------------------------------------------------- def process_ok @@last_command_symbol = current_symbol super end #-------------------------------------------------------------------------- # * Restore Previous Selection Position #-------------------------------------------------------------------------- def select_last select_symbol(@@last_command_symbol) endend #==============================================================================# ** Window_Variable#------------------------------------------------------------------------------# This window displays a variable on the menu screen.#============================================================================== class Window_Variable < Window_Base #-------------------------------------------------------------------------- # * Object Initialization # x : window X coordinate # y : window Y coordinate #-------------------------------------------------------------------------- def initialize(x, y) super(x, y, 160, 56) refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear self.z = 1 draw_text(self.contents.rect, " #{variable} SP") end #-------------------------------------------------------------------------- # * Get variable #-------------------------------------------------------------------------- def variable return $game_variables[DTOPM::VARIABLE] endend  
By the way, I encountered a problem in the terminate method in Scene_Menu where @gametimeclock.dispose disposes something that doesn't exists and crashes upon exiting the menu, but I haven't touched that part of the code.
Yeah my bad on the error, that was part of another script I'd added in there.

As for your addition, it works perfectly, thank you very much for the speedy response 🙂
I'm glad it works.

The comments I added are just for showing where I added stuff, so you wouldn't mistake them for the original code when editing the script. You can remove them of course.

Original thread: https://forums.rpgmakerweb.com/threads/rgss3-drawing-item-icons-on-main-menu.15386/