Group: Local Mod
Posts: 1,348
Type: Scripter
RM Skill: Skilled
Rev Points: 5
Sorry about that, this should hopefully work:
CODE
#============================================================================== # ** Window_Command_Icons #------------------------------------------------------------------------------ # This class deals with command window icons processing. #==============================================================================
class Window_Command_Icons < Window_Selectable #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear for i in 0...@item_max draw_item(i, normal_color) draw_icon(i) end end #-------------------------------------------------------------------------- # * Draw Item # index : item number # color : text color #-------------------------------------------------------------------------- def draw_item(index, color) self.contents.font.color = color rect = Rect.new(38, 32 * index, self.contents.width - 8, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) self.contents.draw_text(rect, @commands[index]) end #-------------------------------------------------------------------------- # * Draw Icon # index : item number #-------------------------------------------------------------------------- def draw_icon(index) case index when 0 icon = '001-Weapon01' when 1 icon = '001-Weapon01' when 2 icon = '001-Weapon01' when 3 icon = '001-Weapon01' when 4 icon = '001-Weapon01' when 5 icon = '001-Weapon01' else icon = '' end bitmap = RPG::Cache.icon(icon) src_rect = Rect.new(0, 0, bitmap.width, bitmap.height) self.contents.blt(4, 32*index+5, bitmap, src_rect) end end
#============================================================================== # ** Window_attr_points #------------------------------------------------------------------------------ # This window displays a variable. #==============================================================================
#============================================================================== # ** Scene_Attr #------------------------------------------------------------------------------ # This class performs attr screen processing. #==============================================================================
class Scene_Attr #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # Make command window s1 = "Hp" s2 = "Sp" s3 = "Str" s4 = "Dex" s5 = "Agi" s6 = "Int" s7 = "close" @command_window = Window_Command_Icons.new(200, [s1, s2, s3, s4, s5, s6, s7]) @command_window.index = 0 @command_window.height = 250 @command_window.x = 0 # Make attribute window @attr_points = Window_attr_points.new @attr_points.x = 0 @attr_points.y = 250 # 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 @attr_points.dispose #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update windows @command_window.update @attr_points.update # If command window is active: call update_command if Input.trigger?(Input::C) # Branch by command window cursor position case @command_window.index when 0 # hp # Play decision SE $game_system.se_play($data_system.decision_se) @hp = @hp + 10 when 1 # sp # Play decision SE $game_system.se_play($data_system.decision_se) @sp = @sp + 10 when 2 # str # Play decision SE $game_system.se_play($data_system.decision_se) @str = @str + 10 when 3 # dex # Play decision SE $game_system.se_play($data_system.decision_se) @dex = @dex + 10 when 4 # agi # Play decision SE $game_system.se_play($data_system.decision_se) @agi = @agi + 10 when 5 # int # Play decision SE $game_system.se_play($data_system.decision_se) @int = @int + 10 when 6 # close # Play decision SE $game_system.se_play($data_system.decision_se) @command_window.dispose end return end $game_variables[3] = @command_window.index end end end
"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!
If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One
#============================================================================== # ** Window_Command_Icons #------------------------------------------------------------------------------ # This class deals with command window icons processing. #==============================================================================
class Window_Command_Icons < Window_Selectable #-------------------------------------------------------------------------- # * Object Initialization # width : window width # commands : command text string array #-------------------------------------------------------------------------- def initialize(width, commands) # Compute window height from command quantity super(0, 0, width, commands.size * 32 + 32) @item_max = commands.size @commands = commands self.contents = Bitmap.new(width - 32, @item_max * 32) refresh self.index = 0 end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear for i in 0...@item_max draw_item(i, normal_color) draw_icon(i) end end #-------------------------------------------------------------------------- # * Draw Item # index : item number # color : text color #-------------------------------------------------------------------------- def draw_item(index, color) self.contents.font.color = color rect = Rect.new(38, 32 * index, self.contents.width - 8, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) self.contents.draw_text(rect, @commands[index]) end #-------------------------------------------------------------------------- # * Draw Icon # index : item number #-------------------------------------------------------------------------- def draw_icon(index) case index when 0 icon = '001-Weapon01' when 1 icon = '001-Weapon01' when 2 icon = '001-Weapon01' when 3 icon = '001-Weapon01' when 4 icon = '001-Weapon01' when 5 icon = '001-Weapon01' else icon = '' end bitmap = RPG::Cache.icon(icon) src_rect = Rect.new(0, 0, bitmap.width, bitmap.height) self.contents.blt(4, 32*index+5, bitmap, src_rect) end end
#============================================================================== # ** Window_attr_points #------------------------------------------------------------------------------ # This window displays a variable. #==============================================================================
#============================================================================== # ** Scene_Attr #------------------------------------------------------------------------------ # This class performs attr screen processing. #==============================================================================
class Scene_Attr #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # Make command window s1 = "Hp" s2 = "Sp" s3 = "Str" s4 = "Dex" s5 = "Agi" s6 = "Int" s7 = "close" @command_window = Window_Command_Icons.new(200, [s1, s2, s3, s4, s5, s6, s7]) @command_window.index = 0 @command_window.height = 250 @command_window.x = 0 # Make attribute window @attr_points = Window_attr_points.new @attr_points.x = 0 @attr_points.y = 250 # 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 @attr_points.dispose end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update windows @command_window.update @attr_points.update # If command window is active: call update_command if Input.trigger?(Input::C) # Branch by command window cursor position case @command_window.index when 0 # hp # Play decision SE $game_system.se_play($data_system.decision_se) @hp = @hp + 10 when 1 # sp # Play decision SE $game_system.se_play($data_system.decision_se) @sp = @sp + 10 when 2 # str # Play decision SE $game_system.se_play($data_system.decision_se) @str = @str + 10 when 3 # dex # Play decision SE $game_system.se_play($data_system.decision_se) @dex = @dex + 10 when 4 # agi # Play decision SE $game_system.se_play($data_system.decision_se) @agi = @agi + 10 when 5 # int # Play decision SE $game_system.se_play($data_system.decision_se) @int = @int + 10 when 6 # close # Play decision SE $game_system.se_play($data_system.decision_se) $scene = Scene_Map.new end return end $game_variables[3] = @command_window.index end end
Also, to get more info about syntax errors, NightShade has written two tutorials about them:
"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!
If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One
#============================================================================== # ** Window_Command_Icons #------------------------------------------------------------------------------ # This class deals with command window icons processing. #==============================================================================
class Window_Command_Icons < Window_Selectable #-------------------------------------------------------------------------- # * Object Initialization # width : window width # commands : command text string array #-------------------------------------------------------------------------- def initialize(width, commands) # Compute window height from command quantity super(0, 0, width, commands.size * 32 + 32) @item_max = commands.size @commands = commands self.contents = Bitmap.new(width - 32, @item_max * 32) refresh self.index = 0 end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear for i in 0...@item_max draw_item(i, normal_color) draw_icon(i) end end #-------------------------------------------------------------------------- # * Draw Item # index : item number # color : text color #-------------------------------------------------------------------------- def draw_item(index, color) self.contents.font.color = color rect = Rect.new(38, 32 * index, self.contents.width - 8, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) self.contents.draw_text(rect, @commands[index]) end #-------------------------------------------------------------------------- # * Draw Icon # index : item number #-------------------------------------------------------------------------- def draw_icon(index) case index when 0 icon = '001-Weapon01' when 1 icon = '001-Weapon01' when 2 icon = '001-Weapon01' when 3 icon = '001-Weapon01' when 4 icon = '001-Weapon01' when 5 icon = '001-Weapon01' else icon = '' end bitmap = RPG::Cache.icon(icon) src_rect = Rect.new(0, 0, bitmap.width, bitmap.height) self.contents.blt(4, 32*index+5, bitmap, src_rect) end #-------------------------------------------------------------------------- # * Disable Item # index : item number #-------------------------------------------------------------------------- def disable_item(index) draw_item(index, disabled_color) end end
#============================================================================== # ** Window_attr_points #------------------------------------------------------------------------------ # This window displays a variable. #==============================================================================
#============================================================================== # ** Scene_Attr #------------------------------------------------------------------------------ # This class performs attr screen processing. #==============================================================================
class Scene_Attr #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # Make command window s1 = "Hp" s2 = "Sp" s3 = "Str" s4 = "Dex" s5 = "Agi" s6 = "Int" s7 = "close" @command_window = Window_Command_Icons.new(200, [s1, s2, s3, s4, s5, s6, s7]) @command_window.index = 0 @command_window.height = 260 @command_window.x = 0 if $game_variables[3] == 0 # Disable items, skills, equipment, and status @command_window.disable_item(0) @command_window.disable_item(1) @command_window.disable_item(2) @command_window.disable_item(3) @command_window.disable_item(4) @command_window.disable_item(5) end @spriteset = Spriteset_Map.new # Make attribute window @attr_points = Window_attr_points.new @attr_points.x = 0 @attr_points.y = 260 # 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 @attr_points.dispose @spriteset.dispose end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update windows @command_window.update @attr_points.update @spriteset.update # If command window is active: call update_command if Input.trigger?(Input::C) @actor = $game_party.actors[1] # Branch by command window cursor position case @command_window.index when 0 # hp $game_system.se_play($data_system.decision_se) if $game_variables[3] != 0 @actor.maxhp + 10 end when 1 # sp $game_system.se_play($data_system.decision_se) if $game_variables[3] != 0 @actor.maxsp + 10 end when 2 # str $game_system.se_play($data_system.decision_se) if $game_variables[3] != 0 @actor.str + 10 end when 3 # dex $game_system.se_play($data_system.decision_se) if $game_variables[3] != 0 @actor.dex + 10 end when 4 # agi $game_system.se_play($data_system.decision_se) if $game_variables[3] != 0 @actor.agi + 10 end when 5 # int $game_system.se_play($data_system.decision_se) if $game_variables[3] != 0 @actor.int + 10 end when 6 # close # Play decision SE $game_system.se_play($data_system.decision_se) $scene = Scene_Map.new end return end end end
@Litchi: We're basically a scripting club that help people learn how to script. You can find our main topic over here:
"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!
If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One