I am currently editing this menu script, and I've hit a wall in my extremely limited scripting knowledge.
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) -
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.
#===============================================================================## 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
Here's a screenshot of what I mean (ignore the bottom two icons, they're just part of the actor picture) -
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.