ok so i trying to script a menu that can be called form the game and includes all of the weapons in the players inventory and the amount of that weapon that remains and will allow the player to select a weapon from that menu and equip it. the script is below and i could use some help on geting it to display properly and getting the equip to work (even though its not even in the script yet as i haven't gotten it to display correctly once)
#==============================================================================
# ** Scene_QuickEquip
#------------------------------------------------------------------------------
# This script allows you to equip weapons and armors from the map.
#==============================================================================
class Scene_QuickEquip
#--------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
@weapon_name = nil
number=nil
end
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
s = []
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0
number = $game_party.weapon_number(i)
Window_EquipItem.contents.font.color = normal_color
Window_EquipItem.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
Window_EquipItem.contents.draw_text(x + 240, y, 16, 32, ":", 1)
Window_EquipItem.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
end
# 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
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@command_window.update
# If command window is active: call update_command
if @command_window.active
update_command
return
end
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)
end
end
end
http://www.sendspace.com/file/zq98uq theres the lin for the demo the has the script and everything else setup to run the script.
Edit:...can i please get some help even if its just with a small part of this.
Yeah, I finally got through all the work that was piling up on me, so I can actually help now. A few questions:
This weapon menu is separate from the main menu, right?
You want to be able to call it from the map, right?
Do you want to show stats and all like the normal menu, or just the weapons and names?
1) yes
2) yes
3) just weapons and names.