[Résolu]Besoin d'aide pour le fonctionnement d'un script.
Auteur
Message
Garruk
Aventurier Lv.16
Age : 40 Inscrit le : 03/09/2009 Messages : 1503
Sujet: [Résolu]Besoin d'aide pour le fonctionnement d'un script. Ven 16 Juil 2010 - 13:54
Il s'agit d'un script qui permet de customizer les commandes en mode combat, en plus de Attaque, défendre, compétence et Objet on peut rajouter une série de commande infini.
Mon principal problème:
J'arrive à bien configurer le script(Merci Zang =) ), mais pas les compétences que je dois mettre dans les commandes. Par exemple: -Je créer la commande "Magie Noire", j'ai essayé de mettre Magie Noire dans la notbox de la compétence, mais apparemment c'est pas ça et je vois vraiment pas comment configurer les compétences pour quelles apparaissent dans la bonne commande.
Voici le script:
Spoiler:
Code:
# Enelvon's Skill Subsets v4.1 #Some credit should go to Dargor, as it was by studying his Custom Commands script #that I learned how to add/remove battle commands using a scripting section.
#Config
Allow_Skill = true #If Allow_Skill is set to true, the normal 'Skill' command will #be available. It will show all skills from all subsets. The #default is false. module SUBSETS
#Edit these to change the command names. You can have as many as you want. Subsets = ['White','Black','Summon','Commande','Magic', 'Dance','Dark','Skills','Sing','Transform']
#If you want actors to have subsets based on what skills they know, set this to #true. Else, set it to false and edit Subset_actors. Base_on_learned = false
#If Base_on_learned is false, edit these to change which actors have which #subsets. Be sure to add more arrays to it if you add more subsets! Subset_actors = [[26], [1,17], [2,28], [29], [30], [2], [12,1,2,3,4,5,6], [1,3], [], []]
#Set this to true if you're using Dargor's Custom Commands script, to avoid #conflicts. Else, set it to false. Using_custom_commands = false end
class Game_Actor < Game_Battler
attr_reader :commands
alias enelvon_actors_setup setup
def setup(actor_id) enelvon_actors_setup(actor_id) actor = $data_actors[actor_id] s1 = Vocab::attack s2 = Vocab::skill s3 = Vocab::guard s4 = Vocab::item if self.class.skill_name_valid s2 = self.class.skill_name end if Allow_Skill == false @commands = [s1, s3, s4] elsif Allow_Skill == true @commands = [s1, s2, s3, s4] end end #-------------------------------------------------------------------------- # * Add Command #-------------------------------------------------------------------------- def add_command(index, command) return if @commands.include?(command) if command.is_a?(String) @commands.insert(index, command) elsif command.is_a?(Array) for i in 0...command.size @commands.insert(index+i, command[i]) end end end #-------------------------------------------------------------------------- # * Remove Command #-------------------------------------------------------------------------- def remove_command(command) if command.is_a?(String) @commands.delete(command) elsif command.is_a?(Array) for i in command @commands.delete(i) end end end end
class Window_ActorCommand < Window_Command #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(128, [], 1, 4) self.active = false end #-------------------------------------------------------------------------- # * Setup # actor : actor #-------------------------------------------------------------------------- def setup(actor) @commands = actor.commands @item_max = @commands.size height = 32 + 6 * WLH self.contents = Bitmap.new(width - 32, (@item_max * WLH)) refresh self.index = 0 end end
class Game_Actor < Game_Battler alias enelvon_subset_setup setup def setup(actor_id) enelvon_subset_setup(actor_id) for sub in SUBSETS::Subsets if SUBSETS::Base_on_learned == true for skill in @skills if $data_skills[skill].note.include?(sub) if Allow_Skill == false index = @commands.index(Vocab::guard) else index = @commands.index(Vocab::guard) - 1 end add_command(index, sub) end end elsif SUBSETS::Base_on_learned == false if SUBSETS::Subset_actors[SUBSETS::Subsets.index(sub)].include?(actor_id) if Allow_Skill == false index = @commands.index(Vocab::guard) else index = @commands.index(Vocab::guard) - 1 end add_command(index, sub) end end end end end
class Window_Subset < Window_Selectable
def initialize(x, y, width, height, actor) super(x, y, width, height) @actor = actor @column_max = 2 self.index = 0 refresh end
def skill return @data[self.index] end
def refresh @data = [] for skill in @actor.skills note = skill.note if note.include?("#{$bsubset}") @data.push(skill) if skill.id == @actor.last_skill_id self.index = @data.size - 1 end end @item_max = @data.size create_contents for i in 0...@item_max draw_item(i) end end end
def draw_item(index) rect = item_rect(index) self.contents.clear_rect(rect) skill = @data[index] if skill != nil rect.width -= 4 enabled = @actor.skill_can_use?(skill) draw_item_name(skill, rect.x, rect.y, enabled) if @actor.calc_mp_cost(skill) > 0 self.contents.draw_text(rect, @actor.calc_mp_cost(skill), 2) end end end
def update_help @help_window.set_text(skill == nil ? "" : skill.description) end end
alias enelvon_subset_actor_command2 update_actor_command_selection def update_actor_command_selection if SUBSETS::Using_custom_commands == true enelvon_subset_actor_command2 elsif SUBSETS::Using_custom_commands == false skill = Vocab::skill if @active_battler.class.skill_name_valid skill = @active_battler.class.skill_name end if Input.trigger?(Input::B) Sound.play_cancel prior_actor elsif Input.trigger?(Input::C) case @actor_command_window.commands[@actor_command_window.index] when Vocab::attack # Attack Sound.play_decision @active_battler.action.set_attack start_target_enemy_selection when skill # Skill Sound.play_decision start_skill_selection when Vocab::guard # Guard Sound.play_decision @active_battler.action.set_guard next_actor when Vocab::item # Item Sound.play_decision start_item_selection end end end end alias enelvon_subset_actor_command update_actor_command_selection def update_actor_command_selection enelvon_subset_actor_command skill = Vocab::skill if Input.trigger?(Input::C) for sub in SUBSETS::Subsets case @actor_command_window.commands[@actor_command_window.index] when sub Sound.play_decision $bsubset = sub start_subset_selection end end end end end
Et le site de l'auteur: http://www.rpgmakervx.net/index.php?showtopic=5597&st=0
Je remercie par avance celui qui pourra m'aider à régler ce petit soucis encombrant. =)
Dernière édition par CloudStrife le Mer 21 Juil 2010 - 17:13, édité 1 fois
Garruk
Aventurier Lv.16
Age : 40 Inscrit le : 03/09/2009 Messages : 1503
Sujet: Re: [Résolu]Besoin d'aide pour le fonctionnement d'un script. Mer 21 Juil 2010 - 16:42
Je me permet de faire un up pour mon soucis. =(
BARVACHE
Vache Folle
Age : 29 Inscrit le : 22/05/2010 Messages : 3005
Sujet: Re: [Résolu]Besoin d'aide pour le fonctionnement d'un script. Mer 21 Juil 2010 - 16:50
Essaye avec ce script. Il a la même fonction et il marche TRES bien:
Spoiler:
Code:
#=============================================================================== # # Yanfly Engine RD - Custom Battle Actions # Last Date Updated: 2009.06.25 # Level: Normal # # For those who would like to have more than just Attack, Skill, Guard, and # Item for their actions in their list, this script allows just that. You can # rearrange the ordering of the actions, bind new custom actions to skills, # and even incorporate subskill actions into the individual command lists. # #=============================================================================== # Updates: # ---------------------------------------------------------------------------- # o 2009.06.25 - Bug fix for enemy targetting cancel selection. # o 2009.06.23 - Compatibility update with Custom Skill Effects Upgrade 3. # o 2009.06.21 - Bug fix for ally targetting custom skill cancel. # o 2009.05.28 - Started script and finished. #=============================================================================== # Instructions #=============================================================================== # # Scroll down below and modify the module to reflect how you would like the # battle commands to appear for each class-type. # #=============================================================================== # # Compatibility # - Works With: Yanfly Custom Skill Effects # - Alias: Game_Actor: skill_can_use? # - Overwrites: Scene_Battle, execute_action_wait, update_actor_command # - Overwrites: Window_ActorCommand: all of it # #===============================================================================
$imported = {} if $imported == nil $imported["CustomBattleActions"] = true
module YE module BATTLE module COMMANDS
#------------------------------------------------------------------------ # CLASS COMMANDS #------------------------------------------------------------------------ # This following section will adjust commands for individual classes. If # a class ID is not included, it will take out the commands from class 0. # With that said, do not remove class 0. # # There are a few commands verbal commands reserved for the command hash. # "-Attack" - Reserved for basic attacking. # "-Skill" - Reserved for selecting skills. # "-Guard" - Reserved for guarding. # "-Item" - Reserved for using items. # "-Wait" - Reserved for the wait command. # "-Subclass" - Reserved for subclass skills. # "" - If empty, skip it. # # If you input other commands, be sure to spell them correctly as they # will reflect upon how it appears in game. #------------------------------------------------------------------------ # Note that class commands will be determined by the character's primary # class if you're using the Subclass Selection System. #------------------------------------------------------------------------ CLASS_COMMANDS ={ # DO NOT REMOVE CLASS ID ZERO! # ClassID => [ Actions, Actions, Actions...] 0 => ["-Attack", "-Skill", "-Subclass", "-Guard", "-Item"], 1 => ["-Attack", "-Skill", "Concentrazione", "-Item", "TEST"], 2 => ["-Attack", "-Skill", "Furtivita'", "-Item"], 3 => ["-Attack", "-Skill", "Assimila", "-Item"], 4 => ["-Attack", "-Skill", "Medicina", "-Item"], #1 => ["X-Attack", "-Skill", "-Subclass", "-Guard", "-Item"], } # Do not remove this.
# This following hash will determine what commands to replace when the # "-Subclass" command is inputted into the array of commands. If the # subclass's ID does not appear in this array, then it will return 0. SUBCLASS_COMMANDS ={ # DO NOT REMOVE CLASS ID ZERO! # ClassID => Name 0 => "", 2 => "X-Attack", 5 => "Light", 6 => "Darkness", 7 => "3-Attack", 9 => "Furtivita'", 10 => "Concentrazione", 11 => "Assimila", 12 => "Medicina",
} # Do not remove this.
# The following hash allows you to adjust which custom commands to bind # to which skills for the actions to come out of. The custom actions will # still consume HP/MP/Rage. If it's unusable, then it'll be greyed out. CUSTOM_COMMANDS ={ # Follow the example. # -Command Name- => Skill.ID "Furtivita'" => 32, "Concentrazione" => 1, "Assimila" => 15, "Medicina" => 23 } # Do not remove this.
# For those who use "-Wait" and would like to change how Wait appears, # adjust the value below. Also following is how the action takes place. WAIT_VOCAB = "Wait" ACTION_WAIT = "%s is waiting." # Set to nil to not show wait.
end # COMMANDS end # BATTLE end # YE
#=============================================================================== # Editting anything past this point may potentially result in causing computer # damage, incontinence, explosion of user's head, coma, death, and/or halitosis. # Therefore, edit at your own risk. #===============================================================================
module Vocab DoWait = YE::BATTLE::COMMANDS::ACTION_WAIT end
#-------------------------------------------------------------------------- # Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :custom_action_flag
#-------------------------------------------------------------------------- # alias skill_can_use? #-------------------------------------------------------------------------- alias skill_can_use_cba skill_can_use? unless $@ def skill_can_use?(skill) if @custom_action_flag == true return super else return skill_can_use_cba(skill) end end
#-------------------------------------------------------------------------- # alias execute_action_wait #-------------------------------------------------------------------------- alias execute_action_wait_cba execute_action_wait unless $@ def execute_action_wait if Vocab::DoWait != nil execute_action_wait_cba end end
#-------------------------------------------------------------------------- # alias end_target_enemy_selection #-------------------------------------------------------------------------- alias end_target_enemy_selection_cba end_target_enemy_selection unless $@ def end_target_enemy_selection end_target_enemy_selection_cba if @skill_window == nil @actor_command_window.active = true end end
#-------------------------------------------------------------------------- # alias end_target_actor_selection #-------------------------------------------------------------------------- alias end_target_actor_selection_cba end_target_actor_selection unless $@ def end_target_actor_selection end_target_actor_selection_cba if @skill_window == nil @actor_command_window.active = true end end
#-------------------------------------------------------------------------- # alias update actor command selection #-------------------------------------------------------------------------- alias update_actor_command_selection_cba update_actor_command_selection unless $@ def update_actor_command_selection if Input.trigger?(Input::C) if $imported["CustomSkillEffects"] @active_battler.reset_mix_items @active_battler.subskill_flag = nil @active_battler.set_chain end determine_actor_command else update_actor_command_selection_cba end end
#-------------------------------------------------------------------------- # new method determine actor command #-------------------------------------------------------------------------- def determine_actor_command @active_battler.custom_action_flag = false command = @actor_command_window.command case command when "-Attack" Sound.play_decision @active_battler.action.set_attack start_target_enemy_selection when "-Skill" Sound.play_decision start_skill_selection when "-Guard" Sound.play_decision @active_battler.action.set_guard next_actor when "-Item" Sound.play_decision start_item_selection when "-Wait" Sound.play_decision @active_battler.action.kind = 0 @active_battler.action.basic = 3 next_actor else unless YE::BATTLE::COMMANDS::CUSTOM_COMMANDS.include?(command) Sound.play_buzzer else @active_battler.custom_action_flag = true @skill = $data_skills[YE::BATTLE::COMMANDS::CUSTOM_COMMANDS[command]] if @active_battler.skill_can_use?(@skill) Sound.play_decision if $imported["CustomSkillEffects"] and @skill.mix_items start_skill_selection create_mix_item_windows elsif $imported["CustomSkillEffects"] and @skill.subskills != [] start_skill_selection create_subskill_windows elsif $imported["CustomSkillEffects"] and @skill.chain_type > 0 start_skill_selection create_chain_windows elsif $imported["CustomSkillEffects"] and @skill.throw_skill start_skill_selection create_throw_windows else determine_custom_action end else Sound.play_buzzer end end end end
#-------------------------------------------------------------------------- # determine_custom_action #-------------------------------------------------------------------------- def determine_custom_action @active_battler.action.set_skill(@skill.id) if @skill.need_selection? if @skill.for_opponent? start_target_enemy_selection else start_target_actor_selection end else next_actor end end
#-------------------------------------------------------------------------- # overwrite setup #-------------------------------------------------------------------------- def setup(actor) @actor = actor @commands = [] if YE::BATTLE::COMMANDS::CLASS_COMMANDS.include?(@actor.class.id) array = YE::BATTLE::COMMANDS::CLASS_COMMANDS[@actor.class.id] else array = YE::BATTLE::COMMANDS::CLASS_COMMANDS[0] end for command in array if command == "-Subclass" if subclass_check? command = YE::BATTLE::COMMANDS::SUBCLASS_COMMANDS[@actor.subclass.id] else command = "" end end @commands.push(command) unless command == "" end @item_max = @commands.size refresh self.index = 0 end
#-------------------------------------------------------------------------- # subclass check #-------------------------------------------------------------------------- def subclass_check? return false unless $imported["SubclassSelectionSystem"] return false if @actor.subclass == nil sub_id = @actor.subclass_id return false if !YE::BATTLE::COMMANDS::SUBCLASS_COMMANDS.include?(sub_id) return true end
#-------------------------------------------------------------------------- # overwrite refresh #-------------------------------------------------------------------------- def refresh create_contents for i in 0...@item_max draw_item(i) end end
#-------------------------------------------------------------------------- # return command #-------------------------------------------------------------------------- def command return @commands[self.index] end
#-------------------------------------------------------------------------- # new method draw item #-------------------------------------------------------------------------- def draw_item(index, enabled = true) rect = item_rect(index) rect.x += 4 rect.width -= 8 self.contents.clear_rect(rect) self.contents.font.color = normal_color cmd = @commands[index] #--- case cmd when "-Attack" text = Vocab::attack when "-Skill" if @actor.class.skill_name_valid text = @actor.class.skill_name else text = Vocab::skill end when "-Guard" text = Vocab::guard when "-Item" text = Vocab::item when "-Wait" text = YE::BATTLE::COMMANDS::WAIT_VOCAB else text = cmd if YE::BATTLE::COMMANDS::CUSTOM_COMMANDS.include?(cmd) skill = $data_skills[YE::BATTLE::COMMANDS::CUSTOM_COMMANDS[cmd]] @actor.custom_action_flag = true enabled = @actor.skill_can_use?(skill) @actor.custom_action_flag = false else enabled = false end end #--- self.contents.font.color.alpha = enabled ? 255 : 128 self.contents.draw_text(rect.x, rect.y, rect.width, WLH, text) end
end # Window_ActorCommand
#=============================================================================== # # END OF FILE # #===============================================================================
Revue du sujet Auteur Message Mitsarugi Sam 17 Juil 2010 - 18:40 Sujet: Re: [Aucun]
#=============================================================================== # # Yanfly Engine RD - Custom Battle Actions # Last Date Updated: 2009.06.25 # Level: Normal # # For those who would like to have more than just Attack, Skill, Guard, and # Item for their actions in their list, this script allows just that. You can # rearrange the ordering of the actions, bind new custom actions to skills, # and even incorporate subskill actions into the individual command lists. # #=============================================================================== # Updates: # ---------------------------------------------------------------------------- # o 2009.06.25 - Bug fix for enemy targetting cancel selection. # o 2009.06.23 - Compatibility update with Custom Skill Effects Upgrade 3. # o 2009.06.21 - Bug fix for ally targetting custom skill cancel. # o 2009.05.28 - Started script and finished. #=============================================================================== # Instructions #=============================================================================== # # Scroll down below and modify the module to reflect how you would like the # battle commands to appear for each class-type. # #=============================================================================== # # Compatibility # - Works With: Yanfly Custom Skill Effects # - Alias: Game_Actor: skill_can_use? # - Overwrites: Scene_Battle, execute_action_wait, update_actor_command # - Overwrites: Window_ActorCommand: all of it # #===============================================================================
$imported = {} if $imported == nil $imported["CustomBattleActions"] = true
module YE module BATTLE module COMMANDS
#------------------------------------------------------------------------ # CLASS COMMANDS #------------------------------------------------------------------------ # This following section will adjust commands for individual classes. If # a class ID is not included, it will take out the commands from class 0. # With that said, do not remove class 0. # # There are a few commands verbal commands reserved for the command hash. # "-Attack" - Reserved for basic attacking. # "-Skill" - Reserved for selecting skills. # "-Guard" - Reserved for guarding. # "-Item" - Reserved for using items. # "-Wait" - Reserved for the wait command. # "-Subclass" - Reserved for subclass skills. # "" - If empty, skip it. # # If you input other commands, be sure to spell them correctly as they # will reflect upon how it appears in game. #------------------------------------------------------------------------ # Note that class commands will be determined by the character's primary # class if you're using the Subclass Selection System. #------------------------------------------------------------------------ CLASS_COMMANDS ={ # DO NOT REMOVE CLASS ID ZERO! # ClassID => [ Actions, Actions, Actions...] 0 => ["-Attack", "-Skill", "-Subclass", "-Guard", "-Item"], 1 => ["-Attack", "-Skill", "Concentrazione", "-Item", "TEST"], 2 => ["-Attack", "-Skill", "Furtivita'", "-Item"], 3 => ["-Attack", "-Skill", "Assimila", "-Item"], 4 => ["-Attack", "-Skill", "Medicina", "-Item"], #1 => ["X-Attack", "-Skill", "-Subclass", "-Guard", "-Item"], } # Do not remove this.
# This following hash will determine what commands to replace when the # "-Subclass" command is inputted into the array of commands. If the # subclass's ID does not appear in this array, then it will return 0. SUBCLASS_COMMANDS ={ # DO NOT REMOVE CLASS ID ZERO! # ClassID => Name 0 => "", 2 => "X-Attack", 5 => "Light", 6 => "Darkness", 7 => "3-Attack", 9 => "Furtivita'", 10 => "Concentrazione", 11 => "Assimila", 12 => "Medicina",
} # Do not remove this.
# The following hash allows you to adjust which custom commands to bind # to which skills for the actions to come out of. The custom actions will # still consume HP/MP/Rage. If it's unusable, then it'll be greyed out. CUSTOM_COMMANDS ={ # Follow the example. # -Command Name- => Skill.ID "Furtivita'" => 32, "Concentrazione" => 1, "Assimila" => 15, "Medicina" => 23 } # Do not remove this.
# For those who use "-Wait" and would like to change how Wait appears, # adjust the value below. Also following is how the action takes place. WAIT_VOCAB = "Wait" ACTION_WAIT = "%s is waiting." # Set to nil to not show wait.
end # COMMANDS end # BATTLE end # YE
#=============================================================================== # Editting anything past this point may potentially result in causing computer # damage, incontinence, explosion of user's head, coma, death, and/or halitosis. # Therefore, edit at your own risk. #===============================================================================
module Vocab DoWait = YE::BATTLE::COMMANDS::ACTION_WAIT end
#-------------------------------------------------------------------------- # Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :custom_action_flag
#-------------------------------------------------------------------------- # alias skill_can_use? #-------------------------------------------------------------------------- alias skill_can_use_cba skill_can_use? unless $@ def skill_can_use?(skill) if @custom_action_flag == true return super else return skill_can_use_cba(skill) end end
#-------------------------------------------------------------------------- # alias execute_action_wait #-------------------------------------------------------------------------- alias execute_action_wait_cba execute_action_wait unless $@ def execute_action_wait if Vocab::DoWait != nil execute_action_wait_cba end end
#-------------------------------------------------------------------------- # alias end_target_enemy_selection #-------------------------------------------------------------------------- alias end_target_enemy_selection_cba end_target_enemy_selection unless $@ def end_target_enemy_selection end_target_enemy_selection_cba if @skill_window == nil @actor_command_window.active = true end end
#-------------------------------------------------------------------------- # alias end_target_actor_selection #-------------------------------------------------------------------------- alias end_target_actor_selection_cba end_target_actor_selection unless $@ def end_target_actor_selection end_target_actor_selection_cba if @skill_window == nil @actor_command_window.active = true end end
#-------------------------------------------------------------------------- # alias update actor command selection #-------------------------------------------------------------------------- alias update_actor_command_selection_cba update_actor_command_selection unless $@ def update_actor_command_selection if Input.trigger?(Input::C) if $imported["CustomSkillEffects"] @active_battler.reset_mix_items @active_battler.subskill_flag = nil @active_battler.set_chain end determine_actor_command else update_actor_command_selection_cba end end
#-------------------------------------------------------------------------- # new method determine actor command #-------------------------------------------------------------------------- def determine_actor_command @active_battler.custom_action_flag = false command = @actor_command_window.command case command when "-Attack" Sound.play_decision @active_battler.action.set_attack start_target_enemy_selection when "-Skill" Sound.play_decision start_skill_selection when "-Guard" Sound.play_decision @active_battler.action.set_guard next_actor when "-Item" Sound.play_decision start_item_selection when "-Wait" Sound.play_decision @active_battler.action.kind = 0 @active_battler.action.basic = 3 next_actor else unless YE::BATTLE::COMMANDS::CUSTOM_COMMANDS.include?(command) Sound.play_buzzer else @active_battler.custom_action_flag = true @skill = $data_skills[YE::BATTLE::COMMANDS::CUSTOM_COMMANDS[command]] if @active_battler.skill_can_use?(@skill) Sound.play_decision if $imported["CustomSkillEffects"] and @skill.mix_items start_skill_selection create_mix_item_windows elsif $imported["CustomSkillEffects"] and @skill.subskills != [] start_skill_selection create_subskill_windows elsif $imported["CustomSkillEffects"] and @skill.chain_type > 0 start_skill_selection create_chain_windows elsif $imported["CustomSkillEffects"] and @skill.throw_skill start_skill_selection create_throw_windows else determine_custom_action end else Sound.play_buzzer end end end end
#-------------------------------------------------------------------------- # determine_custom_action #-------------------------------------------------------------------------- def determine_custom_action @active_battler.action.set_skill(@skill.id) if @skill.need_selection? if @skill.for_opponent? start_target_enemy_selection else start_target_actor_selection end else next_actor end end
#-------------------------------------------------------------------------- # overwrite setup #-------------------------------------------------------------------------- def setup(actor) @actor = actor @commands = [] if YE::BATTLE::COMMANDS::CLASS_COMMANDS.include?(@actor.class.id) array = YE::BATTLE::COMMANDS::CLASS_COMMANDS[@actor.class.id] else array = YE::BATTLE::COMMANDS::CLASS_COMMANDS[0] end for command in array if command == "-Subclass" if subclass_check? command = YE::BATTLE::COMMANDS::SUBCLASS_COMMANDS[@actor.subclass.id] else command = "" end end @commands.push(command) unless command == "" end @item_max = @commands.size refresh self.index = 0 end
#-------------------------------------------------------------------------- # subclass check #-------------------------------------------------------------------------- def subclass_check? return false unless $imported["SubclassSelectionSystem"] return false if @actor.subclass == nil sub_id = @actor.subclass_id return false if !YE::BATTLE::COMMANDS::SUBCLASS_COMMANDS.include?(sub_id) return true end
#-------------------------------------------------------------------------- # overwrite refresh #-------------------------------------------------------------------------- def refresh create_contents for i in 0...@item_max draw_item(i) end end
#-------------------------------------------------------------------------- # return command #-------------------------------------------------------------------------- def command return @commands[self.index] end
#-------------------------------------------------------------------------- # new method draw item #-------------------------------------------------------------------------- def draw_item(index, enabled = true) rect = item_rect(index) rect.x += 4 rect.width -= 8 self.contents.clear_rect(rect) self.contents.font.color = normal_color cmd = @commands[index] #--- case cmd when "-Attack" text = Vocab::attack when "-Skill" if @actor.class.skill_name_valid text = @actor.class.skill_name else text = Vocab::skill end when "-Guard" text = Vocab::guard when "-Item" text = Vocab::item when "-Wait" text = YE::BATTLE::COMMANDS::WAIT_VOCAB else text = cmd if YE::BATTLE::COMMANDS::CUSTOM_COMMANDS.include?(cmd) skill = $data_skills[YE::BATTLE::COMMANDS::CUSTOM_COMMANDS[cmd]] @actor.custom_action_flag = true enabled = @actor.skill_can_use?(skill) @actor.custom_action_flag = false else enabled = false end end #--- self.contents.font.color.alpha = enabled ? 255 : 128 self.contents.draw_text(rect.x, rect.y, rect.width, WLH, text) end
end # Window_ActorCommand
#=============================================================================== # # END OF FILE # #===============================================================================
Config:exemple ID de la classe=>[Com1,Com2...etc]
Plus bas: Nom de la commande=>ID du sort En esperant t'avoir aidé!
Garruk
Aventurier Lv.16
Age : 40 Inscrit le : 03/09/2009 Messages : 1503
Sujet: Re: [Résolu]Besoin d'aide pour le fonctionnement d'un script. Mer 21 Juil 2010 - 16:55
Je ne connaissais pas ce script je vais voir ce que ça donne merci bien pour ton aide.
J'éditerai le titre si ce script me convient.
Contenu sponsorisé
Sujet: Re: [Résolu]Besoin d'aide pour le fonctionnement d'un script.
[Résolu]Besoin d'aide pour le fonctionnement d'un script.