| Villageois (Nv 2) |
 |
Inscrit le: 10 Nov 2009, 00:14 Messages: 23 Points d'aide: 0/60
Créations :
Voir ses créations
|
2 eme Script:Un peu different car il permet de locker le premier personnage que vous aurez selectionné Screen : A inserer simplement au dessus de main comme le 1 er - Code: Tout sélectionner
#------------------------------------------------------------------------------ # Commande_Formation_custom # ---------------------------------------------- # By Veld # --------------------------------------------- # Ce script permet d'ajouter une commande "Formation" au menu : # - Script a ajouter au dessus de Main #------------------------------------------------------------------------------
#============================================================================== # ** Window_MenuStatus #------------------------------------------------------------------------------ # This window displays party member status on the menu screen. #==============================================================================
class Window_MenuStatus #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh(where=nil) # Clear the window self.contents.clear # If an actor's position is changing, draw a dark grey rectangle if where != nil # Set the y position y = where*116 # Set the rectangle color color = Color.new(65,65,65,200) # Draw the rectangle self.contents.fill_rect(0,y,480,96,color) end # Set the maximum number of actors in the party @item_max = $game_party.actors.size # Draw actors informations (above the rectangle) for i in 0...$game_party.actors.size x = 64 y = i * 116 actor = $game_party.actors[i] draw_actor_graphic(actor, x - 40, y + 80) draw_actor_name(actor, x, y) draw_actor_class(actor, x + 144, y) draw_actor_level(actor, x, y + 32) draw_actor_state(actor, x + 90, y + 32) draw_actor_exp(actor, x, y + 64) draw_actor_hp(actor, x + 236, y + 32) draw_actor_sp(actor, x + 236, y + 64) end end end
class Scene_Menu # Les modifications qui influencerons sur le menu. # -------------------------------- def initialize(menu_index = 0) @menu_index = menu_index @changer = 0 @where = 0 @checker = 0 end # -------------------------------- def main s1 = $data_system.words.item # Fonction "Objets" s2 = $data_system.words.skill# Fonction "Capacité" s3 = $data_system.words.equip# Fonction "Equiper" s4 = "Statut" # Fonction "Status" s5 = "Formation" # Fonction "Ordres" [La fonction ajouté] s6 = "Quitter" # Fonction "Quitter" @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6]) @command_window.index = @menu_index @command_window.back_opacity = 255 @command_window.opacity = 255 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 if $game_party.actors.size == 1 @command_window.disable_item(4) end # toute les fenêtre sont invisibles par défault, # opacity = tour de la fenêtre # back opacity = interieur de la fenêtre @playtime_window = Window_PlayTime.new @playtime_window.x = 0 @playtime_window.y = 256 @playtime_window.back_opacity= 255 @playtime_window.opacity = 255 @gold_window = Window_Gold.new @gold_window.x = 0 @gold_window.y = 416 @gold_window.back_opacity = 255 @gold_window.opacity = 255 @status_window = Window_MenuStatus.new @status_window.x = 160 @status_window.y = 0 @status_window.back_opacity= 255 @status_window.opacity = 255 Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @command_window.dispose @playtime_window.dispose @gold_window.dispose @status_window.dispose end # -------------------------------- def update @command_window.update @playtime_window.update @gold_window.update @status_window.update 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 if $game_party.actors.size == 1 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)# Fonction qui perrmets de jouer le son d'accés au menu. $scene = Scene_Item.new # Fonction qui permets d'accéder au menu "Objets". when 1 $game_system.se_play($data_system.decision_se)# Fonction qui perrmets de jouer le son d'accés au menu. @command_window.active = false @status_window.active = true @status_window.index = 0 when 2 $game_system.se_play($data_system.decision_se)# Fonction qui perrmets de jouer le son d'accés au menu. @command_window.active = false @status_window.active = true @status_window.index = 0 when 3 $game_system.se_play($data_system.decision_se)# Fonction qui perrmets de jouer le son d'accés au menu. @command_window.active = false @status_window.active = true @status_window.index = 0 when 4 $game_system.se_play($data_system.decision_se)# Fonction qui perrmets de jouer le son d'accés au menu. @checker = 0 @command_window.active = false @status_window.active = true @status_window.index = 0 when 5 $game_system.se_play($data_system.decision_se)# Fonction qui perrmets de jouer le son d'accés au menu. $scene = Scene_End.new# Fonction qui permets d'accéder au menu "Quitter". 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)# Fonction qui perrmets de jouer le son d'accés au menu. $scene = Scene_Skill.new(@status_window.index)# Fonction qui permets d'accéder au menu "Competences". when 2 $game_system.se_play($data_system.decision_se)# Fonction qui perrmets de jouer le son d'accés au menu. $scene = Scene_Equip.new(@status_window.index)# Fonction qui permets d'accéder au menu "Equipement". when 3 $game_system.se_play($data_system.decision_se)# Fonction qui perrmets de jouer le son d'accés au menu. $scene = Scene_Status.new(@status_window.index)# Fonction qui permets d'accéder au menu "Status". when 4 $game_system.se_play($data_system.decision_se)# Fonction qui perrmets de jouer le son d'accés au menu. if @checker == 0 @changer = $game_party.actors[@status_window.index] @where = @status_window.index @status_window.refresh(@where) @checker = 1 else $game_party.actors[@where] = $game_party.actors[@status_window.index] $game_party.actors[@status_window.index] = @changer @checker = 0 @status_window.refresh $game_player.refresh end end return end end end
Et si vous avez deja un CMS , les commande a garder sont les mm que pour le premier a l'exeption de dans def update_status : - Code: Tout sélectionner
when 4 $game_system.se_play($data_system.decision_se)# Fonction qui perrmets de jouer le son d'accés au menu. if @checker == 0 @changer = $game_party.actors[@status_window.index] @where = @status_window.index @status_window.refresh(@where) @checker = 1 else $game_party.actors[@where] = $game_party.actors[@status_window.index] $game_party.actors[@status_window.index] = @changer @checker = 0 @status_window.refresh $game_player.refresh
Il faudra aussi garder ceci , qui permet de locker la position du perso : - Code: Tout sélectionner
class Window_MenuStatus #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh(where=nil) # Clear the window self.contents.clear # If an actor's position is changing, draw a dark grey rectangle if where != nil # Set the y position y = where*116 # Set the rectangle color color = Color.new(65,65,65,200) # Draw the rectangle self.contents.fill_rect(0,y,480,96,color) end
Edit Drow : D’après la règle, les scripts doivent être placé entre les balises de code. J'ai édité ton post en conséquence et indenter ton script par la même occasion 
|
|