RPG Creator : créez votre MMORPG ou RPG sans aucune connaissance en programmation


Disponible le 4 Juin !




- Jouez à votre jeu sur tablettes tactiles, Smartphones et navigateurs Web
- Personnalisez vos menus
- Dessinez facilement et rapidement vos cartes
- Créez des actions pour le combat A-RPG


www.rpgcreator.net


Heures au format UTC + 1 heure [ Heure d’été ]


Règles du forum


Consultez la liste des Scripts : cliquez ici



Publier un nouveau sujet Répondre au sujet  [ 2 messages ] 
Auteur Message
 Sujet du message: Menu Ordre/Formation de l'equipe
MessagePublié: 04 Fév 2010, 14:57 
Villageois (Nv 2)
Avatar de l’utilisateur

Inscrit le: 10 Nov 2009, 00:14
Messages: 23
Points d'aide: 0/60

Créations :

Voir ses créations

Bon je vais tacher d'etre aussi explicite que possible:
Je vais decomposer le script en plusieurs parties et explication

1er script:
Il permet de creer une nouvelle commande dans le menu pour la formation de l'equipe basique( Si vous n'avez pas encore de CMS )

Code: Tout sélectionner
#------------------------------------------------------------------------------
# Commande_Formation
# ----------------------------------------------
# By Veld
# ---------------------------------------------
# Ce script permet d'ajouter une commande "Formation" au menu :
# - Script a ajouter au dessus de Main
#------------------------------------------------------------------------------

#==============================================================================
# ¦ Scene_Menu
#==============================================================================

class Scene_Menu
   #--------------------------------------------------------------------------
   # ? initialize
   #--------------------------------------------------------------------------
   @self.contents = Bitmap.new
   @menu_index = menu_index
   @actor_change = false
end
#--------------------------------------------------------------------------
# ? main
#--------------------------------------------------------------------------
def main
   s1 = $data_system.words.item
   s2 = $data_system.words.skill
   s3 = $data_system.words.equip
   s4 = "Statuts"
   s5 = "Sauvegarder"
   s6 = "Ordre"
   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)
     @command_window.disable_item(5)
   end
   if $game_system.save_disabled
     @command_window.disable_item(4)
   end
   @playtime_window = Window_PlayTime.new
   @playtime_window.x = 0
   @playtime_window.y = 256
   
   
   @gold_window = Window_Gold.new
   @gold_window.x = 0
   @gold_window.y = 416
   
   @status_window = Window_MenuStatus.new
   @status_window.x = 160
   @status_window.y = 0
   
   Graphics.transition
   
   loop do
     Graphics.update
     Input.update
     update
     if $scene != self
       break
     end
   end
   Graphics.freeze
   
   @command_window.dispose
   @playtime_window.dispose
   @leader_window.dispose
   @gold_window.dispose
   @status_window.dispose
end
#--------------------------------------------------------------------------
# ? update the windows
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# ? update the command window
#--------------------------------------------------------------------------
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 or @command_window.index == 5)
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     case @command_window.index
     when 0 # Item
       $game_system.se_play($data_system.decision_se)
       $scene = Scene_Item.new
     when 1 # Skill
       $game_system.se_play($data_system.decision_se)
       @command_window.active = false
       @status_window.active = true
       @status_window.index = 0
     when 2 # Equip
       $game_system.se_play($data_system.decision_se)
       @command_window.active = false
       @status_window.active = true
       @status_window.index = 0
     when 3 # Status
       $game_system.se_play($data_system.decision_se)
       @command_window.active = false
       @status_window.active = true
       @status_window.index = 0
     when 4 # Save
       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 5 # party actors switch
       $game_system.se_play($data_system.decision_se)
       @command_window.active = false
       @status_window.active = true
       @status_window.index = 0
     when 6 # End
       $game_system.se_play($data_system.decision_se)
       $scene = Scene_End.new
     end
     return
   end
end
#--------------------------------------------------------------------------
# ? update the status window
#--------------------------------------------------------------------------
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
     @actor_change = false
     return
   end
   if Input.trigger?(Input::C)
     $game_system.se_play($data_system.decision_se)
     case @command_window.index
     when 1 # Skill
       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 # Equip
       $game_system.se_play($data_system.decision_se)
       $scene = Scene_Equip.new(@status_window.index)
     when 3 # Status
       $game_system.se_play($data_system.decision_se)
       $scene = Scene_Status.new(@status_window.index)
     when 5 # party actors switch
       if @actor_change == true
         $game_system.se_play($data_system.decision_se)
         $game_party.actors[@old_index] = $game_party.actors[@status_window.index]
         $game_party.actors[@status_window.index] = @new_actor
         $game_player.refresh
         @actor_change = false
         @status_window.refresh
         
         return
       end
       @old_index = @status_window.index
       @new_actor = $game_party.actors[@status_window.index]
       @actor_change = true
     end
     return
   end
end
end


Si vous voulez juste ajouter celui ci au votre :
Reportez vous a cette ligne dans votre script afin d'y ajouter la nouvelle commande
Code: Tout sélectionner
def main
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Statuts"
s5 = "Sauvegarder"
s6 = "Ordre"
s7 = "Quitter"
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])


Puis dans le def update_command il faudra mettre :
Code: Tout sélectionner
when 5 # Party actors Order
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0


Et dans def update_status :
Code: Tout sélectionner
when 5 # party actors Order
if @actor_change == true
$game_system.se_play($data_system.decision_se)
$game_party.actors[@old_index] = $game_party.actors[@status_window.index]
$game_party.actors[@status_window.index] = @new_actor
$game_player.refresh
@actor_change = false
@status_window.refresh

return
end
@old_index = @status_window.index
@new_actor = $game_party.actors[@status_window.index]
@actor_change = true


Haut
 Profil  
 
 Sujet du message: Re: Menu Ordre/Formation de l'equipe
MessagePublié: 04 Fév 2010, 15:10 
Villageois (Nv 2)
Avatar de l’utilisateur

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 :
Image


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 ;)


Haut
 Profil  
 
Afficher les messages depuis:  Trier par  
Publier un nouveau sujet Répondre au sujet  [ 2 messages ] 

Heures au format UTC + 1 heure [ Heure d’été ]


Qui est en ligne ?

Utilisateurs parcourant actuellement ce forum : Aucun utilisateur inscrit et 3 invités


Vous ne pouvez pas publier de nouveaux sujets dans ce forum
Vous ne pouvez pas répondre aux sujets dans ce forum
Vous ne pouvez pas éditer vos messages dans ce forum
Vous ne pouvez pas supprimer vos messages dans ce forum
Vous ne pouvez pas insérer de pièces jointes dans ce forum

Rechercher pour:
Sauter vers:  
cron
RPG Creative Forum version 5 ; Tous droits réservés
phpBB Group (Traduit par Xaphos)
Optimisé pour une résolution 1024*728