DragonsDarkRpg

Bienvenue à tous, le forum à été inactif pendant un long moment mais, le forum reprend du service !!!
 
AccueilPortailFAQRechercherS'enregistrerMembresGroupesConnexion

Partagez | 
 

 Classer les skills dans Rpg maker Xp !

Aller en bas 
AuteurMessage
Lock the golden wolf
Admin principal et Level 100
avatar

Nombre de messages : 219
Date d'inscription : 22/02/2006

MessageSujet: Classer les skills dans Rpg maker Xp !   Dim 26 Fév - 10:21

nstallation : Ajouter dans le script " Scene_Battle 1" après " def main " à la ligne 11

Utilisation : Pour mettre par exemple une magie de feu dans la catégorie " magie blanche ". Dans la base de donnée, allez dans cette magie ( de feu ) et en description, mettez le mot clé " blanche " ( les mots clé peuvent être changé à la ligne 9 )

Code :


#==========================================================================
# ¦ Le tableau de choix
#-------------------------------------------------------------------------------------------------------------------------------------
# ?*Pour ajouter: ajoutez une virgule et marquez ente " " ce que vous voulez afficher pour les
# 2 ligne suivante et ajouter à la ligne 33 après n[x], une nouvelle virgule et un nouveau n[x+1]
# ?**Pour enlever: vous n'avez qu'à enlever les dernière valeur de chaque ligne (invocation, n[2]...)
#==========================================================================
n=["Magie Noir","Magie Blanche","Invocation"]# Le nom des options
@mot_clef=["noire","blanche","Invocation"] # les mot clef a mettre dans la description de la compétence

@command_competence = Window_Command.new(160, [ n[0],n[1], n[2] ]) #affiche commande
@command_competence.y = 160 # position vertical
@command_competence.opacity = 160
@command_competence.active = false
@command_competence.visible = false
@command_competence.z=1000
#===========================================================================


Ensuite remplacer Scene_battle 3 par


#==============================================================================
# ¦ Scene_Battle (???? 3)
#------------------------------------------------------------------------------
#==============================================================================

class Scene_Battle
#--------------------------------------------------------------------------
# ? ??????????????
#--------------------------------------------------------------------------
def start_phase3
# ???? 3 ???
@phase = 3
# ?????????????
@actor_index = -1
@active_battler = nil
# ??????????????
phase3_next_actor
end
#--------------------------------------------------------------------------
# ? ??????????????
#--------------------------------------------------------------------------
def phase3_next_actor
$option2=false
# ???
begin
# ???????????? OFF
if @active_battler != nil
@active_battler.blink = false
end
# ??????????
if @actor_index == $game_party.actors.size-1
# ?????????
start_phase4
return
end
# ???????????????
@actor_index += 1
@active_battler = $game_party.actors[@actor_index]
@active_battler.blink = true
# ??????????????????????????
end until @active_battler.inputable?
# ????????????????????
phase3_setup_command_window
end
#--------------------------------------------------------------------------
# ? ??????????????
#--------------------------------------------------------------------------
def phase3_prior_actor
# ???
begin
# ???????????? OFF
if @active_battler != nil
@active_battler.blink = false
end
# ??????????
if @actor_index == 0
# ??????????????
start_phase2
return
end
# ??????????????
@actor_index -= 1
@active_battler = $game_party.actors[@actor_index]
@active_battler.blink = true
# ??????????????????????????
end until @active_battler.inputable?
# ????????????????????
phase3_setup_command_window
end
#--------------------------------------------------------------------------
# ? ????????????????????
#--------------------------------------------------------------------------
def phase3_setup_command_window
# ?????????????????
@party_command_window.active = false
@party_command_window.visible = false
# ?????????????????
@actor_command_window.active = true
@actor_command_window.visible = true
# ???????????????????
@actor_command_window.x = @actor_index * 160
# ??????? 0 ???
@actor_command_window.index = 0
end
#--------------------------------------------------------------------------
# ? ?????? (????????????)
#--------------------------------------------------------------------------
def update_phase3
if @command_competence.visible
update_command2
else
# ?????????????
if @enemy_arrow != nil
update_phase3_enemy_select
# ?????????????
elsif @actor_arrow != nil
update_phase3_actor_select
# ??????????????
elsif @skill_window != nil
update_phase3_skill_select
# ???????????????
elsif @item_window != nil
update_phase3_item_select
# ???????????????????
elsif @actor_command_window.active
update_phase3_basic_command
end
end
end
#--------------------------------------------------------------------------
# ? ?????? (???????????? : ??????)
#--------------------------------------------------------------------------
def update_command2
@command_competence.update
@actor_command_window.active=false
@command_competence.active=true
if Input.trigger?(Input::C)
$option_magie=@mot_clef[@command_competence.index]
@command_competence.visible=false
@actor_command_window.visible=false
start_skill_select
end
if Input.trigger?(Input::B)
@command_competence.visible=false
@actor_command_window.active=true
end
end
#--------------------------------------------------------------------------
# ? ?????? (???????????? : ??????)
#--------------------------------------------------------------------------
def update_phase3_basic_command
# B ??????????
if Input.trigger?(Input::B)
# ????? SE ???
$game_system.se_play($data_system.cancel_se)
# ??????????????
phase3_prior_actor
return
end
if Input.trigger?(Input::C)
# ???????????????????????
case @actor_command_window.index
when 0 # ??
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ????????
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 0
# ??????????
start_enemy_select
when 1 # ???
@command_competence.visible=true
if @actor_index * 160+100>480
@command_competence.x = @actor_index * 160-100
else
@command_competence.x = @actor_index * 160+100
end
$game_system.se_play($data_system.decision_se)
# ????????
@active_battler.current_action.kind = 1
# update_phase3_basic_command
# ?????????
when 2 # ??
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ????????
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 1
# ??????????????
phase3_next_actor
when 3 # ????
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ????????
@active_battler.current_action.kind = 2
# ??????????
start_item_select
end
return
end
end
#--------------------------------------------------------------------------
# ? ?????? (???????????? : ?????)
#--------------------------------------------------------------------------
def update_phase3_skill_select
# ????????????????
@skill_window.visible = true
# ???????????
@skill_window.update
# B ??????????
if Input.trigger?(Input::B)
# ????? SE ???
$game_system.se_play($data_system.cancel_se)
# ?????????
end_skill_select
return
end
# C ??????????
if Input.trigger?(Input::C)
# ????????????????????????
@skill = @skill_window.skill
# ????????
if @skill == nil or not @active_battler.skill_can_use?(@skill.id)
# ??? SE ???
$game_system.se_play($data_system.buzzer_se)
return
end
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ????????
@active_battler.current_action.skill_id = @skill.id
# ?????????????????
@skill_window.visible = false
# ???????????
if @skill.scope == 1
# ??????????
start_enemy_select
# ????????????
elsif @skill.scope == 3 or @skill.scope == 5
# ??????????
start_actor_select
# ?????????????
else
# ?????????
end_skill_select
# ??????????????
phase3_next_actor
end
return
end
end
#--------------------------------------------------------------------------
# ? ?????? (???????????? : ??????)
#--------------------------------------------------------------------------
def update_phase3_item_select
# ?????????????????
@item_window.visible = true
# ????????????
@item_window.update
# B ??????????
if Input.trigger?(Input::B)
# ????? SE ???
$game_system.se_play($data_system.cancel_se)
# ??????????
end_item_select
return
end
# C ??????????
if Input.trigger?(Input::C)
# ?????????????????????????
@item = @item_window.item
# ????????
unless $game_party.item_can_use?(@item.id)
# ??? SE ???
$game_system.se_play($data_system.buzzer_se)
return
end
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ????????
@active_battler.current_action.item_id = @item.id
# ??????????????????
@item_window.visible = false
# ???????????
if @item.scope == 1
# ??????????
start_enemy_select
# ????????????
elsif @item.scope == 3 or @item.scope == 5
# ??????????
start_actor_select
# ?????????????
else
# ??????????
end_item_select
# ??????????????
phase3_next_actor
end
return
end
end
#--------------------------------------------------------------------------
# ? ?????? (???????????? : ??????)
#--------------------------------------------------------------------------
def update_phase3_enemy_select
# ??????????
@enemy_arrow.update
# B ??????????
if Input.trigger?(Input::B)
# ????? SE ???
$game_system.se_play($data_system.cancel_se)
# ??????????
end_enemy_select
return
end
# C ??????????
if Input.trigger?(Input::C)
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ????????
@active_battler.current_action.target_index = @enemy_arrow.index
# ??????????
end_enemy_select
# ??????????????
if @skill_window != nil
# ?????????
end_skill_select
end
# ???????????????
if @item_window != nil
# ??????????
end_item_select
end
# ??????????????
phase3_next_actor
end
end
#--------------------------------------------------------------------------
# ? ?????? (???????????? : ??????)
#--------------------------------------------------------------------------
def update_phase3_actor_select
# ??????????
@actor_arrow.update
# B ??????????
if Input.trigger?(Input::B)
# ????? SE ???
$game_system.se_play($data_system.cancel_se)
# ??????????
end_actor_select
return
end
# C ??????????
if Input.trigger?(Input::C)
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ????????
@active_battler.current_action.target_index = @actor_arrow.index
# ??????????
end_actor_select
# ??????????????
if @skill_window != nil
# ?????????
end_skill_select
end
# ???????????????
if @item_window != nil
# ??????????
end_item_select
end
# ??????????????
phase3_next_actor
end
end
#--------------------------------------------------------------------------
# ? ????????
Revenir en haut Aller en bas
Voir le profil de l'utilisateur http://dragonsdarkrpg.virtuaboard.com
Lock the golden wolf
Admin principal et Level 100
avatar

Nombre de messages : 219
Date d'inscription : 22/02/2006

MessageSujet: Re: Classer les skills dans Rpg maker Xp !   Dim 26 Fév - 10:21

la suite maintenant:
#--------------------------------------------------------------------------
def start_enemy_select
# ??????????
@enemy_arrow = Arrow_Enemy.new(@spriteset.viewport1)
# ?????????????
@enemy_arrow.help_window = @help_window
# ?????????????????
@actor_command_window.active = false
@actor_command_window.visible = false
end
#--------------------------------------------------------------------------
# ? ????????
#--------------------------------------------------------------------------
def end_enemy_select
# ??????????
@enemy_arrow.dispose
@enemy_arrow = nil
# ????? [??] ???
if @actor_command_window.index == 0
# ?????????????????
@actor_command_window.active = true
@actor_command_window.visible = true
# ???????????
@help_window.visible = false
end
end
#--------------------------------------------------------------------------
# ? ????????
#--------------------------------------------------------------------------
def start_actor_select
# ??????????
@actor_arrow = Arrow_Actor.new(@spriteset.viewport2)
@actor_arrow.index = @actor_index
# ?????????????
@actor_arrow.help_window = @help_window
# ?????????????????
@actor_command_window.active = false
@actor_command_window.visible = false
end
#--------------------------------------------------------------------------
# ? ????????
#--------------------------------------------------------------------------
def end_actor_select
# ??????????
@actor_arrow.dispose
@actor_arrow = nil
end
#--------------------------------------------------------------------------
# ? ???????
#--------------------------------------------------------------------------
def start_skill_select
# ???????????
@skill_window = Window_Skill.new(@active_battler)
# ?????????????
@skill_window.help_window = @help_window
# ?????????????????
@actor_command_window.active = false
@actor_command_window.visible = false
end
#--------------------------------------------------------------------------
# ? ???????
#--------------------------------------------------------------------------
def end_skill_select
# ???????????
@skill_window.dispose
@skill_window = nil
# ???????????
@help_window.visible = false
# ?????????????????
@actor_command_window.active = true
@actor_command_window.visible = true
end
#--------------------------------------------------------------------------
# ? ????????
#--------------------------------------------------------------------------
def start_item_select
# ????????????
@item_window = Window_Item.new
# ?????????????
@item_window.help_window = @help_window
# ?????????????????
@actor_command_window.active = false
@actor_command_window.visible = false
end
#--------------------------------------------------------------------------
# ? ????????
#--------------------------------------------------------------------------
def end_item_select
# ????????????
@item_window.dispose
@item_window = nil
# ???????????
@help_window.visible = false
# ?????????????????
@actor_command_window.active = true
@actor_command_window.visible = true
end
end


Et pour finir il suffit de remplacer le contenu de Scene_Skill par

#==============================================================================
# ¦ Scene_Skill
#------------------------------------------------------------------------------
#==============================================================================

class Scene_Skill
#--------------------------------------------------------------------------
# ? ?????????
# actor_index : ??????????
#--------------------------------------------------------------------------
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
$option_magie=" "
end
#--------------------------------------------------------------------------
# ? ?????
#--------------------------------------------------------------------------
def main
@actor = $game_party.actors[@actor_index]
@help_window = Window_Help.new
@status_window = Window_SkillStatus.new(@actor)
@skill_window = Window_Skill.new(@actor)

#==========================================================================
# ¦ Le tableau de choix
#-------------------------------------------------------------------------------------------------------------------------------------
# ?*Pour ajouter: ajouter une virgule et marque ente " " ce que vous voulez afficher pour les
# 3 ligne suivant les explication et ajouter à la ligne 33 après n[x], une nouvelle virgule et un nouveau n[x+1]
# ?**Pour enlever: vous n'avez qu'à enlever les dernière valeur de chaque ligne (invocation, n[2]...)
#==========================================================================
n=["Magie Noir","Magie Blanche","Invocation"]# Les options
@mot_clef=["noir","blanche","Invocation"] # les mot clef
@aide=["Affiche la magie noir","Affiche la magie blance","Affiche les Invocation possible"] # l'aide

@command_window = Window_Command.new(160, [ n[0],n[1], n[2] ]) #affiche commande
@command_window.x=480 # position horizontal (max 640)
@command_window.y=0 # position vertical (max 480)
@command_window.z=1000
@command_window.opacity=255 # régle l'opacité (max 255)
#===========================================================================

@target_window = Window_Target.new
@target_window.visible = false
@target_window.active = false
@skill_window.active=false
@command_window.active=true
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@help_window.dispose
@status_window.dispose
@skill_window.dispose
@target_window.dispose

end
#--------------------------------------------------------------------------
# ?
#--------------------------------------------------------------------------
def update
if @command_window.active
@command_window.update
if Input.trigger?(Input::B) and @command_window.active
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(1)
@skill_window.active = true
@target_window.visible = false
@target_window.active = false
@command_window.active=false
@command_window.visible=false
end
#-------------------------Retour au menu-------------------
#------------------------------------------------------------
#------------------------curseur survol-------------------
$option_magie=@mot_clef[@command_window.index]
@help_window.set_text(@aide[@command_window.index])
@skill_window.refresh

#-------------------------apuis sur la touche-------------------
if Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
@skill_window.active=true
@command_window.active=false
@skill_window.help_window = @help_window
end
else
update_back
end
end
#==============ancien update==============
def update_back
#-------------------------------------------------------
# ????????
@help_window.update
@status_window.update
@skill_window.update
@target_window.update
# ?????????????????: update_skill ???
if @skill_window.active
# print("2")
update_skill
return
end
# ???????????????????: update_target ???
if @target_window.active
update_target
return
end
end
#--------------------------------------------------------------------------
# ? ?????? (?????????????????)
#--------------------------------------------------------------------------
def update_skill
# B ??????????
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active=true
@command_window.visible=true
@skill_window.active=false
end
# C ??????????
if Input.trigger?(Input::C)
# ????????????????????????
@skill = @skill_window.skill
# ????????
if @skill == nil or not @actor.skill_can_use?(@skill.id)
# ??? SE ???
$game_system.se_play($data_system.buzzer_se)
return
end
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ??????????
if @skill.scope >= 3
# ?????????????????
@skill_window.active = false
@target_window.x = (@skill_window.index + 1) % 2 * 304
@target_window.visible = true
@target_window.active = true
# ???? (??/??) ?????????????
if @skill.scope == 4 || @skill.scope == 6
@target_window.index = -1
elsif @skill.scope == 7
@target_window.index = @actor_index - 10
else
@target_window.index = 0
end
# ????????????
else
# ??????? ID ??????
if @skill.common_event_id > 0
# ?????????????
$game_temp.common_event_id = @skill.common_event_id
# ??????? SE ???
$game_system.se_play(@skill.menu_se)
# SP ??
@actor.sp -= @skill.sp_cost
# ?????????????
@status_window.refresh
@skill_window.refresh
@target_window.refresh
# ??????????
$scene = Scene_Map.new
return
end
end
return
end
# R ??????????
if Input.trigger?(Input::R)
# ???? SE ???
$game_system.se_play($data_system.cursor_se)
# ???????
@actor_index += 1
@actor_index %= $game_party.actors.size
# ????????????
$scene = Scene_Skill.new(@actor_index)
return
end
# L ??????????
if Input.trigger?(Input::L)
# ???? SE ???
$game_system.se_play($data_system.cursor_se)
# ???????
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
# ????????????
$scene = Scene_Skill.new(@actor_index)
return
end
end
#--------------------------------------------------------------------------
# ? ?????? (???????????????????)
#--------------------------------------------------------------------------
def update_target
# B ??????????
if Input.trigger?(Input::B)
# ?????????????
@skill_window.active = true
@target_window.visible = false
@target_window.active = false
@command_window.active=false
@command_window.visible=false
return
end
# C ??????????
if Input.trigger?(Input::C)
# SP ????????????????
unless @actor.skill_can_use?(@skill.id)
# ??? SE ???
$game_system.se_play($data_system.buzzer_se)
return
end
# ???????????
if @target_window.index == -1
# ??????????????????
used = false
for i in $game_party.actors
used |= i.skill_effect(@actor, @skill)
end
end
# ????????????
if @target_window.index <= -2
# ??????????????????????
target = $game_party.actors[@target_window.index + 10]
used = target.skill_effect(@actor, @skill)
end
# ???????????
if @target_window.index >= 0
# ??????????????????????
target = $game_party.actors[@target_window.index]
used = target.skill_effect(@actor, @skill)
end
# ?????????
if used
# ??????? SE ???
$game_system.se_play(@skill.menu_se)
# SP ??
@actor.sp -= @skill.sp_cost
# ?????????????
@status_window.refresh
@skill_window.refresh
@target_window.refresh
# ?????
if $game_party.all_dead?
# ??????????????
$scene = Scene_Gameover.new
return
end
# ??????? ID ??????
if @skill.common_event_id > 0
# ?????????????
$game_temp.common_event_id = @skill.common_event_id
# ??????????
$scene = Scene_Map.new
return
end
end
# ????????????
unless used
# ??? SE ???
$game_system.se_play($data_system.buzzer_se)
end
return
end
end
end
class Window_Skill < Window_Selectable
#--------------------------------------------------------------------------
# ? ?????????
# actor : ????
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 128, 640, 352)
@actor = actor
@column_max = 2
refresh
self.index = 0
# ????????????????????????????
if $game_temp.in_battle
self.y = 64
self.height = 256
self.back_opacity = 160
end
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def skill
return @data[self.index]
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = [] #liste contenant les pouvoir
for i in 0...@actor.skills.size
skill = $data_skills[@actor.skills[i]]
# ================================
permission=false # pas affiche
skill.description.gsub!($option_magie) do
permission=true #affiche
$option_magie
end
#================affiche===============
if permission
@data.push(skill) #ajout dans la liste
end
# ================================
end


@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# ? ?????
# index : ????
#--------------------------------------------------------------------------
def draw_item(index)
skill = @data[index]
if @actor.skill_can_use?(skill.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
end
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.skill == nil ? "" : self.skill.description)
end
end
Revenir en haut Aller en bas
Voir le profil de l'utilisateur http://dragonsdarkrpg.virtuaboard.com
 
Classer les skills dans Rpg maker Xp !
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» Ajout d'une commande dans le script de quête [RESOLU]
» Comment classer les itinéraires et traces?
» Maker vx ace, demande d'aide pour un évènement.
» Insertion d'animation dans un php joomla
» (résolu)recherches effectuées dans la barre déroulante"recherche" de Neuf

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
DragonsDarkRpg :: Rpg Maker XP :: Scripts pour Rpg maker Xp-
Sauter vers: