New RPG Maker
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.


Forum traitant du logiciel RPG Maker tout en français ! Entraide, tutos, scripts, ressources, hébergement de vos projets RPG Maker 2000, 2003, XP et VX. Venez les présenter !
 
AccueilDernières imagesRechercherS'enregistrerConnexion
-39%
Le deal à ne pas rater :
Pack Home Cinéma Magnat Monitor : Ampli DENON AVR-X2800H, Enceinte ...
1190 € 1950 €
Voir le deal

 

 probleme script d'ajout de commande

Aller en bas 
4 participants
AuteurMessage
Shyno
Nouveau venu
Nouveau venu



Masculin Nombre de messages : 2
Age : 34
Localisation : france
Date d'inscription : 22/08/2011

probleme script d'ajout de commande Empty
MessageSujet: probleme script d'ajout de commande   probleme script d'ajout de commande EmptyLun 22 Aoû - 3:04

Bonsoir

en fouillant sur le net je suis tomber sur un sript permettant de rajouter des commande en combat que voici

Code:SÉLECTIONNER LE CONTENU
#===============================================================================
#
# 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

#==============================================================================
# Game_Actor
#==============================================================================

class Game_Actor < Game_Battler

#--------------------------------------------------------------------------
# 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

end

#===============================================================================
# Scene_Battle
#===============================================================================

class Scene_Battle < Scene_Base

#--------------------------------------------------------------------------
# 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

end # Scene_Battle

#===============================================================================
# Window_ActorCommand
#===============================================================================

class Window_ActorCommand < Window_Selectable

#--------------------------------------------------------------------------
# overwrite initialize
#--------------------------------------------------------------------------
def initialize
super(0, 0, 128, 128)
self.active = false
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.
Revenir en haut Aller en bas
Naqqah
Administrateur
Administrateur
Naqqah


Masculin Nombre de messages : 844
Age : 28
Localisation : Parti manger un ours
Date d'inscription : 22/02/2009

probleme script d'ajout de commande Empty
MessageSujet: Re: probleme script d'ajout de commande   probleme script d'ajout de commande EmptyLun 22 Aoû - 10:47

Est-ce qu'on peut avoir les instructions du scripteur (je pense qu'il y en a) puis le script d'origine ?
Je pense pas pouvoir faire grand chose mais ce sera déjà ça.
Revenir en haut Aller en bas
Shyno
Nouveau venu
Nouveau venu



Masculin Nombre de messages : 2
Age : 34
Localisation : france
Date d'inscription : 22/08/2011

probleme script d'ajout de commande Empty
MessageSujet: Re: probleme script d'ajout de commande   probleme script d'ajout de commande EmptyMar 23 Aoû - 17:29

il n'y avait aucune instruction...puis si il y en avait eu une je ne saurais pas la a demander votre aide.

au passage UP
Revenir en haut Aller en bas
caitsith
Nouveau venu
Nouveau venu
caitsith


Masculin Nombre de messages : 6
Age : 30
Localisation : Aisne
Date d'inscription : 01/08/2011

probleme script d'ajout de commande Empty
MessageSujet: Re: probleme script d'ajout de commande   probleme script d'ajout de commande EmptyMar 23 Aoû - 20:25

Hum...C'est pas la premiére fois que quelqu'un à un probléme avec se script d'ajout de commande.
Revenir en haut Aller en bas
Naqqah
Administrateur
Administrateur
Naqqah


Masculin Nombre de messages : 844
Age : 28
Localisation : Parti manger un ours
Date d'inscription : 22/02/2009

probleme script d'ajout de commande Empty
MessageSujet: Re: probleme script d'ajout de commande   probleme script d'ajout de commande EmptyMer 24 Aoû - 11:18

Il ne sert à rien d'écrire up si tu postes un message tu sais ?
De plus, souvent, les instructions ont beau être présentes, on peut avoir des problèmes avec les script. Donc tu pourrait être là avec des instructions.
Enfin, c'est rien.

Code:
# 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.

À mon avis, ça, c'est juste pour les actions uniques (il y a "attaque" mais non pas "magie" et il parle de "passer").

Code:
# -Command Name- => Skill.ID

Ça devrait expliquer pourquoi. Selon moi, sur cette partie, ce ne sont que des actions uniques ("overdrive", "attaque", ...).

JE te conseille aussi de faire comme moi, de mettre une balise code.
Revenir en haut Aller en bas
rayon-gama
Modérateur
Modérateur
rayon-gama


Masculin Nombre de messages : 352
Age : 44
Localisation : &é&quot;'(-è_çà)=#{[|\^@]} (Rege
Date d'inscription : 03/04/2010

probleme script d'ajout de commande Empty
MessageSujet: Re: probleme script d'ajout de commande   probleme script d'ajout de commande EmptyMer 24 Aoû - 11:41

Sinon tu pourrais aussi vite fait expliquer comme tu l'a installer on pourrait te dire si tu à fait une faut (ou pas ... enfin faut pas rêvé quand même (a) )

P.S : En parlant de ça killam pourrais tu mettre le smiley ou le truc jaune il a un truc d'ange au dessus de lui
Revenir en haut Aller en bas
Naqqah
Administrateur
Administrateur
Naqqah


Masculin Nombre de messages : 844
Age : 28
Localisation : Parti manger un ours
Date d'inscription : 22/02/2009

probleme script d'ajout de commande Empty
MessageSujet: Re: probleme script d'ajout de commande   probleme script d'ajout de commande EmptyDim 28 Aoû - 12:59

Est-ce que ton problème est résolu ? (Je lockerai si je n'ai pas de réponse dans la semaine prochaine.)
Revenir en haut Aller en bas
Contenu sponsorisé





probleme script d'ajout de commande Empty
MessageSujet: Re: probleme script d'ajout de commande   probleme script d'ajout de commande Empty

Revenir en haut Aller en bas
 
probleme script d'ajout de commande
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» [script] script de combat A-rpg [RMXP]
» [script](XP)script de menu super
» [Script VX] Demande de script ATB style DQ
» [XP]Demande de script
» [RPG Maker XP] Script de CBS Pokémon

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
New RPG Maker :: Making :: Entraide :: Aide sur les scripts-
Sauter vers: