| Artisan (Nv 5) |
 |
Inscrit le: 22 Nov 2011, 22:01 Messages: 199 Niveau RPG Maker: Moyen Logiciel(s) préféré(s): RPG Maker XP Point(s) Fort(s): Scripts Sexe: Masculin Points d'aide: 17/60
Créations :
Voir ses créations
|
Salut Creme brulée,
En event, c'est pas si compliqué à faire que ça, mais bon j'ai quand même fait un script. Alors voilà il y en a deux:
Pour le premier script, effaces ce qu'il y a à l'intérieur de Scene_Menu et remplace le par ça. J'ai ajouté une fonction L et R (Pour éviter la superposition des fenêtres). Tu n'es pas obligé de prendre ce Scene_Menu si tu comptes appeler le menu des fusions uniquement depuis la map. Justement pour appeler ce menu depuis la map fait insérer script et tu écris dedans:
- Code: Tout sélectionner
fusionner_monstres
- Code: Tout sélectionner
#============================================================================== # ■ Scene_Menu #------------------------------------------------------------------------------ # メニュー画面の処理を行うクラスです。 #==============================================================================
class Scene_Menu #-------------------------------------------------------------------------- # ● オブジェクト初期化 # menu_index : コマンドのカーソル初期位置 #-------------------------------------------------------------------------- def initialize(menu_index = 0) @menu_index = menu_index end #-------------------------------------------------------------------------- # ● メイン処理 #-------------------------------------------------------------------------- def main s1 = $data_system.words.item s2 = $data_system.words.skill s3 = $data_system.words.equip s4 = "État" s5 = "Fusions" s6 = "Sauvegarder" s7 = "Quitter" @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7]) @command_window.index = @menu_index if $game_party.actors.size == 0 @command_window.disable_item(0) @command_window.disable_item(1) @command_window.disable_item(2) @command_window.disable_item(3) end if $game_system.save_disabled @command_window.disable_item(4) end @LW = Window_Base.new(0, 0, 58, 58) @LW.contents = Bitmap.new(58-32, 58-32) @LW.contents.font.name = "Arial" @LW.contents.font.size = 24 @LW.contents.draw_text(0, 0, 18, 24, "L") @LW.visible = false @RW = Window_Base.new(0, 0, 58, 58) @RW.contents = Bitmap.new(58-32, 58-32) @RW.contents.font.name = "Arial" @RW.contents.font.size = 24 @RW.contents.draw_text(0, 0, 18, 24, "R") @RW.x = @command_window.width-@RW.width @LW.z = 1500 ; @RW.z = 1500 @playtime_window = Window_PlayTime.new @playtime_window.x = 0 @playtime_window.y = 480 - @playtime_window.height @steps_window = Window_Steps.new @steps_window.x = 0 @steps_window.y = 480 - @steps_window.height @gold_window = Window_Gold.new @gold_window.x = 0 @gold_window.y = 480 - @gold_window.height @status_window = Window_MenuStatus.new @status_window.x = 160 @status_window.y = 0 @playtime_window.visible = true @steps_window.visible = false @gold_window.visible = false Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @command_window.dispose @playtime_window.dispose @steps_window.dispose @gold_window.dispose @status_window.dispose @LW.dispose @RW.dispose end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update @command_window.update @playtime_window.update @steps_window.update @gold_window.update @status_window.update @LW.update @RW.update if @playtime_window.visible == true @LW.y = @playtime_window.y-58 ; @RW.y = @LW.y @LW.visible = false elsif @steps_window.visible == true @LW.y = @steps_window.y-58 ; @RW.y = @LW.y @LW.visible = true ; @RW.visible = true elsif @gold_window.visible == true @LW.y = @gold_window.y-58 ; @RW.y = @LW.y @RW.visible = false end if Input.trigger?(Input::L) if @steps_window.visible == true @steps_window.visible = false @playtime_window.visible = true elsif @gold_window.visible == true @gold_window.visible = false @steps_window.visible = true end elsif Input.trigger?(Input::R) if @playtime_window.visible == true @playtime_window.visible = false @steps_window.visible = true elsif @steps_window.visible == true @steps_window.visible = false @gold_window.visible = true end end if @command_window.active update_command return end if @status_window.active update_status return end end #-------------------------------------------------------------------------- # ● フレーム更新 (コマンドウィンドウがアクティブの場合) #-------------------------------------------------------------------------- def update_command if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new return end if Input.trigger?(Input::C) if $game_party.actors.size == 0 and @command_window.index < 4 $game_system.se_play($data_system.buzzer_se) return end case @command_window.index when 0 $game_system.se_play($data_system.decision_se) $scene = Scene_Item.new when 1 $game_system.se_play($data_system.decision_se) @command_window.active = false @status_window.active = true @status_window.index = 0 when 2 $game_system.se_play($data_system.decision_se) @command_window.active = false @status_window.active = true @status_window.index = 0 when 3 $game_system.se_play($data_system.decision_se) @command_window.active = false @status_window.active = true @status_window.index = 0 when 4 $game_system.se_play($data_system.decision_se) $scene = Scene_FusionCharas.new(false, true) when 5 if $game_system.save_disabled $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Scene_Save.new when 6 $game_system.se_play($data_system.decision_se) $scene = Scene_End.new end return end end #-------------------------------------------------------------------------- # ● フレーム更新 (ステータスウィンドウがアクティブの場合) #-------------------------------------------------------------------------- def update_status if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @command_window.active = true @status_window.active = false @status_window.index = -1 return end if Input.trigger?(Input::C) case @command_window.index when 1 if $game_party.actors[@status_window.index].restriction >= 2 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Scene_Skill.new(@status_window.index) when 2 $game_system.se_play($data_system.decision_se) $scene = Scene_Equip.new(@status_window.index) when 3 $game_system.se_play($data_system.decision_se) $scene = Scene_Status.new(@status_window.index) end return end end end
Toutes les explications nécessaires à son utilisation sont à l'intérieur. J'ai fait en sorte que tu puisses modifier deux trois trucs si t'as envie; regarde dans le Module Config.
- Code: Tout sélectionner
#============================================================================== # ■ Module Config # ---------------------- # Auteur: Bad_Maker #============================================================================== module Config FOND = "001-Title01" # Nom d'une image se trouvant dans le dossier Title OPACITE_FENETRE = 125 # Transparence des fenêtres POSITION_Y_ELEMENTS = 0 # Positions y des éléments TAILLE_TEXTE = 18 # Taille des textes POLICE_TEXTE = "Arial" # Police utilisée pour les textes # ------------------------------------------------- # ICI SE TROUVENT LES FUSIONS A CONFIGURER # FUSION[numéro de la fusion] = [a,b,c,d] # a : monstre pour la fusion # b : monstre pour la fusion # c : monstre obtenu après la fusion # d : toujours mettre false # ------------------------------------------------- FUSION = [] FUSION[0] = [1, 2, 3, false] FUSION[1] = [1, 3, 4, false] FUSION[2] = [2, 3, 5, false] FUSION[3] = [1, 4, 6, false] FUSION[4] = [4, 6, 7, false] # ------------------------------------------------- # ICI ON PEUT MODIFIER LES TEXTES # ------------------------------------------------- TEXTE1 = "Pas assez de monstres pour une fusion" TEXTE2 = "Aucune fusion n'est possible" TEXTE3 = "Choisir le premier monstre à fusionner" TEXTE4 = "Choisir le second monstre à fusionner" TEXTE5 = "Ce monstre ne peut pas être fusionné" TEXTE6 = "Fusion non existente" TEXTE7 = "Le monstre résultant de cette fusion est déjà dans l'équipe" TEXTE8 = "Êtes-vous sûr de vouloir fusionner ces monstres?" TEXTE9 = "La fusion a été effectuée avec succès" # ------------------------------------------------- end
#============================================================================== # ● Window_SelectCharasLeft # ---------------------- # Auteur: Bad_Maker #============================================================================== class Window_SelectCharasLeft < Window_Selectable def initialize(items, y) height = 144 if items == 2 height = 200 if items == 3 height = 256 if items == 4 super(0, y, 288, height) self.contents = Bitmap.new(288-64, height-32) self.opacity = Config::OPACITE_FENETRE self.contents.font.name = Config::POLICE_TEXTE self.contents.font.size = Config::TAILLE_TEXTE @item_max = items self.index = 0 self.visible = false self.active = false refresh end def refresh self.contents.clear y = 48 for actor in $game_party.actors self.draw_actor_graphic(actor, 16, y) self.draw_actor_name(actor, 48, y-48) self.draw_actor_class(actor, 48, y-24) self.draw_actor_level(actor, 160, y-48) y += 56 end end def update_cursor_rect if @index < 0 ; self.cursor_rect.empty ; return ; end if @index >= 0 y = 0 y += 56 if @index == 1 y += 56*2 if @index == 2 y += 56*3 if @index == 3 self.cursor_rect.set(0, y, 256, 56) end end end
#============================================================================== # ● Window_SelectCharasRight # ---------------------- # Auteur: Bad_Maker #============================================================================== class Window_SelectCharasRight < Window_Selectable def initialize(items, y) height = 144 if items == 2 height = 200 if items == 3 height = 256 if items == 4 super(0, y, 288, height) self.contents = Bitmap.new(288-64, height-32) self.opacity = Config::OPACITE_FENETRE self.contents.font.name = Config::POLICE_TEXTE self.contents.font.size = Config::TAILLE_TEXTE @item_max = items self.index = 0 self.visible = false self.active = false refresh end def refresh self.contents.clear y = 48 for actor in $game_party.actors self.draw_actor_graphic(actor, 16, y) self.draw_actor_name(actor, 48, y-48) self.draw_actor_class(actor, 48, y-24) self.draw_actor_level(actor, 160, y-48) y += 56 end end def update_cursor_rect if @index < 0 ; self.cursor_rect.empty ; return ; end if @index >= 0 y = 0 y += 56 if @index == 1 y += 56*2 if @index == 2 y += 56*3 if @index == 3 self.cursor_rect.set(0, y, 256, 56) end end end
#============================================================================== # ● Window_TransformedMonster # ---------------------- # Auteur: Bad_Maker #============================================================================== class Window_TransformedMonster < Window_Base def initialize super(0, 0, 136, 196) self.contents = Bitmap.new(136-32, 136-32) self.opacity = Config::OPACITE_FENETRE self.contents.font.name = Config::POLICE_TEXTE self.contents.font.size = Config::TAILLE_TEXTE self.visible = false refresh end def refresh end end
#============================================================================== # ■ Scene_FusionCharas # ---------------------- # Auteur: Bad_Maker #============================================================================== class Scene_FusionCharas def initialize(map=false, menu=true) @map = map @menu = menu end def main @fond_ecran = Sprite.new @fond_ecran.bitmap = RPG::Cache.title(Config::FOND) nombre_de_monstres definir_les_fusions fusion_possible? creer_fenetres unless @party_size @help_window.set_text(Config::TEXTE1) @quitter_scene = true else if @fusionspossibles == 0 @help_window.set_text(Config::TEXTE2) @quitter_scene = true end end if @party_size if @fusionspossibles > 0 @help_window.set_text(Config::TEXTE3) @left_window.active = true @left_window.visible = true end end Graphics.transition loop do Graphics.update Input.update update break if $scene != self end Graphics.freeze @help_window.dispose @left_window.dispose @right_window.dispose @main_window.dispose @decision_window.dispose @fond_ecran.dispose end def nombre_de_monstres @party_size = false @party_size = true if $game_party.actors.size > 1 end def definir_les_fusions @fusion = Config::FUSION end def fusion_possible? @fusionspossibles = 0 for i in 0..@fusion.size-1 for actors in 0..$game_party.actors.size-1 if @fusion[i][0] == $game_party.actors[actors].id for actors in 0..$game_party.actors.size-1 if @fusion[i][1] == $game_party.actors[actors].id value = false for t in 0..$game_party.actors.size-1 value = true if @fusion[i][2] == $game_party.actors[t].id end unless value @fusion[i][3] = true @fusionspossibles += 1 end end end end end end end def creer_fenetres @help_window = Window_Help.new @help_window.y = Config::POSITION_Y_ELEMENTS @help_window.opacity = Config::OPACITE_FENETRE @help_window.contents.font.name = Config::POLICE_TEXTE @help_window.contents.font.size = Config::TAILLE_TEXTE y = @help_window.y + @help_window.height @left_window = Window_SelectCharasLeft.new($game_party.actors.size, y) @right_window = Window_SelectCharasRight.new($game_party.actors.size, y) @right_window.x = 640-@right_window.width @main_window = Window_TransformedMonster.new @main_window.x = 320 - @main_window.width/2 @main_window.y = 240 - @main_window.height/2 @decision_window = Window_Command.new(80, ["Oui", "Non"]) @decision_window.active = false @decision_window.visible = false @decision_window.x = 320-@decision_window.width/2 @decision_window.y = @main_window.y+@main_window.height @decision_window.opacity = Config::OPACITE_FENETRE @decision_window.contents.font.name = Config::POLICE_TEXTE @decision_window.contents.font.size = Config::TAILLE_TEXTE end def update return_scene if @quitter_scene == true update_leftwindow if @left_window.active == true update_rightwindow if @right_window.active == true update_mainwindow if @main_window.visible == true end def update_leftwindow @left_window.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @quitter_scene = true Input.update end if Input.trigger?(Input::C) element_de_la_fusion_left? if @element1 == true $game_system.se_play($data_system.decision_se) @help_window.set_text(Config::TEXTE4) @left_window.active = false @right_window.active = true @right_window.visible = true Input.update else $game_system.se_play($data_system.buzzer_se) @help_window.set_text(Config::TEXTE5) end end end def update_rightwindow @right_window.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @help_window.set_text(Config::TEXTE3) @right_window.active = false @right_window.visible = false @left_window.active = true @left_window.visible = true Input.update end if Input.trigger?(Input::C) element_de_la_fusion_right? if @element2 == true $game_system.se_play($data_system.decision_se) @help_window.set_text(Config::TEXTE8) @left_window.visible = false @right_window.active = false @right_window.visible = false @main_window.visible = true @decision_window.active = true @decision_window.visible = true draw_main_window Input.update else $game_system.se_play($data_system.buzzer_se) @help_window.set_text(Config::TEXTE6) @help_window.set_text(Config::TEXTE7)if @monster_in_team end end end def update_mainwindow @main_window.update @decision_window.update if Input.trigger?(Input::C) if @decision_window.index == 0 $game_system.se_play($data_system.decision_se) @help_window.set_text(Config::TEXTE9) change_monsters Input.update return_scene elsif @decision_window.index == 1 $game_system.se_play($data_system.cancel_se) @help_window.set_text(Config::TEXTE4) @main_window.visible = false @decision_window.active = false @decision_window.visible = false @left_window.visible = true @right_window.active = true @right_window.visible = true Input.update end end if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @help_window.set_text(Config::TEXTE4) @main_window.visible = false @decision_window.active = false @decision_window.visible = false @left_window.visible = true @right_window.active = true @right_window.visible = true Input.update end end def element_de_la_fusion_left? @element1 = false for i in 0..@fusion.size-1 if @fusion[i][3] == true if $game_party.actors[@left_window.index].id == @fusion[i][0] @element1 = true end end end end def element_de_la_fusion_right? @element2 = false @monster_in_team = false unless @left_window.index == @right_window.index for i in 0..@fusion.size-1 if @fusion[i][0] == $game_party.actors[@left_window.index].id if @fusion[i][1] == $game_party.actors[@right_window.index].id value = false for j in 0..$game_party.actors.size-1 if @fusion[i][2] == $game_party.actors[j].id @monster_in_team = true value = true end end unless value @element2 = true end end end end end end def draw_main_window @main_window.contents.clear for i in 0..@fusion.size-1 if @fusion[i][0] == $game_party.actors[@left_window.index].id if @fusion[i][1] == $game_party.actors[@right_window.index].id @monster1 = @fusion[i][0] @monster2 = @fusion[i][1] @new_monster = @fusion[i][2] end end end @main_window.draw_actor_name($game_actors[@new_monster], 0, 0) @main_window.draw_actor_class($game_actors[@new_monster], 0, 24) @main_window.draw_actor_graphic($game_actors[@new_monster], 16, 104) end def change_monsters $game_party.remove_actor(@monster1) $game_party.remove_actor(@monster2) $game_party.add_actor(@new_monster) end def return_scene 60.times do ; Graphics.update ; end $scene = Scene_Map.new if @map $scene = Scene_Menu.new(4) if @menu end end def fusionner_monstres $game_system.se_play($data_system.decision_se) $scene = Scene_FusionCharas.new(true, false) end
Quelques screens:
Remarque: FUSION[0] = [0, 1, 2] ne revient pas du tout à écrire FUSION[0] = [1, 0, 2] Dans le premier cas il faudra choisir le monstre d'id 0 en premier puis le monstre d'id 1 Dans le seconf cas il faudra choisir le monstre d'id 1 en premier puis le monstre d'id 0. Il suffit d'écrire les deux si tu veux que ça fonctionne dans les deux cas.
_________________
--- Bad_maker ---
|
|