Scusate ragazzi, non riesco a capire come far funzionare bene questo script, ci capite qualcosa? Leggendo le istruzioni si vede che sbaglio..bhò: #============================================================================== # Add-On: Individual Battle Commands # by Charlie Lee # Modified by Atoa, to work with SBS XP #============================================================================== # This script was modified to work with SBS XP, but it configuration # didn't change # # Create an new attribute named "CMD *command*", where *command* is the # name of the command, then add this attribute to an skill. # EG.: # "CMD White Magic" will create the command "White Magic" # # Remember to add only one command attribute to an skill, and add an # command attribute to *ALL* skills, or actors won't be able to use it in # battle. # # IMPORTANTE: If you using the Add-On "AABS (ATB System)", put this script # *bellow* the ATB Add-On. #============================================================================== #============================================================================== # Game_Actor #============================================================================== class Game_Actor #-------------------------------------------------------------------------- attr_accessor :individual_commands #-------------------------------------------------------------------------- alias ibc_setup_n01 setup #-------------------------------------------------------------------------- def setup(actor_id) ibc_setup_n01(actor_id) @individual_commands=[] end #-------------------------------------------------------------------------- def refresh_commands @individual_commands=[] for i in 0...@skills.size skill = $data_skills[@skills] if skill != nil for elem_id in skill.element_set if $data_system.elements[elem_id][0,3]=="CMD" if !@individual_commands.include?($data_system.elements[elem_id]) @individual_commands. push(String.new($data_system.elements[elem_id])) end end end end end for c in @individual_commands c[0,4]="" end end end #============================================================================== # Game_Party #============================================================================== class Game_Party #-------------------------------------------------------------------------- alias ibc_add_actor_n01 add_actor #-------------------------------------------------------------------------- def add_actor(actor_id) ibc_add_actor_n01(actor_id) actor = $game_actors[actor_id] actor.refresh_commands end end #============================================================================== # Scene_Battle (Parte 3) #============================================================================== class Scene_Battle #-------------------------------------------------------------------------- include N01 #-------------------------------------------------------------------------- alias ibc_phase3_setup_command_window_n01 phase3_setup_command_window alias ibc_start_skill_select_n01 start_skill_select #-------------------------------------------------------------------------- def phase3_setup_command_window ibc_phase3_setup_command_window_n01 @update_skills_commands = Window_Skill.new(@active_battler) @update_skills_commands.refresh @update_skills_commands.update @update_skills_commands.dispose @active_battler.refresh_commands s1 = $data_system.words.attack s2 = $data_system.words.skill s3 = $data_system.words.guard s4 = $data_system.words.item s5 = @escape_name if @escape_type == 0 @individual_battle_commands=[s1]+@active_battler.individual_commands+[s3, s4] @individual_battle_commands=[s1]+@active_battler.individual_commands+[s3, s4, s5] if @escape_type == 0 @actor_command_window.dispose @actor_command_window = Window_Command_IBC.new(160, @individual_battle_commands) comand_size = (@individual_battle_commands.size >= 5 ? 5 : @individual_battle_commands.size) @actor_command_window.x = 240 @actor_command_window.y = 248 - 24 * comand_size @actor_command_window.z = 2001 @actor_command_window.back_opacity = COMMAND_OPACITY @actor_command_window.index = 0 @actor_command_window.active = true @actor_command_window.visible = true @active_battler_window.refresh(@active_battler) @active_battler_window.y = 184 - 24 * comand_size @active_battler_window.z = 2002 @active_battler_window.visible = true end #-------------------------------------------------------------------------- def update_phase3_basic_command if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) phase3_prior_actor return end if Input.trigger?(Input::C) case @actor_command_window.commands[@actor_command_window.index] when $data_system.words.attack $game_system.se_play($data_system.decision_se) @active_battler.current_action.kind = 0 @active_battler.current_action.basic = 0 start_enemy_select when $data_system.words.guard $game_system.se_play($data_system.decision_se) @active_battler.current_action.kind = 0 @active_battler.current_action.basic = 1 phase3_next_actor when $data_system.words.item $game_system.se_play($data_system.decision_se) @active_battler.current_action.kind = 2 start_item_select when @escape_name if $game_temp.battle_can_escape == false $game_system.se_play($data_system.buzzer_se) return end @active_battler_window.visible = false @actor_command_window.visible = false for actor in $game_party.actors actor.atb = 0 actor.cast_action = nil end wait(3) $game_system.se_play($data_system.decision_se) update_phase2_escape end if @active_battler != nil and @active_battler.individual_commands. include?(@actor_command_window.commands[@actor_command_window.index]) $game_system.se_play($data_system.decision_se) @active_battler.current_action.kind = 1 @individual_battle_commands_skill_category=@actor_command_window.commands[@actor _command_window.index] start_skill_select end end end #-------------------------------------------------------------------------- def start_skill_select ibc_start_skill_select_n01 @skill_window.dispose @skill_window = Window_Skill.new(@active_battler,@individual_battle_commands_skill_category) @skill_window.help_window = @help_window end end #============================================================================== # * Window_Skill #============================================================================== class Window_Skill < Window_Selectable #-------------------------------------------------------------------------- def initialize(actor, skill_command_type = "") if skill_command_type != "" @skill_command_element_id = $data_system.elements. index("CMD " + skill_command_type) else @skill_command_element_id = -1 end super(0, 128, 640, 352) @actor = actor @column_max = 2 refresh self.index = 0 if $game_temp.in_battle self.y = 320 self.height = 160 self.z = 2000 self.back_opacity = MENU_OPACITY end end #-------------------------------------------------------------------------- def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] for i in 0...@actor.skills.size skill = $data_skills[@actor.skills] if skill != nil if @skill_command_element_id == -1 or skill.element_set.include?( @skill_command_element_id) @data.push(skill) end end end @item_max = @data.size if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 32) for i in 0...@item_max draw_item(i) end end end end #============================================================================== # Window_Command #============================================================================== class Window_Command_IBC < Window_Selectable #-------------------------------------------------------------------------- attr_accessor :commands #-------------------------------------------------------------------------- def initialize(width, commands) comand_size = (commands.size >= 5 ? 192 : commands.size * 32 + 32) super(0, 0, width, comand_size) @item_max = commands.size @commands = commands self.contents = Bitmap.new(width - 32, @item_max * 32) refresh self.index = 0 end #-------------------------------------------------------------------------- def refresh self.contents.clear for i in 0...@item_max draw_item(i, normal_color) end end #-------------------------------------------------------------------------- def draw_item(index, color) self.contents.font.color = color rect = Rect.new(4, 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 #-------------------------------------------------------------------------- def disable_item(index) draw_item(index, disabled_color) end end