Sujet n°10098
Posté par Maxime' le 2 Aoû - 11:59 (2011)
Titre : scène passworld pour pspds5g
Bonjour voici des modification à apporter pour pspds5g pour la scène passworld.
Pour les personnes qui se disent "c'est quoi la scène passworld ?" voici un schéma :



Collé dans les scripts de votre projet ceci au dessus de "Main" :


Le script "Interpreter Sphinx" (rien n'est changer dedans) :



Interpreter Sphinx
Code:

#==============================================================================  
# ■ Interpreter  
# Gestion du calendrier - Sphinx  
# 28 aout 2008  
#-----------------------------------------------------------------------------  
# Fonctions de gestion des dates a utiliser en insertion de script  
# ou en condition.  
#-----------------------------------------------------------------------------  
  
  
class Interpreter  
    #---------------------------------------------------------------------------  
    # password  
    #   Permet à l'utilisateur de saisir un mot de passe.  
    #---------------------------------------------------------------------------  
    def password(texte,nbrecar)  
      $game_temp.name_max_char = nbrecar  
      name_scene = Scene_Password.new  
      name_scene.main(texte)  
      name_scene = nil  
      Graphics.transition  
      return $password  
    end  
end 











Le script "Scene_Password"(non modifier)
Scene_Password
Code:

#==============================================================================
# ■ Scene_Password
#------------------------------------------------------------------------------
#  名前入力画面の処理を行うクラスです。
#==============================================================================


class Scene_Password 
  #--------------------------------------------------------------------------
  # ● メイン処理
  #--------------------------------------------------------------------------
  def main(texte)
    Graphics.freeze
    @z_level = 10000
    @actor = $game_actors[1]        
    
    @background = Sprite.new    
    @background.bitmap = RPG::Cache.picture("name0.png")
    @background.x = 13
    @background.y = 13
    @background.z = @z_level
    
    @edit_window = Window_PasswordEdit.new($game_temp.name_max_char,texte)
    @input_window = Window_PasswordInput.new
    
    @edit_window.z = @z_level + 2
    @input_window.z = @z_level + 1
    
    @perso = Sprite.new    
    @perso.bitmap = RPG::Cache.character(@actor.character_name, 0)   
    @perso.src_rect.set(0, 0, 60, 62)      
    @perso.x = 37
    @perso.y = 236
    @perso.zoom_x = @perso.zoom_y = 0.5
    @perso.z = @z_level + 3
    @wait = 0
    
    @done = false
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if @done
        break
      end
    end
    Graphics.freeze
    @edit_window.dispose
    @input_window.dispose
    @background.dispose
    @perso.dispose
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    @edit_window.update
    @input_window.update
    @perso.update
    
    # Mouvement character    
    x = 64
    y = 0
    h = 62
    w = 60
    @wait += 1    
    if @wait == 10
      @perso.src_rect.set(x, y, w, h)     
    end
    if @wait == 20
      @perso.src_rect.set(0, y, w, h)       
    end
    if @wait == 30
      @perso.src_rect.set(x*3, y, w, h)         
    end
    if @wait == 40
      @perso.src_rect.set(0, y, w, h)
      @wait = 0        
    end
    
    # Effacement
    if Input.repeat?(Input::B)
      if @edit_window.index == 0
        return
      end
      $game_system.se_play($data_system.cancel_se)
      @edit_window.back
      return
    end
    
    # Valider  
    if Input.trigger?(Input::A)  
      if @edit_window.name == ""  
          @edit_window.restore_default  
          if @edit_window.name == ""  
            $game_system.se_play($data_system.buzzer_se)  
            return  
          end  
          $game_system.se_play($data_system.decision_se)  
          return  
      end       
      $password = @edit_window.name     
      @done = true  
      return  
    end 
    
    # Confirmer lettre
    if Input.trigger?(Input::C)
      # Bouton sur Confirmer
      if @input_window.character == nil
        # Pas de nom entrée => Par défaut
        if @edit_window.name == ""
          @edit_window.restore_default
          if @edit_window.name == ""
            $game_system.se_play($data_system.buzzer_se)
            @done = true
            return
          end
          $game_system.se_play($data_system.decision_se)
          return
        end
        $game_system.se_play($data_system.decision_se)
        
        $password = @edit_window.name
        @done = true
        return
      end         
      
      # Entrée d'un caractère de trop
      if @edit_window.index == $game_temp.name_max_char
        $game_system.se_play($data_system.buzzer_se)
        return
      end


      # Entrée d'un mauvais caractère
      if @input_window.character == ""
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      
      $game_system.se_play($data_system.decision_se)
      
      @edit_window.add(@input_window.character)
      return
    end
  end
end
[/size][/font]






Le script "Window_PasswordInput" (que j'ai modifier)
Window_PasswordInput
Code:

#==============================================================================
# ■ Window_PasswordInput
# Pokemon Script Project - Krosk 
# 19/08/07
# script modifier par maxime' pour pspds5G
#-----------------------------------------------------------------------------
# Scène à ne pas modifier
#-----------------------------------------------------------------------------




  class Window_PasswordInput < Window_Base
    MAJ_TABLE = ["A","B","C","D","E","F","G","H","I","J"," ",",",".",  
                 "K","L","M","N","O","P","Q","R","S","T"," ","'","-",  
                 "U","V","W","X","Y","Z"," "," "," "," "," ","♂","♀",  
                 "À","Ç","É","È","Ù"," "," "," "," "," "," "," "," ",  
                 "0","1","2","3","4","5","6","7","8","9"," "," "," "]  
                
    MIN_TABLE = ["a","b","c","d","e","f","g","h","i","j"," ",",",".",  
                 "k","l","m","n","o","p","q","r","s","t"," ","'","-",  
                 "u","v","w","x","y","z"," "," "," "," "," ","♂","♀",  
                 "à","â","ç","é","è","ê","ë","î","ï","ô","ù","û"," ",  
                 "0","1","2","3","4","5","6","7","8","9"," "," "," "]  
                
    OTH_TABLE = [",",".",":",";","!","?"," "," "," ","♂","♀"," "," ",  
                 "«","»","(",")","[","]","{","}"," "," "," "," "," ",  
                 "-","+","=","/","*","|","£"," "," "," "," "," "," ",  
                 "$","\\","'","%","&","@","µ"," "," "," "," "," "," ",  
                 "0","1","2","3","4","5","6","7","8","9"," "," "," "]
    #--------------------------------------------------------------------------
    # ? ?????????
    #--------------------------------------------------------------------------
    def initialize(table = 0)  
      super(-16, -16, 640, 480)  
      self.contents = Bitmap.new(width - 32, height - 32)  
      self.contents.font.name = $fontface  
      self.contents.font.size = $fontsize  
      self.contents.font.color = normal_color  
      self.opacity = 0  
      @index = 0  
      @table = table  
      refresh  
      update_cursor_rect  
    end  
    #--------------------------------------------------------------------------
    # ? ??????
    #--------------------------------------------------------------------------
    def refresh        
      self.contents.clear   
      bitmap = RPG::Cache.picture("name" + @table.to_s + ".png")  
      rect = Rect.new(0, 0, 256, 406)  
      self.contents.blt(13 , 13, bitmap,rect ,255)  
      bitmap2 = RPG::Cache.picture("Input_index.png")  
      rect = Rect.new(0, 0, 20, 26)  
      self.contents.blt(39 + @index % 13 * 16 - 4 , 314 + @index / 13 * 24 - 48, bitmap2,rect ,255)  
      for i in 0..64         
        x = 34 + i % 13 * 16 - 3  
        y = 309 + i / 13 * 24 - 46
        if @table == 0  
          draw_text(x, y, 28, 32, MAJ_TABLE, 1)  
        end  
        if @table == 1  
          draw_text(x, y, 28, 32, MIN_TABLE, 1)  
        end  
        if @table == 2  
          draw_text(x, y, 28, 32, OTH_TABLE, 1)  
        end  
      end  
    end  
    
    #--------------------------------------------------------------------------
    # ? ?????
    #--------------------------------------------------------------------------
 def character  
      if @table == 0  
        return MAJ_TABLE[@index]  
      end  
      if @table == 1  
        return MIN_TABLE[@index]  
      end  
      if @table == 2  
        return OTH_TABLE[@index]  
      end  
    end  
    #--------------------------------------------------------------------------
    # ? ?????????
    #--------------------------------------------------------------------------
   def update_cursor_rect  
      # ??????? [??] ???  
        x = 34 + @index % 13 * 16   
        y = 308 + @index / 13 * 24  
        self.cursor_rect.set(x, y, 32, 32)  
    end 
    #--------------------------------------------------------------------------
    # ? ??????
    #--------------------------------------------------------------------------
    def update  
      super            
        if Input.repeat?(Input::LEFT)  
          $game_system.se_play($data_system.cursor_se)  
          @index -= 1  
          if @index == -1  
            @index = 64  
          end  
          refresh  
        end  
            
        if Input.repeat?(Input::RIGHT)  
          $game_system.se_play($data_system.cursor_se)  
          @index += 1  
          if @index == 65  
            @index = 0  
          end  
          refresh  
        end  
  
        if Input.repeat?(Input::DOWN) and @index  < 52  
          $game_system.se_play($data_system.cursor_se)  
          @index += 13  
          refresh  
        end  
  
        if Input.repeat?(Input::UP) and @index  > 12  
          $game_system.se_play($data_system.cursor_se)  
          @index -= 13  
          refresh  
        end              
            
        if Input.trigger?(Input::L)  
          $game_system.se_play($data_system.cursor_se)  
          @table -= 1  
          if @table == -1  
            @table = 2  
          end  
          refresh  
        end  
          
        if Input.trigger?(Input::R)  
          $game_system.se_play($data_system.cursor_se)  
          @table += 1  
          if @table == 3  
            @table = 0  
          end  
          refresh  
        end  
      update_cursor_rect  
    end  
end  
[/size]








Et le dernier script "Window_PasswordEdit"(que je n'ai pas modifier)

Window_PasswordEdit
Code:

#==============================================================================
# ■ Window_PasswordEdit
# Pokemon Script Project - Krosk 
# 19/08/07
#-----------------------------------------------------------------------------
# Scène à ne pas modifier
#-----------------------------------------------------------------------------


class Window_PasswordEdit < Window_Base
  attr_accessor :name                     # 名前
  attr_accessor :index                    # カーソル位置
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize(max_char, texte)  
    super(-117, 129, 442, 200)  
    self.contents = Bitmap.new(width - 32, height - 32)  
    self.contents.font.name = $fontface  
    self.contents.font.size = $fontsizebig  
    self.contents.font.color = normal_color  
    self.opacity = 0  
    $password = ""
    @name = ""
    @max_char = max_char
    @texte = texte
    name_array = @name.split(//)[0...@max_char]
    @name = ""
    for i in 0...name_array.size
      @name += name_array[i]
    end
    @default_name = @name
    @index = name_array.size   
    refresh
    update_cursor_rect  
  end  
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear  
      
    name_array = @name.split(//)  
    for i in 0...@max_char  
      c = name_array[i]  
      if c == nil  
        c = "_"  
      end  
      x = 120 + i * 12 +54  
      draw_text(x, 33 + 62, 24, 44, c, 1, normal_color)  
    end      
    
    self.contents.font.size = $fontsize
    
    draw_text(130, 7, 321, 39, @texte, 0)
    self.contents.font.size = $fontsizebig
    
    if @actor != nil  
      bitmap = RPG::Cache.character(@actor.character_name, @actor.character_hue)  
      cw = bitmap.width / 4  
      ch = bitmap.height / 4  
      src_rect = Rect.new(0, 0, cw, ch)        
    end
  end
  #--------------------------------------------------------------------------
  # ● カーソルの矩形更新
  #--------------------------------------------------------------------------
  def update_cursor_rect   
    x = 115 + @index * 12 + 54  
    self.cursor_rect.set(x, 102, 32, 32)  
  end  
  
  def back
    if @index > 0
      # 一字削除
      name_array = @name.split(//)
      @name = ""
      for i in 0...name_array.size-1
        @name += name_array[i]
      end
      @index -= 1
      refresh
      update_cursor_rect
    end
  end
  
  def add(character)
    if @index < @max_char and character != ""
      @name += character
      @index += 1
      refresh
      update_cursor_rect
    end
  end
  
  def restore_default
    @name = @default_name
    @index = @name.split(//).size
    refresh
    update_cursor_rect
  end
end












Quand vous avez coller tout les script, créer un évent comme ceci :



Voila, crédit non obligatoire pour moi mais crédit obligatoire pour krosk et sphinx.


Posté par Brendan75 le 2 Aoû - 14:17 (2011)
Merci d'utiliser la balise code pour tes scripts.

Posté par Sphinx le 2 Aoû - 14:29 (2011)
En réalité, tu n'as besoin que de cette partie là du script Interpreter_Sphinx de 4G+ Clin d'œil foireux

Code:
#==============================================================================
# ■ Interpreter
# Gestion du calendrier - Sphinx
# 28 aout 2008
#-----------------------------------------------------------------------------
# Fonctions de gestion des dates a utiliser en insertion de script
# ou en condition.
#-----------------------------------------------------------------------------


class Interpreter
    #---------------------------------------------------------------------------
    # password
    #   Permet à l'utilisateur de saisir un mot de passe.
    #---------------------------------------------------------------------------
    def password(texte,nbrecar)
      $game_temp.name_max_char = nbrecar
      name_scene = Scene_Password.new
      name_scene.main(texte)
      name_scene = nil
      Graphics.transition
      return $password
    end
end


Plus bien sur les 3 autres scripts

Posté par Maxime' le 3 Aoû - 13:04 (2011)
Sphinx a écrit:
En réalité, tu n'as besoin que de cette partie là du script Interpreter_Sphinx de 4G+ Clin d'œil foireux

Code:
#==============================================================================
# ■ Interpreter
# Gestion du calendrier - Sphinx
# 28 aout 2008
#-----------------------------------------------------------------------------
# Fonctions de gestion des dates a utiliser en insertion de script
# ou en condition.
#-----------------------------------------------------------------------------


class Interpreter
    #---------------------------------------------------------------------------
    # password
    #   Permet à l'utilisateur de saisir un mot de passe.
    #---------------------------------------------------------------------------
    def password(texte,nbrecar)
      $game_temp.name_max_char = nbrecar
      name_scene = Scene_Password.new
      name_scene.main(texte)
      name_scene = nil
      Graphics.transition
      return $password
    end
end



Plus bien sur les 3 autres scripts




Imbécile heureux Daccord je vais modifier ceci !  









Brendan75 a écrit:
Merci d'utiliser la balise code pour tes scripts.


Désoler mais je ne sais pas comment faire...



  

Posté par Conan Edogawa le 3 Aoû - 17:40 (2011)
Code:
  [code][/code] 

et pas en gras!

Posté par Maxime' le 3 Aoû - 18:51 (2011)
pikachu5000 a écrit:
Code:
  [code]





[/code] 

et pas en gras!






Ok et merci !!




Edit sa marche pas !!! :

Posté par Nuri Yuri le 3 Aoû - 19:59 (2011)
Poste un message pour voir, sinon, la prévisualisation ne marche pas à cause du "correcteur" d'orthographe.

Posté par Maxime' le 3 Aoû - 20:03 (2011)
Yuri-塗 ゆり a écrit:
Poste un message pour voir, sinon, la prévisualisation ne marche pas à cause du "correcteur" d'orthographe.


ok 


Code:
[font=Consolas, 'Courier New', Courier, mono, serif]#==============================================================================[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]# ■ Scene_Password[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]#------------------------------------------------------------------------------[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]#  名前入力画面の処理を行うクラスです。[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]#==============================================================================[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]
[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]class Scene_Password [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]  #--------------------------------------------------------------------------[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]  # ● メイン処理[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]  #--------------------------------------------------------------------------[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]  def main(texte)[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    Graphics.freeze[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @z_level = 10000[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @actor = $game_actors[1]        [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @background = Sprite.new    [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @background.bitmap = RPG::Cache.picture("name0.png")[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @background.x = 13[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @background.y = 13[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @background.z = @z_level[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @edit_window = Window_PasswordEdit.new($game_temp.name_max_char,texte)[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @input_window = Window_PasswordInput.new[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @edit_window.z = @z_level + 2[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @input_window.z = @z_level + 1[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @perso = Sprite.new    [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @perso.bitmap = RPG::Cache.character(@actor.character_name, 0)   [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @perso.src_rect.set(0, 0, 60, 62)      [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @perso.x = 37[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @perso.y = 236[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @perso.zoom_x = @perso.zoom_y = 0.5[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @perso.z = @z_level + 3[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @wait = 0[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @done = false[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    Graphics.transition[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    loop do[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      Graphics.update[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      Input.update[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      update[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      if @done[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]        break[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      end[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    end[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    Graphics.freeze[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @edit_window.dispose[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @input_window.dispose[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @background.dispose[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @perso.dispose[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]  end[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]  #--------------------------------------------------------------------------[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]  # ● フレーム更新[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]  #--------------------------------------------------------------------------[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]  def update[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @edit_window.update[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @input_window.update[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @perso.update[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    # Mouvement character    [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    x = 64[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    y = 0[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    h = 62[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    w = 60[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    @wait += 1    [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    if @wait == 10[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      @perso.src_rect.set(x, y, w, h)     [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    end[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    if @wait == 20[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      @perso.src_rect.set(0, y, w, h)       [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    end[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    if @wait == 30[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      @perso.src_rect.set(x*3, y, w, h)         [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    end[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    if @wait == 40[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      @perso.src_rect.set(0, y, w, h)[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      @wait = 0        [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    end[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    # Effacement[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    if Input.repeat?(Input::B)[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      if @edit_window.index == 0[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]        return[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      end[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      $game_system.se_play($data_system.cancel_se)[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      @edit_window.back[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      return[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    end[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    # Valider  [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    if Input.trigger?(Input::A)  [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      if @edit_window.name == ""  [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]          @edit_window.restore_default  [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]          if @edit_window.name == ""  [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]            $game_system.se_play($data_system.buzzer_se)  [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]            return  [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]          end  [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]          $game_system.se_play($data_system.decision_se)  [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]          return  [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      end       [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      $password = @edit_window.name     [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      @done = true  [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      return  [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    end [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    # Confirmer lettre[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    if Input.trigger?(Input::C)[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      # Bouton sur Confirmer[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      if @input_window.character == nil[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]        # Pas de nom entrée => Par défaut[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]        if @edit_window.name == ""[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]          @edit_window.restore_default[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]          if @edit_window.name == ""[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]            $game_system.se_play($data_system.buzzer_se)[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]            @done = true[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]            return[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]          end[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]          $game_system.se_play($data_system.decision_se)[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]          return[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]        end[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]        $game_system.se_play($data_system.decision_se)[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]        [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]        $password = @edit_window.name[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]        @done = true[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]        return[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      end         [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      # Entrée d'un caractère de trop[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      if @edit_window.index == $game_temp.name_max_char[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]        $game_system.se_play($data_system.buzzer_se)[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]        return[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      end[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]
[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      # Entrée d'un mauvais caractère[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      if @input_window.character == ""[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]        $game_system.se_play($data_system.buzzer_se)[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]        return[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      end[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      $game_system.se_play($data_system.decision_se)[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      [/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      @edit_window.add(@input_window.character)[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]      return[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]    end[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]  end[/font]
[font=Consolas, 'Courier New', Courier, mono, serif]end[/font]

Posté par Nuri Yuri le 3 Aoû - 20:05 (2011)
-_-, Déjà met le mode éditeur en OFF, google chrome et d'autres navigateurs ont la salle manie d'ajouter des choses dans les message, dans aucun de mes message j'ai la balise [font].

Posté par Maxime' le 3 Aoû - 20:10 (2011)
Je vien de le faire :
Code

Code:
def make_skills_list
  t = Time.now
  file = File.open("Attaques.txt", "w")
 
  tab_skills = []
  tab_skills_name = []
  for id in 1...$data_skills.size
    skill = $data_skills[id]
    tab_skills[id] = []
    tab_skills_name[id] = skill.name.remove_accents.upcase # Nom de l'attaque
    tab_skills[id][0] = skill.name.remove_accents.upcase # Nom de l'attaque
    tab_skills[id][1] = skill.power.to_s # ID effet
    tab_skills[id][2] = skill.description.remove_accents # Description
    tab_skills[id][3] = skill.pdef_f.to_s + " %" # % chance effet
    tab_skills[id][4] = type_name(skill.element_set[0]) # Type
    phy_spe_sta = case skill.str_f when 0 then "PHYSIQUE" when 1 then "SPECIALE" when 2 then "STATUT" end
    tab_skills[id][5] = phy_spe_sta # Phy / Spé / Sta
    tab_skills[id][6] = skill.sp_cost.to_s # PP max
    tab_skills[id][7] = skill.hit.to_s + " %" # Précision
    tab_skills[id][8] = (skill.atk_f + skill.eva_f).to_s # Dégâts
  end
  temp_skills_name = tab_skills_name.clone
  temp_skills_name.shift
 
  atk = 0
  desc = 0
  types = 0
  for i in tab_skills
    next if i == nil
    atk = i[0].size if atk < i[0].size
    desc = i[2].size if desc < i[2].size
    types = i[4].size if types < i[4].size
  end
 
  Graphics.update
  n = 0
  file.write("-" * (104 + atk + desc + types) + "\n")
  file.write("|..ID..|" + "ATTAQUE".center(atk + 4, ".") + "|..ID EFFET..|" + "DESCRIPTION".center(desc + 4, ".") + "|..% EFFET..|" + "TYPE".center(types + 4, ".") + "|..PHY / SPE / STA..|..PP MAX..|..PRECISION..|..DEGATS..|" + "\n")
  file.write("-" * (104 + atk + desc + types) + "\n")
  # "|  ID  |       ATTAQUE       |  ID EFFET  |       DESCRIPTION       |  % EFFET  |   TYPE   |  PHY / SPE / STA  |  PP MAX  |  PRECISION  |  DEGATS  |"
  until(temp_skills_name.empty?)
    n += 1
    Graphics.update if n % 50 == 0
    temp = temp_skills_name[0]
    for i in 1...temp_skills_name.size
      temp = temp_skills_name[i] if temp != nil and temp_skills_name[i].before(temp)
    end
    id = tab_skills_name.index(temp)
    next if tab_skills[id].nil?
    string = "|" + ("." * (5 - (id.to_s.size))) + id.to_s + ".|" # "|   ID |"
    string += ".." + tab_skills[id][0].left(0, atk, ".") + "..|" # "       ATTAQUE       |"
    string += ".." + tab_skills[id][1].center(8, ".") + "..|" # "  ID EFFET  |"
    string += ".." + tab_skills[id][2].left(0, desc, ".") + "..|" # "       DESCRIPTION       |"
    string += ".." + tab_skills[id][3].center(7, ".") + "..|" # "  % EFFET  |"
    string += ".." + tab_skills[id][4].left(0, types, ".") + "..|" # "   TYPE   |"
    string += ".." + tab_skills[id][5].left(0, 15, ".") + "..|" # "  PHY / SPE / STA  |"
    string += ".." + tab_skills[id][6].center(6, ".") + "..|" # "  PP MAX  |"
    string += ".." + tab_skills[id][7].center(9, ".") + "..|" # "  PRECISION  |"
    string += ".." + tab_skills[id][8].center(6, ".") + "..|" # "  DEGATS  |"
    file.write(string + "\n")
    temp_skills_name.delete(temp)
  end
  file.write("-" * (92 + atk + desc + types))
  file.close
   print "Liste des attaques générée en #{(Time.now - t)} secondes."
end

class String
 
  def before(oth_str)
    return if oth_str == nil
    dec_self = 0
    dec_oth_str = 0
    tab_lettres = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
    for i in 0...[self.size, oth_str.size].min
      dec_self += 1 until tab_lettres.include?(self.upcase[i + dec_self..i + dec_self])
      dec_oth_str += 1 until tab_lettres.include?(oth_str.upcase[i + dec_oth_str..i + dec_oth_str])
      if self.upcase[i + dec_self..i + dec_self] != oth_str.upcase[i + dec_oth_str..i + dec_oth_str]
        print self.upcase[i + dec_self..i + dec_self] + " : " + tab_lettres.index(self.upcase[i + dec_self..i + dec_self]).to_s + " - " + oth_str.upcase[i + dec_oth_str..i + dec_oth_str] + " : " + tab_lettres.index(oth_str.upcase[i + dec_oth_str..i + dec_oth_str]).to_s if [tab_lettres.index(self.upcase[i + dec_self..i + dec_self]), tab_lettres.index(oth_str.upcase[i + dec_oth_str..i + dec_oth_str])].include?(nil)
        return tab_lettres.index(self.upcase[i + dec_self..i + dec_self]) < tab_lettres.index(oth_str.upcase[i + dec_oth_str..i + dec_oth_str])
      end
    end
    return false
  end
 
  def left(left, total, car = " ")
    return self if self.size > total
    return (car * left) + self + (car * (total - self.size - left))
  end
 
  def remove_accents
    txt = self
    tab = [[["à", "â", "ä", "ã", "@"], "a"],
               [["é", "ê", "è", "ë", "€"], "e"],
               [["î", "ì", "ï"], "i"],
               [["ô", "ò", "ö", "õ"], "o"],
               [["û", "ù", "ü"], "u"],
               [["ç"], "c"],
               [["$"], "s"],
               [["£"], "l"]
              ]
    txt = self
    for i in tab
      for j in i[0]
        txt = txt.gsub(j, i[1])
      end
    end
    return txt
  end
 
end

def type_name(nb)
  return "AUCUN" if nb.nil? or nb <= 0 or nb > 25
  return $data_system.elements[nb].remove_accents.upcase
end



Edit : sa marche !!


Edit Yuri : Code mis sous hide, il déforme le forum.

Posté par Nuri Yuri le 3 Aoû - 20:20 (2011)
Tu vois ça marches mieux.

Posté par Sphinx le 3 Aoû - 20:23 (2011)
[HS]
Clin d'œil foireux j'ai vraiment un fan
[/HS]

Posté par Maxime' le 3 Aoû - 20:44 (2011)
Sa marche merci a vous tous ! :D