- Joined
- Apr 1, 2013
- Messages
- 14
- Reaction score
- 0
- First Language
- French
- Primarily Uses
Hi everyone!
This thread is created in order to solve this thread:
http://forums.rpgmakerweb.com/index.php?/topic/15915-help-removing-specific-slots-from-the-menu/
I would like to remove the selected parts in the following pictures, when using an object, because there's only one main character in my game.
Here it is:
When opening the menu, this appears (I added an item potion so that I can show you the parts I want to remove):

Then, when I press the C button (which stands for Enter for beginners reading this topic) while the cursor is on "Items", it highlights the first object in the list, like this (nothing new to remove):

And now, the interesting part. When I press again the C button, it selects the first object "Potion" and displays this, in order to allow me to choose on which character I'd like to use the potion (I don't want this to popup! It will be better if a choice would show for example "Use [item]? Yes/No ) :

and here is the script I'd like to use in order to do this:
The problem is that when I try to apply it, a popup appears and tell me there are some errors, line 96 for example. I don't know how to fix it, and this is why I'm asking for your help. If you have a better idea than this one, feel free to explain me what to do and where, I'll try it.
I'll be away during one week, so I won't be able to read your answers. As soon as I'm back, I'll read it
Thanks a lot and see you in one week!
This thread is created in order to solve this thread:
http://forums.rpgmakerweb.com/index.php?/topic/15915-help-removing-specific-slots-from-the-menu/
I would like to remove the selected parts in the following pictures, when using an object, because there's only one main character in my game.
Here it is:
When opening the menu, this appears (I added an item potion so that I can show you the parts I want to remove):

Then, when I press the C button (which stands for Enter for beginners reading this topic) while the cursor is on "Items", it highlights the first object in the list, like this (nothing new to remove):

And now, the interesting part. When I press again the C button, it selects the first object "Potion" and displays this, in order to allow me to choose on which character I'd like to use the potion (I don't want this to popup! It will be better if a choice would show for example "Use [item]? Yes/No ) :

and here is the script I'd like to use in order to do this:
Class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
# x : window X coordinate
# y : window Y coordinate
#--------------------------------------------------------------------------
def initialize(x, y) # 160, 0
super(x, y, 384, 416)
@actor = $game_party.members[0]
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# Draw
# Actor name
# X Y Coordinates
draw_actor_name(@actor, 0, 0)
# Actor Class
# X Y Coordinates
draw_actor_class(@actor, 0, 120)
# Actor Face
# X Y Coordinates
draw_actor_face(@actor, 0, 24)
# Basic Info
# Include Level, state, HP and MP bar
# X Y Coordinates
draw_basic_info(160, 10)
# Parameters
# Include STR, AGI etc.
# X Y
draw_parameters(0, 140)
# Exp Info
# Include Current Exp and Exp needen for level
# X Y
draw_exp_info(170, 128)
# Equipments
# Sword, shield etc.
# X Y
draw_equipments(60, 240)
end
#--------------------------------------------------------------------------
# * Draw Basic Information
# x : Draw spot X coordinate
# y : Draw spot Y coordinate
#--------------------------------------------------------------------------
def draw_basic_info(x, y)
draw_actor_level(@actor, x, y + WLH * 0)
draw_actor_state(@actor, x, y + WLH * 1)
draw_actor_hp(@actor, x, y + WLH * 2)
draw_actor_mp(@actor, x, y + WLH * 3)
end
#--------------------------------------------------------------------------
# * Draw Parameters
# x : Draw spot X coordinate
# y : Draw spot Y coordinate
#--------------------------------------------------------------------------
def draw_parameters(x, y)
draw_actor_parameter(@actor, x, y + WLH * 0, 0)
draw_actor_parameter(@actor, x, y + WLH * 1, 1)
draw_actor_parameter(@actor, x, y + WLH * 2, 2)
draw_actor_parameter(@actor, x, y + WLH * 3, 3)
end
#--------------------------------------------------------------------------
# * Draw Experience Information
# x : Draw spot X coordinate
# y : Draw spot Y coordinate
#--------------------------------------------------------------------------
def draw_exp_info(x, y)
s1 = @actor.exp_s
s2 = @actor.next_rest_exp_s
s_next = sprintf(Vocab::ExpNext, Vocab::level)
self.contents.font.color = system_color
self.contents.draw_text(x, y + WLH * 0, 180, WLH, Vocab::ExpTotal)
self.contents.draw_text(x, y + WLH * 2, 180, WLH, s_next)
self.contents.font.color = normal_color
self.contents.draw_text(x, y + WLH * 1, 180, WLH, s1, 2)
self.contents.draw_text(x, y + WLH * 3, 180, WLH, s2, 2)
end
#--------------------------------------------------------------------------
# * Draw Equipment
# x : Draw spot X coordinate
# y : Draw spot Y coordinate
#--------------------------------------------------------------------------
def draw_equipments(x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, WLH, Vocab::equip)
for i in 0..4
draw_item_name(@actor.equips, x + 16, y + WLH * (i + 1))
end
end
end
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
#s4 = Vocab::status
s5 = Vocab::save
s6 = Vocab::game_end
@command_window = Window_Command.new(160, [s1, s2, s3, s5, s6]) #s4, s5, s6])
@command_window.index = @menu_index
if $game_party.members.size == 0 # If number of party members is 0
@command_window.draw_item(0, false) # Disable item
@command_window.draw_item(1, false) # Disable skill
@command_window.draw_item(2, false) # Disable equipment
# @command_window.draw_item(3, false) # Disable status
end
if $game_system.save_disabled # If save is forbidden
@command_window.draw_item(3, false) # Disable save
end
end
#--------------------------------------------------------------------------
# * Update Command Selection
#--------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # Item
$scene = Scene_Item.new
when 1,2 # Skill, equipment, status
start_actor_selection
when 3 # Save
$scene = Scene_File.new(true, false, false)
when 4 # End Game
$scene = Scene_End.new
end
end
end
#--------------------------------------------------------------------------
# * Start Actor Selection
#--------------------------------------------------------------------------
def start_actor_selection
@command_window.active = false
@status_window.active = true
if $game_party.last_actor_index < @status_window.item_max
@status_window.index = $game_party.last_actor_index
else
@status_window.index = 0
end
end
#--------------------------------------------------------------------------
# * End Actor Selection
#--------------------------------------------------------------------------
def end_actor_selection
@command_window.active = true
@status_window.active = false
@status_window.index = -1
end
#--------------------------------------------------------------------------
# * Update Actor Selection
#--------------------------------------------------------------------------
def update_actor_selection
if Input.trigger?(Input::
Sound.play_cancel
end_actor_selection
elsif Input.trigger?(Input::C)
$game_party.last_actor_index = @status_window.index
Sound.play_decision
case @command_window.index
when 1 # skill
$scene = Scene_Skill.new(@status_window.index)
when 2 # equipment
$scene = Scene_Equip.new(@status_window.index)
end
end
end
end
#--------------------------------------------------------------------------
# * Object Initialization
# x : window X coordinate
# y : window Y coordinate
#--------------------------------------------------------------------------
def initialize(x, y) # 160, 0
super(x, y, 384, 416)
@actor = $game_party.members[0]
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# Draw
# Actor name
# X Y Coordinates
draw_actor_name(@actor, 0, 0)
# Actor Class
# X Y Coordinates
draw_actor_class(@actor, 0, 120)
# Actor Face
# X Y Coordinates
draw_actor_face(@actor, 0, 24)
# Basic Info
# Include Level, state, HP and MP bar
# X Y Coordinates
draw_basic_info(160, 10)
# Parameters
# Include STR, AGI etc.
# X Y
draw_parameters(0, 140)
# Exp Info
# Include Current Exp and Exp needen for level
# X Y
draw_exp_info(170, 128)
# Equipments
# Sword, shield etc.
# X Y
draw_equipments(60, 240)
end
#--------------------------------------------------------------------------
# * Draw Basic Information
# x : Draw spot X coordinate
# y : Draw spot Y coordinate
#--------------------------------------------------------------------------
def draw_basic_info(x, y)
draw_actor_level(@actor, x, y + WLH * 0)
draw_actor_state(@actor, x, y + WLH * 1)
draw_actor_hp(@actor, x, y + WLH * 2)
draw_actor_mp(@actor, x, y + WLH * 3)
end
#--------------------------------------------------------------------------
# * Draw Parameters
# x : Draw spot X coordinate
# y : Draw spot Y coordinate
#--------------------------------------------------------------------------
def draw_parameters(x, y)
draw_actor_parameter(@actor, x, y + WLH * 0, 0)
draw_actor_parameter(@actor, x, y + WLH * 1, 1)
draw_actor_parameter(@actor, x, y + WLH * 2, 2)
draw_actor_parameter(@actor, x, y + WLH * 3, 3)
end
#--------------------------------------------------------------------------
# * Draw Experience Information
# x : Draw spot X coordinate
# y : Draw spot Y coordinate
#--------------------------------------------------------------------------
def draw_exp_info(x, y)
s1 = @actor.exp_s
s2 = @actor.next_rest_exp_s
s_next = sprintf(Vocab::ExpNext, Vocab::level)
self.contents.font.color = system_color
self.contents.draw_text(x, y + WLH * 0, 180, WLH, Vocab::ExpTotal)
self.contents.draw_text(x, y + WLH * 2, 180, WLH, s_next)
self.contents.font.color = normal_color
self.contents.draw_text(x, y + WLH * 1, 180, WLH, s1, 2)
self.contents.draw_text(x, y + WLH * 3, 180, WLH, s2, 2)
end
#--------------------------------------------------------------------------
# * Draw Equipment
# x : Draw spot X coordinate
# y : Draw spot Y coordinate
#--------------------------------------------------------------------------
def draw_equipments(x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, WLH, Vocab::equip)
for i in 0..4
draw_item_name(@actor.equips, x + 16, y + WLH * (i + 1))
end
end
end
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
#s4 = Vocab::status
s5 = Vocab::save
s6 = Vocab::game_end
@command_window = Window_Command.new(160, [s1, s2, s3, s5, s6]) #s4, s5, s6])
@command_window.index = @menu_index
if $game_party.members.size == 0 # If number of party members is 0
@command_window.draw_item(0, false) # Disable item
@command_window.draw_item(1, false) # Disable skill
@command_window.draw_item(2, false) # Disable equipment
# @command_window.draw_item(3, false) # Disable status
end
if $game_system.save_disabled # If save is forbidden
@command_window.draw_item(3, false) # Disable save
end
end
#--------------------------------------------------------------------------
# * Update Command Selection
#--------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # Item
$scene = Scene_Item.new
when 1,2 # Skill, equipment, status
start_actor_selection
when 3 # Save
$scene = Scene_File.new(true, false, false)
when 4 # End Game
$scene = Scene_End.new
end
end
end
#--------------------------------------------------------------------------
# * Start Actor Selection
#--------------------------------------------------------------------------
def start_actor_selection
@command_window.active = false
@status_window.active = true
if $game_party.last_actor_index < @status_window.item_max
@status_window.index = $game_party.last_actor_index
else
@status_window.index = 0
end
end
#--------------------------------------------------------------------------
# * End Actor Selection
#--------------------------------------------------------------------------
def end_actor_selection
@command_window.active = true
@status_window.active = false
@status_window.index = -1
end
#--------------------------------------------------------------------------
# * Update Actor Selection
#--------------------------------------------------------------------------
def update_actor_selection
if Input.trigger?(Input::
Sound.play_cancel
end_actor_selection
elsif Input.trigger?(Input::C)
$game_party.last_actor_index = @status_window.index
Sound.play_decision
case @command_window.index
when 1 # skill
$scene = Scene_Skill.new(@status_window.index)
when 2 # equipment
$scene = Scene_Equip.new(@status_window.index)
end
end
end
end
The problem is that when I try to apply it, a popup appears and tell me there are some errors, line 96 for example. I don't know how to fix it, and this is why I'm asking for your help. If you have a better idea than this one, feel free to explain me what to do and where, I'll try it.
I'll be away during one week, so I won't be able to read your answers. As soon as I'm back, I'll read it
Thanks a lot and see you in one week!

