J'ai donc pris ce script et je l'ai modifier pour l'essayer.
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"], 5 => ["-Attack", "-Skill", "Invocation", "Guard", "-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 => "Invocation", 6 => "Darkness", 7 => "3-Attack", } # 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 "X-Attack" => 1, "3-Attack" => 3, "Invocation" => 140, "Darkness" => 80, "Test" => 109, } # 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"] @commander.reset_mix_items @commander.subskill_flag = nil @commander.set_chain end determine_actor_command else update_actor_command_selection_cba end end
#-------------------------------------------------------------------------- # new method determine actor command #-------------------------------------------------------------------------- def determine_actor_command @commander.custom_action_flag = false command = @actor_command_window.command case command when "-Attack" Sound.play_decision @commander.action.set_attack start_target_enemy_selection when "-Skill" Sound.play_decision start_skill_selection when "-Guard" Sound.play_decision @commander.action.set_guard end_command when "-Item" Sound.play_decision start_item_selection when "-Wait" Sound.play_decision @commander.action.kind = 0 @commander.action.basic = 3 end_command else unless YE::BATTLE::COMMANDS::CUSTOM_COMMANDS.include?(command) Sound.play_buzzer else @commander.custom_action_flag = true @skill = $data_skills[YE::BATTLE::COMMANDS::CUSTOM_COMMANDS[command]] if @commander.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 @commander.action.set_skill(@skill.id) if @skill.need_selection? if @skill.for_opponent? start_target_enemy_selection else start_target_actor_selection end else end_command 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 # #=======================
J'ai bien réussi a rajouter la commande invocation mais au lieu de m'ouvrir un autre menus avec les sort souhaiter (Skill ID 140), la commande invocation me lance directement mon sort sans me faire entrer dans un sous menus.
Questions :
-Sauriez vous comment faire pour faire en sorte que ma commande invocation devienne un commande comme skill, c'est a dire que lorsque j’appuie dessus ça m'ouvre un sous menus avec une liste des sort definis.
PS : j'ai bien essayer de mettre un autre sort a coter de "Invocation" => 140,(ligne 91) mais le jeu plante.
Dernière édition par Shyno19 le Mar 23 Aoû 2011 - 15:12, édité 1 fois
Shyno19
Va-nu-pieds Lv.4
Inscrit le : 22/03/2011 Messages : 66
Sujet: Re: [Resolu]Script D'ajout de commande(magie noire, invocation etc...) Ven 19 Aoû 2011 - 12:31
même si ça ne fait pas 24 h que j'ai poster je me permet de faire un petit up c'est le plus important que j'ai a regler pour ça.
Cordialement
Shyno19
Va-nu-pieds Lv.4
Inscrit le : 22/03/2011 Messages : 66
Sujet: Re: [Resolu]Script D'ajout de commande(magie noire, invocation etc...) Dim 21 Aoû 2011 - 22:15
desoler pour le triple poste mais comme personne n'a l'air disposer a pouvoir m'aider ou me conseiller, il serait preferable qu'un modo vienne lock ce sujet merci
Bon alors je vais répondre un coup. Désolé, je suis encore un petit scripteur de pacotille, c'est pourquoi je vais pas proposer de script, MOUHAHAHA !!
Alors, au lieu de créer un sous-menu, pourquoi ne pas mettre toutes les invocations dans le menu des "skills" normaux avec comme nom "Invocation : Machin". ça fera quasiment aussi propre que de créer un sous-menu, mais ce sera tout de même plus simple.
D'accord !! Enfin, c'était juste un avis perso, parce que moi, je pense à Sheena de Tales of Symphonia, qui mélange coups normaux et invocation, et en fait les invocations sont dans le même menu, mais toutes ensembles à la fin, et ça rend pas trop mal je trouve... Après, bon, si tu veux faire comme ça, bonne chance !!
C'est surtout que le script ne fait pas ce que tu veux. Dans le sujet initial, Garruk à posté un script, et celui là fait ce que tu veux.
Alors je le remet là :
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 = false #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','Blue','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], [], [], [], []]
#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
Pour l'utiliser c'est simple tout ce passe au début :
Code:
#Config
Allow_Skill = false #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','Blue','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], [], [], [], []]
#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
Alors on y va étape par étape :
Code:
Allow_Skill = false #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.
Alors la si tu met true, t’aura toujours la commande "Sort" qui regroupera tous tes sorts, et les autres catégories en dessous. Si tu met false t'aura pas l'onglet normal, mais juste les catégories spéciales. (Si tu vois pas, je te conseille de tester pour voir la différence)
Code:
#Edit these to change the command names. You can have as many as you want. Subsets = ['White','Black','Summon','Blue','Magic', 'Dance','Dark','Skills','Sing','Transform']
La tu donne un nom à tes commandes si tu veux Magie Noire, Magie Blanche, Arcanes, Compétences, Magie Bleue il faudra mettre :
Code:
#Edit these to change the command names. You can have as many as you want. Subsets = ["Magie Noire", "Magie Blanche", "Arcanes","Compétences","Magie Bleue"]
Code:
#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
Si tu veux que les catégorie apparaissent uniquement quand un héros à un sort de cette catégorie tu met true et tu ignore la prochaine étape. Si tu veux que même si ton héros n'a pas de compétence de Magie blanche, le menu apparaisse quand même, tu met false.
Code:
#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], [], [], [], []]
Alors si tu a mis true avant ça sert à rien de configurer ici. Si tu as mis false il faut définir quelles commandes apparaissent pour quels héros. Imaginons tu veux que la classe Mage et Mage Blanc d'ID 5 et 9 aient le menu Magie Blanche, et que Berserk et Guerrier d'ID 4 et 6 aient le menu Compétences et pour finir la classe d'ID 2 Arcanes. Il faudra mettre :
Code:
#Edit these to change the command names. You can have as many as you want. Subsets = ["Magie Noire", "Magie Blanche", "Arcanes","Compétences","Magie Bleue"]
Code:
#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 = [[], [5,9], [2], [4,6], []]
Tu vois que Magie Blanche est en deuxième position, et bah pour définir les classes qui ont le menu Magie Blanche il faudra mettre leur ID à la deuxième position, et ça marche pareil pour les autres.
Et pour finir, si tu veux un sort qui apparaissent dans la catégorie Magie Blanche, il faut mettre dans la partie note de ton sort Magie Blanche. Ça marche exactement pareil pour les autres nom de classe !
Shyno19
Va-nu-pieds Lv.4
Inscrit le : 22/03/2011 Messages : 66
Sujet: Re: [Resolu]Script D'ajout de commande(magie noire, invocation etc...) Mar 23 Aoû 2011 - 14:31
merci bien Blockade je vais tester de suite ce que ça donne.
j’éditerais si cela me convient.^^
EDIT : c'est exactement ce que je cherchais un grand merci a toi Blockade enfin une personne qui m'a compris ^^ je vais editer le titre du sujet pour y mettre resolu
Blockade
Ex-Admin Cruelle
Age : 32 Inscrit le : 03/07/2008 Messages : 2441
Sujet: Re: [Resolu]Script D'ajout de commande(magie noire, invocation etc...) Mar 23 Aoû 2011 - 15:51
De rien
T'es pas obligé de mettre résolu ici, y'a pas de classement.
desoler de remonter le topic mais j'ai un bug avec ce script en fait.
En gros tout mes sort ce mettent dans une seule categorie.
Par exemple mon heros a 2 categories : magie blanche compétence
et ben tous les sort sont dans magie blanche et compétence me lance GARDE.
je ne vois absolument pas d'ou cela peut il venir
Vigilante
Poulet carnivore Lv.2
Inscrit le : 02/11/2011 Messages : 15
Sujet: Re: [Resolu]Script D'ajout de commande(magie noire, invocation etc...) Mer 2 Nov 2011 - 20:48
J'ai un problème avec ce script. Je voudrais que les skills mis dans mes sous-compétences n'apparaissent pas dans ma première catégorie de compétences, mais ils ne sont pas mutuellement exclusifs
Utilisons "invocation" comme exemple. Tous les sorts appris avec "Invocation" dans le nom vont apparaître dans Invocation. Le problème est qu'ils apparaissent aussi dans skills. Y aurait-il une solution à ce problème?
Merci.
Contenu sponsorisé
Sujet: Re: [Resolu]Script D'ajout de commande(magie noire, invocation etc...)
[Resolu]Script D'ajout de commande(magie noire, invocation etc...)