[Résolu] [Script] YERD_CustomBattleAction (action impossible en combat)
Auteur
Message
niicoslash
Va-nu-pieds Lv.4
Age : 26 Inscrit le : 05/10/2010 Messages : 72
Sujet: [Résolu] [Script] YERD_CustomBattleAction (action impossible en combat) Ven 30 Déc 2011 - 21:54
Bonsoir tout le monde. Je viens de trouver un script très utile que je voulais depuis assez longtemps et grâce à ma chance de fou, ça ne marche pas Je vais vous donner le problème: -Le script marche correctement au départ, etc... -Mais lorsque je souhaite faire un combat et attaquer...
PAF !!
Et lorsque que j'utilise la section "3-Attack", ça me lance la compétence qui doit être lancé, mais ça ne fait aucun dégâts et termine le combat directement !
le script YERD_CustomBattleAction
Spoiler:
#=============================================================================== # # 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 => ["-Attaque", "-Magie", "-Subclass", "-Défense", "-Inventaire"], 1 => ["Attaque", "Magie", "3-Attack", "Défense", "Inventaire"], #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", 1 => "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" => 16, "Light" => 78, "Darkness" => 80, } # 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 # #===============================================================================
Dernière édition par niicoslash le Sam 7 Jan 2012 - 14:25, édité 1 fois
Zangther
Maître des Duels
Age : 32 Inscrit le : 29/07/2009 Messages : 7841
Sujet: Re: [Résolu] [Script] YERD_CustomBattleAction (action impossible en combat) Ven 30 Déc 2011 - 22:52
Tu utilise quoi comme script de combat ?
niicoslash
Va-nu-pieds Lv.4
Age : 26 Inscrit le : 05/10/2010 Messages : 72
Sujet: Re: [Résolu] [Script] YERD_CustomBattleAction (action impossible en combat) Ven 6 Jan 2012 - 20:00
J'utilise le script SBS Kaduki 3.4e
Le script
Spoiler:
#============================================================================== # ■ Sideview Battle System General Settings [3.4e] #------------------------------------------------------------------------------ # Original Script by: # Enu ( http://rpgex.sakura.ne.jp/home/ ) # English Localization: # Kylock, Mr. Bubble, Shu # Contributors & Special Thanks: # Shu, Moonlight, NightWalker, Enelvon, Atoa, AlphaWhelp, # blackmorning, Mithran, Kaduki, Enu # (See [Credits] for more information) #==============================================================================
$imported = {} if $imported == nil $imported["TankentaiSideview"] = true
#============================================================================== # ■ module N01 #------------------------------------------------------------------------------ # Sideview Battle System General Settings #============================================================================== module N01 #-------------------------------------------------------------------------- # ● Party Members Settings #-------------------------------------------------------------------------- # Battle member starting positions. Extra positions beyond 4 actors are # added in case one uses another script that increases the party size. # Extra coordinates will not adversely affect your game, otherwise. # # Position 1, Pos. 2, Pos. 3, Pos. 4 Pos. 5 Pos. 6 # X Y X Y X Y X Y X Y X Y ACTOR_POSITION = [[410,210],[440,245],[410,280],[440,225],[410,260],[0,270]] # Maximum party members that can fight at the same time. # Remember to add coordinates in the ACTOR_POSITION array if you # change the MAX_MEMBER value higher than 4. MAX_MEMBER = 3 # If KGC_LargeParty is installed, the value for MAX_MEMBER will be ignored # and will use the value for MAX_BATTLE_MEMBERS in KGC_LargeParty. #-------------------------------------------------------------------------- # * Battle Tempo Settings #-------------------------------------------------------------------------- # Delay after a battler completes an action in 1/60 sec. increments. ACTION_WAIT = 12 # Delay before enemy collapse animation in 1/60 sec. increments. COLLAPSE_WAIT = 12 # Delay before victory is processed in 1/60 sec. increments. WIN_WAIT = 70 #-------------------------------------------------------------------------- # * Help Window Settings #-------------------------------------------------------------------------- # Text that appears in Help Window when Guard is used. GUARD_HELP_TEXT = "Défense" # Text that appears in Help Window when escaping from battle. ESCAPED_HELP_TEXT = "Fuite" #-------------------------------------------------------------------------- # ● HP Gauge and Status Display Settings #-------------------------------------------------------------------------- # true: Display the state icons of the highlighted battlers in Help Window. # # To hide an individual enemy's states, type into the Notebox # of the enemy in the Database. WORD_STATE_DISPLAY = true # true: Display the HP gauge of highlighted battlers in Help Window. # # To hide an individual enemy's states, type into the Notebox # of the enemy in the Database. HP_DISPLAY = true # true: Display the HP gauge and states of highlighted actor in Help Window. ACTOR_DISPLAY = false # Name to display when there is no abnormal state. WORD_NORMAL_STATE = "Normal" # Do not display the HP gauge and states for the following enemies: ENEMY_NON_DISPLAY = [] # ex.[1,2,3] # Do not display the following states ID as abnormal: STATE_NON_DISPLAY = [] # ex.[1,2,3] #-------------------------------------------------------------------------- # * BattleFloor Settings #-------------------------------------------------------------------------- # BattleFloor display options. # FLOOR = [ X-position, Y-positon, Opacity] # BattleFloor can be hidden if opacity is set to 0. FLOOR = [0,0,0] #-------------------------------------------------------------------------- # * Targeting Cursor Position Settings #-------------------------------------------------------------------------- # Adjust the targeting cursor position CURSOR_X_PLUS = 0 CURSOR_Y_PLUS = 0 #-------------------------------------------------------------------------- # * Balloon Setting #-------------------------------------------------------------------------- # Emotion Balloon graphics file in the System folder. Balloons used in battle # can be different than those used in a game map. Balloon file must be # 10x8 frames, similar to the RTP Balloons. BALLOON_GRAPHICS = "Balloon" #-------------------------------------------------------------------------- # * Unarmed Animation Setting #-------------------------------------------------------------------------- # Defines Animation ID for any unarmed attack made by a battler. NO_WEAPON = 82 #-------------------------------------------------------------------------- # * Auto-Life Animation Setting #-------------------------------------------------------------------------- # Define the Animation ID used when a battler is revived # with an Auto-Life state. RESURRECTION = 41 #-------------------------------------------------------------------------- # * Damage Pop-up Settings #-------------------------------------------------------------------------- # Damage Pop-up image file name located in the Graphics/System folder. # Numbers in the image file must be arranged 0 to 9. See demo's number # graphics for an example. DAMAGE_GRAPHICS = "Number+" # Image file for HP recovery numbers. RECOVER_GRAPHICS = "Number-" # true: Allow use of separate number graphics for MP recovery and damage. # false: Use the same number graphics for MP recovery/damage as # HP recovery/damage. USE_MP_POP_GRAPHICS = true # Image file for MP damage numbers. MP_DAMAGE_GRAPHICS = "MP_Number+" # Image file for MP recovery numbers. MP_RECOVER_GRAPHICS = "MP_Number-" # Distance adjustment (in pixels) between Damage Pop-up digits. # Can be negative. NUM_INTERBAL = -12 # Duration (in frames) POP numbers are displayed. NUM_DURATION = 68 #-------------------------------------------------------------------------- # * Pop-up Window Settings #-------------------------------------------------------------------------- # true: Window skin used for Pop-up Window is not seen. # false: Pop-up Window skin is used. NON_DAMAGE_WINDOW = true # Pop-up Window text. For no text results, use "". POP_DAMAGE0 = "" # Attack results 0 damage POP_MISS = "Loupé !" # Attack missed POP_EVA = "Esquive!" # Attack avoided POP_CRI = "CRITIQUE !" # Attack scored a critical hit POP_MP_DAM = "MP -" # Attack caused MP loss POP_MP_REC = "MP +" # Attack restored MP #-------------------------------------------------------------------------- # * Battler Graphics Display Settings #-------------------------------------------------------------------------- # true: Allow the appearance shadows under battlers. # false: Disable the appearance of shadows in all cases. SHADOW = true # true: Use actor's Walking Graphic assigned in the Database. # false: Actor's Walking Graphic from the Database is not used. # If false, battler file with "_1" is required in the # Graphics/Characters. "_1" and subsequent files # ("_2", "_3", etc.) must have the same image length and width as # the "_1" file. WALK_ANIME = true # Number of columns in an animated battler graphics file. ANIME_PATTERN = 3 # Number of rows in an animated battler graphics file. ANIME_KIND = 4 #-------------------------------------------------------------------------- # * Back Attack Settings #-------------------------------------------------------------------------- # true: Allow back attacks to occur. # false: Disable all chance for back attacks to occur. BACK_ATTACK = true # Define whether back attacks will mirror battler positions. (true/false) # Not yet implemented. BACK_ATTACK_NON_BACK_MIRROR = true # Set equipment and skills to protect against back attacks # Defined equipment must be equipped to take effect, skills must be aquired # and switches must be ON. # For a single weapon: = [1] or Multiple Weapons: = [1,2] # Weapon IDs NON_BACK_ATTACK_WEAPONS = [] # Shield IDs NON_BACK_ATTACK_ARMOR1 = [] # Helmet IDs NON_BACK_ATTACK_ARMOR2 = [] # Armor IDs NON_BACK_ATTACK_ARMOR3 = [] # Accessory IDs NON_BACK_ATTACK_ARMOR4 = [] # Skill IDs NON_BACK_ATTACK_SKILLS = [] # Switch IDs (takes precedence over everything else) If switch is ON, # Back attack guaranteed. BACK_ATTACK_SWITCH = [] #-------------------------------------------------------------------------- # * Immortality Changing Method Setting #-------------------------------------------------------------------------- # If another Game_Battler method can alter immortality put the name # here in quotes # Example: ["my_script_set_immortal"] # The method will then automatically assign 'non_dead' to the correct value. # This is unecessary unless another script can change the value of @immortal # through a nonstandard accessor. Otherwise, ignore this setting. IMMORTALITY_CHANGING_METHODS = ["your_method_here"] # (untested) end
niicoslash
Va-nu-pieds Lv.4
Age : 26 Inscrit le : 05/10/2010 Messages : 72
Sujet: Re: [Résolu] [Script] YERD_CustomBattleAction (action impossible en combat) Sam 7 Jan 2012 - 14:25
Up ! Le problème est résolu, j'ai juste changer de place le script !
Contenu sponsorisé
Sujet: Re: [Résolu] [Script] YERD_CustomBattleAction (action impossible en combat)
[Résolu] [Script] YERD_CustomBattleAction (action impossible en combat)