Sujet n°9835
Posté par Odjavel le 6 Juin - 12:01 (2011)
Titre : [Résolu]Intro en 8 frames et petit bug
Voilà, j'ai modifié le script Scene_Title pour mettre une intro en 8 frames. J'ai créé les images mais ça me met un message d'erreur. Aurais-je oublié quelque chose ?
Le script :
Spoiler
Code:

#==============================================================================
# ■ Scene_Title (Version Pokémon)
# Pokemon Script Project - Krosk
# 01/08/07
#------------------------------------------------------------------------------
# Scène modifiable
#------------------------------------------------------------------------------
# Intègre le menu de chargement
#------------------------------------------------------------------------------


class Scene_Title
  include POKEMON_S  
  
  def main       
    if $BTEST
      battle_test
      return
    end    
  
  def cry_pokemon(id_data)
    if id_data.type == String
      id = id_conversion(id_data)
    elsif id_data.type == Fixnum
      id = id_data
    end
    ida = sprintf("%03d", id)
    filename = "Audio/SE/Cries/" + ida + "Cry.wav"
    if FileTest.exist?(filename)
      Audio.se_play(filename)
    end
    return true
  end 
    
    if FileTest.exist?("SaveAuto.rxdata")
      print("Sauvegarde de secours détectée.\n\nAppuyez sur Entrée, puis sur Echap pour charger, ou Entrée pour continuer.")
      loop do
        Input.update
        if Input.trigger?(Input::C)
          File.delete("SaveAuto.rxdata")
          break
        end
        if Input.trigger?(Input::B)
          @auto_load = true
          break
        end
      end
    end   
    
    if $game_system == nil
      $data_actors        = load_data("Data/Actors.rxdata")
      $data_classes       = load_data("Data/Classes.rxdata")
      $data_skills        = load_data("Data/Skills.rxdata")
      $data_items         = load_data("Data/Items.rxdata")
      $data_weapons       = load_data("Data/Weapons.rxdata")
      $data_armors        = load_data("Data/Armors.rxdata")
      $data_enemies       = load_data("Data/Enemies.rxdata")
      $data_troops        = load_data("Data/Troops.rxdata")
      $data_states        = load_data("Data/States.rxdata")
      $data_animations    = load_data("Data/Animations.rxdata")
      $data_tilesets      = load_data("Data/Tilesets.rxdata")
      $data_common_events = load_data("Data/CommonEvents.rxdata")
      $data_system        = load_data("Data/System.rxdata")
      $picture_data       = load_data("Data/Library.rxdata")
      
      $game_system = Game_System.new
    end
    
    if not @auto_load and not MAPINTRO
    
      # -----------------------------------------------------------------
      #     La scène d'intro commence ici (non MAPINTRO)
      # -----------------------------------------------------------------
      # Elle est bien sûr modifiable à votre goût.
      # -----------------------------------------------------------------
      view = Viewport.new(0,0,640,480)
      view.z = -5
      
      background = Sprite.new
      background.bitmap = RPG::Cache.title("Opening1.png")
      background.x = 13
      background.y = 13
      background.z = 0
      
      background2 = Sprite.new
      background2.bitmap = RPG::Cache.title("Opening2_1.png")
      background2.x = 13
      background2.y = 227
      background2.z = 0
      
      start = Sprite.new
      start.bitmap = RPG::Cache.title("Opening3.png")
      start.x = 66
      start.y = 167 + 215
      start.z = 5
      start.visible = false
      
      Graphics.transition(5)
      
      $game_system.bgm_play($data_system.title_bgm)
      Audio.me_stop
      Audio.bgs_stop
      
      timer = 0
      frame = 0
      
      loop do
        Graphics.update
        Input.update
        
        timer += 1
        frame += 1
        
        if timer > 20 and timer%35 == 0
          start.visible = !start.visible
        end
        
        if frame == 0
        background2.bitmap = RPG::Cache.title("Opening2_1.png")
        end
        if frame == 5
          background2.bitmap = RPG::Cache.title("Opening2_2.png")          
        end       
        if frame == 10
          background2.bitmap = RPG::Cache.title("Opening2_3.png")
        end
        if frame == 15 
          background2.bitmap = RPG::Cache.title("Opening2_4.png")
        end
        if frame == 20
          background2.bitmap = RPG::Cache.title("Opening2_5.png")
        end
        if frame == 25
          background2.bitmap = RPG::Cache.title("Opening2_6.png")
        end
        if frame == 30
          background2.bitmap = RPG::Cache.title("Opening2_7.png")
        end
        if frame == 35
          background2.bitmap = RPG::Cache.title("Opening2_8.png")
        end
          frame = -9
        end         
        
      if timer > 40
        if Input.trigger?(Input::C) or TACTILE.det_clique(14,270,228,420)      
          cry_pokemon(249)                     
          break          
        end
      end           
    end      
      
      Graphics.freeze
      background.dispose
      background2.dispose
      start.dispose
      
      Audio.bgm_stop
      
=begin
      #view = Viewport.new(0,25,640,430)
      #view.z = 0
      background = Plane.new(view)
      background.bitmap = RPG::Cache.title("Opening2.jpg")
      #background.oy += 25
      background.z = 0
      background.tone = Tone.new(0,0,0,255)
      
      #view = Viewport.new(0,0,640,480)
      #view.z = -5
      #background_bis = Plane.new(view)
      #background_bis.bitmap = RPG::Cache.title("Opening2.jpg")
      #background_bis.z = -5
      
      band_top = Sprite.new
      band_top.bitmap = RPG::Cache.title("Opening3.png")
      band_top.z = 5
      band_bottom = Sprite.new
      band_bottom.bitmap = RPG::Cache.title("Opening3.png")
      band_bottom.z = 5
      band_bottom.y = 450
      
      band_mid = Plane.new(Viewport.new(0,0,640,480))
      band_mid.bitmap = RPG::Cache.title("Opening4.png")
      band_mid.z = 5
      
      middle = Sprite.new
      middle.bitmap = RPG::Cache.title("Opening1.png")
      middle.z = 2
      
      title1 = Sprite.new
      title1.bitmap = RPG::Cache.title("Opening6.png")
      title1.z = 3
      title1.opacity = 0
      title1.color = Color.new(255,255,255,255)
      
      title2 = Sprite.new
      title2.bitmap = RPG::Cache.title("Opening7.png")
      title2.z = 4
      title2.opacity = 0
      title2.color = Color.new(255,255,255,255)
      
      flash = Sprite.new
      flash.bitmap = RPG::Cache.title("Opening8.png")
      flash.z = 10
      flash.opacity = 0
      
      mid = Sprite.new
      mid.bitmap = RPG::Cache.title("Opening5.png")
      mid.z = 5
      mid.visible = false
      
      screen = Sprite.new
      screen.bitmap = RPG::Cache.title("Opening10.png")
      screen.z = 2
      screen.visible = false
      
      start = Sprite.new
      start.bitmap = RPG::Cache.title("Opening11.png")
      start.z = 5
      start.visible = false
      
      Graphics.transition(5)
      
      $game_system.bgm_play($data_system.title_bgm)
      Audio.me_stop
      Audio.bgs_stop
      
      timer = 0
      loop do
        Graphics.update
        Input.update
        
        timer += 1
        background.ox -= 12
        #background_bis.ox += 6
        
        if timer == 210
          background.tone.gray = 0
        end
        
        if timer > 210 and background.tone.red > 0
          background.tone.red -= 25
          background.tone.green -= 25
        end
          
        if timer > 210 and timer % (150 + rand(50)) == 0
          background.tone.red = background.tone.green = 250
        end
        
        if flash.opacity > 0
          flash.opacity -= 15
        end
        
        if timer > 5 and not band_top.disposed?
          band_top.x += 13
          if band_top.x > 640
            band_top.dispose
          end
        end
        
        if timer > 73 and not band_bottom.disposed?
          band_bottom.x -= 13
          if band_bottom.x < -640
            band_bottom.dispose
          end
        end
        
        if timer > 150 and not band_mid.disposed?
          band_mid.ox -= 20
          if timer > 210
            band_mid.dispose
            mid.visible = true
          end
        end
        
        if timer > 210 and not title1.disposed? and title1.opacity < 255
          title1.opacity += 15
          title1.color.alpha -= 15
        end
        
        if timer > 240 and not title1.disposed? and title1.opacity == 255
          title1.color.alpha += 15
        end
        
        if timer == 270
          flash.opacity = 255
          title1.dispose
          mid.dispose
          middle.dispose
          screen.visible = true
        end
        
        if timer > 270 and not title2.disposed? and title2.opacity < 255
          title2.opacity += 15
          title2.color.alpha -= 15
          if title2.opacity >= 255
            title2.dispose
          end
        end
        
        if timer > 290 and timer%20 == 0
          start.visible = !start.visible
        end
        
        if Input.trigger?(Input::C)
          $game_system.se_play($data_system.decision_se)
          break
        end
        
        if timer > 3750
          Audio.bgm_fade(1000*5)
        end
        
      end
      
      Graphics.freeze
      background.dispose if not background.disposed?
      #background_bis.dispose if not background_bis.disposed?
      band_top.dispose if not band_top.disposed?
      band_bottom.dispose if not band_bottom.disposed?
      band_mid.dispose if not band_mid.disposed?
      mid.dispose if not mid.disposed?
      middle.dispose if not middle.disposed?
      title1.dispose if not title1.disposed?
      title2.dispose if not title2.disposed?
      flash.dispose if not flash.disposed?
      start.dispose if not start.disposed?
      screen.dispose if not screen.disposed?
      Graphics.transition
      Graphics.freeze
      
      Audio.bgm_stop
=end


      # -----------------------------------------------------------------
      #     Fin de la scène d'intro
      # -----------------------------------------------------------------
    
    elsif MAPINTRO.type == Array and $_temp_map_intro == nil
      $_temp_map_intro = true
      $map_link = {}
      Audio.bgm_stop
      Graphics.frame_count = 0
      $game_temp          = Game_Temp.new
      $game_system        = Game_System.new
      $game_switches      = Game_Switches.new
      $game_variables     = Game_Variables.new
      $game_self_switches = Game_SelfSwitches.new
      $game_screen        = Game_Screen.new
      $game_actors        = Game_Actors.new
      $game_party         = Game_Party.new
      $game_troop         = Game_Troop.new
      $game_map           = Game_Map.new
      $game_player        = Game_Player.new
      # ---- Pas forcément nécessaire
      $pokemon_party = POKEMON_S::Pokemon_Party.new
      $data_storage = [[0]]
      $pokemon_party.create_box
      Player.set_trainer_code(rand(2**32))
      $random_encounter = Array.new(7)
      $random_encounter[0] = 0
      $battle_var = POKEMON_S::Pokemon_Battle_Variable.new
      $existing_pokemon = []
      $string = []
      POKEMON_S::set_SAVESLOT = @index
      Player.trainer_trade_code
      # ---- Pas forcément nécessaire
      $game_party.setup_starting_members
      $game_map.setup(MAPINTRO[0])
      $game_player.moveto(MAPINTRO[1], MAPINTRO[2])
      $game_player.refresh
      $game_map.autoplay
      $game_map.update
      $scene = Scene_Map.new
      return
    end
    
    Audio.bgm_stop
    $_temp_map_intro = nil
    
    @sprite = Sprite.new
    @sprite.bitmap = RPG::Cache.title($data_system.title_name)
    
    number = 0 # Nombre de cadres de sauvegarde à générer
    for i in 0..1
      if FileTest.exist?("Save#{i+1}.rxdata")
        number += 1
      end
    end
    @number = number
    
    @new_game_window = Window_Base.new(33, (16 + 48*@number), 216, 45)
    @new_game_window.contents = Bitmap.new(216, 48)
    set_window(@new_game_window)
    @new_game_window.contents.font.color = Color.new(160,160,168,255)
    @new_game_window.contents.draw_text(1,-16,216,48,"NOUVELLE PARTIE")
    @new_game_window.contents.draw_text(0,-15,216,48,"NOUVELLE PARTIE")
    @new_game_window.contents.draw_text(1,-15,216,48,"NOUVELLE PARTIE")
    @new_game_window.contents.font.color = Color.new(80,80,88,255)
    @new_game_window.contents.draw_text(0,-16,216,48,"NOUVELLE PARTIE")
    
    @save_game_window_list = []
    for i in 1.. @number
      window = Window_Base.new(33, 10 + (83-20)*(i-1), 216, 45)
      window.contents = Bitmap.new(548, 48)
      @save_game_window_list.push(window)
    end
    
    @index = 0
    
    @background = Plane.new(Viewport.new(136-123,33-20,256,192))
    @background.bitmap = RPG::Cache.picture("fondsaved.png")
    @background.z -= 10    
    @background2 = Sprite.new
    @background2.bitmap = RPG::Cache.title("Opening1.png")
    @background2.x = 13
    @background2.y = 227
    @background2.z = 1000
    
    refresh_all
    Graphics.transition
    
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    
    Graphics.freeze
    
    @new_game_window.dispose
    @background.dispose
    @background2.dispose
    for window in @save_game_window_list
      window.dispose
    end
  end
  
  def update     
    if Input.trigger?(Input::DOWN)
      $game_system.se_play($data_system.decision_se)
      @index += @index == @number ? 0 : 1
      if @erase and @index > 2
        @index = 2
      end
      refresh_all
    end
    if Input.trigger?(Input::UP)
      $game_system.se_play($data_system.decision_se)
      @index -= @index == 0 ? 0 : 1
      refresh_all
    end   
    
    if Input.trigger?(Input::C)
      case @index
      when @number # Nouveau jeu
        if SAVEBOUNDSLOT and @number == 2
          $game_system.se_play($data_system.decision_se)
          @erase = true
          @index = 0
          @new_game_window.contents.clear
          @new_game_window.contents.font.color = Color.new(160,160,168,255)
          @new_game_window.contents.draw_text(1,-16,548,48,"RECOMMENCER QUELLE PARTIE?")
          @new_game_window.contents.draw_text(0,-15,548,48,"RECOMMENCER QUELLE PARTIE?")
          @new_game_window.contents.draw_text(1,-15,548,48,"RECOMMENCER QUELLE PARTIE?")
          @new_game_window.contents.font.color = Color.new(80,80,88,255)
          @new_game_window.contents.draw_text(0,-16,548,48,"RECOMMENCER QUELLE PARTIE?")
          refresh_all
        else          
          command_new_game
        end
      else # Chargement
        if @erase
          command_new_game
        else
          $game_temp = Game_Temp.new
          on_decision("Save#{@index + 1}.rxdata")
        end
      end
    end
    if Input.trigger?(Input::B) and @erase
      $game_system.se_play($data_system.cancel_se)
      @erase = false
      @index = 2
      @new_game_window.contents.clear
      @new_game_window.contents.font.color = Color.new(160,160,168,255)
      @new_game_window.contents.draw_text(1,-16,548,48,"NOUVELLE PARTIE")
      @new_game_window.contents.draw_text(0,-15,548,48,"NOUVELLE PARTIE")
      @new_game_window.contents.draw_text(1,-15,548,48,"NOUVELLE PARTIE")
      @new_game_window.contents.font.color = Color.new(80,80,88,255)
      @new_game_window.contents.draw_text(0,-16,548,48,"NOUVELLE PARTIE")
      refresh_all
    end 
    
    if @auto_load != nil
      $game_temp = Game_Temp.new
      on_decision("SaveAuto.rxdata")
      File.delete("SaveAuto.rxdata")
    end
  end
  
  def refresh_all    
    for i in 0.. @number-1
      if i < @index
        @save_game_window_list[i].opacity = 128
        @save_game_window_list[i].y = 15 + 48*i
        @save_game_window_list[i].height = 48
        @save_game_window_list[i].contents = Bitmap.new(548, 48)
        set_window(@save_game_window_list[i])
        @save_game_window_list[i].contents.font.color = Color.new(160,160,168,255)
        @save_game_window_list[i].contents.draw_text(1,-16, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
        @save_game_window_list[i].contents.draw_text(0,-15, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
        @save_game_window_list[i].contents.draw_text(1,-15, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
        @save_game_window_list[i].contents.font.color = Color.new(80,80,88,255)
        @save_game_window_list[i].contents.draw_text(0,-16, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
      elsif i == @index
        @save_game_window_list[i].opacity = 255
        @save_game_window_list[i].y = 15 + 48*i
        @save_game_window_list[i].height = 97
        @save_game_window_list[i].contents = Bitmap.new(548, 131)
        set_window(@save_game_window_list[i])
        @save_game_window_list[i].contents.font.color = Color.new(160,160,168,255)
        @save_game_window_list[i].contents.draw_text(1,-16, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
        @save_game_window_list[i].contents.draw_text(0,-15, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
        @save_game_window_list[i].contents.draw_text(1,-15, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
        @save_game_window_list[i].contents.font.color = Color.new(80,80,88,255)
        @save_game_window_list[i].contents.draw_text(0,-16, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
        @filename = "Save#{i + 1}.rxdata"
        list = read_preview(@filename)
        data = list[0]
        time_sec = list[1]
        hour = (time_sec / 3600).to_s
        minute = "00"
        minute += ((time_sec%3600)/60).to_s
        minute = minute[minute.size-2, 2]
        time =  hour + ":" + minute
        name = data[0].to_s
        id = data[1].to_i
        captured = data[2].to_s
        badge = 0.to_s
        #chargement des données
        file = File.open("Save#{i + 1}.rxdata", "r")
          read_save_data(file)
        file.close
        #Couleur de la police si votre heros est un garcon        
        @save_game_window_list[i].contents.font.color = Color.new(120, 184, 232, 255)
        
        @save_game_window_list[i].contents.draw_text(9+1, 0, 252, 48, "JOUEUR")
        @save_game_window_list[i].contents.draw_text(9+1, 0, 167, 48, name, 2)
        @save_game_window_list[i].contents.draw_text(9+1, 12, 252, 48, "DUREE DE JEU")
        @save_game_window_list[i].contents.draw_text(9+1, 12, 167, 48, time , 2)
        @save_game_window_list[i].contents.draw_text(9+1, 24, 252, 48, "BADGES")
        @save_game_window_list[i].contents.draw_text(9+1, 24, 167, 48, badge, 2)
        @save_game_window_list[i].contents.draw_text(9+1, 36, 252, 48, "POKéDEX")
        @save_game_window_list[i].contents.draw_text(9+1, 36, 167, 48, captured, 2)
        
        @save_game_window_list[i].contents.draw_text(9, 0+1, 252, 48, "JOUEUR")
        @save_game_window_list[i].contents.draw_text(9, 0+1, 167, 48, name, 2)
        @save_game_window_list[i].contents.draw_text(9, 12+1, 252, 48, "DUREE DE JEU")
        @save_game_window_list[i].contents.draw_text(9, 12+1, 167, 48, time , 2)
        @save_game_window_list[i].contents.draw_text(9, 24+1, 252, 48, "BADGES")
        @save_game_window_list[i].contents.draw_text(9, 24+1, 167, 48, badge, 2)
        @save_game_window_list[i].contents.draw_text(9, 36+1, 252, 48, "POKéDEX")
        @save_game_window_list[i].contents.draw_text(9, 36+1, 167, 48, captured, 2)
        
        @save_game_window_list[i].contents.draw_text(9+1, 0+1, 252, 48, "JOUEUR")
        @save_game_window_list[i].contents.draw_text(9+1, 0+1, 167, 48, name, 2)
        @save_game_window_list[i].contents.draw_text(9+1, 12+1, 252, 48, "DUREE DE JEU")
        @save_game_window_list[i].contents.draw_text(9+1, 12+1, 167, 48, time , 2)
        @save_game_window_list[i].contents.draw_text(9+1, 24+1, 252, 48, "BADGES")
        @save_game_window_list[i].contents.draw_text(9+1, 24+1, 167, 48, badge, 2)
        @save_game_window_list[i].contents.draw_text(9+1, 36+1, 252, 48, "POKéDEX")
        @save_game_window_list[i].contents.draw_text(9+1, 36+1, 167, 48, captured, 2)
        
        @save_game_window_list[i].contents.font.color = Color.new(0, 112, 248, 255)
        @save_game_window_list[i].contents.draw_text(9, 0, 252, 48, "JOUEUR")
        @save_game_window_list[i].contents.draw_text(9, 0, 167, 48, name, 2)
        @save_game_window_list[i].contents.draw_text(9, 12, 252, 48, "DUREE DE JEU")
        @save_game_window_list[i].contents.draw_text(9, 12, 167, 48, time , 2)
        @save_game_window_list[i].contents.draw_text(9, 24, 252, 48, "BADGES")
        @save_game_window_list[i].contents.draw_text(9, 24, 167, 48, badge, 2)
        @save_game_window_list[i].contents.draw_text(9, 36, 252, 48, "POKéDEX")
        @save_game_window_list[i].contents.draw_text(9, 36, 167, 48, captured, 2)
        # XX est a remplacer par le numero de l'intérupteur qui détermine si vous
        # avez choisi un Garcon ou une fille
        if $game_variables[11] == 2
          #Couleur de la police si votre heros est une fille
        @save_game_window_list[i].contents.font.color = Color.new(248, 168, 184, 255)
        
        @save_game_window_list[i].contents.draw_text(9+1, 0, 252, 48, "JOUEUR")
        @save_game_window_list[i].contents.draw_text(9+1, 0, 167, 48, name, 2)
        @save_game_window_list[i].contents.draw_text(9+1, 12, 252, 48, "DUREE DE JEU")
        @save_game_window_list[i].contents.draw_text(9+1, 12, 167, 48, time , 2)
        @save_game_window_list[i].contents.draw_text(9+1, 24, 252, 48, "BADGES")
        @save_game_window_list[i].contents.draw_text(9+1, 24, 167, 48, badge, 2)
        @save_game_window_list[i].contents.draw_text(9+1, 36, 252, 48, "POKéDEX")
        @save_game_window_list[i].contents.draw_text(9+1, 36, 167, 48, captured, 2)
        
        @save_game_window_list[i].contents.draw_text(9, 0+1, 252, 48, "JOUEUR")
        @save_game_window_list[i].contents.draw_text(9, 0+1, 167, 48, name, 2)
        @save_game_window_list[i].contents.draw_text(9, 12+1, 252, 48, "DUREE DE JEU")
        @save_game_window_list[i].contents.draw_text(9, 12+1, 167, 48, time , 2)
        @save_game_window_list[i].contents.draw_text(9, 24+1, 252, 48, "BADGES")
        @save_game_window_list[i].contents.draw_text(9, 24+1, 167, 48, badge, 2)
        @save_game_window_list[i].contents.draw_text(9, 36+1, 252, 48, "POKéDEX")
        @save_game_window_list[i].contents.draw_text(9, 36+1, 167, 48, captured, 2)
        
        @save_game_window_list[i].contents.draw_text(9+1, 0+1, 252, 48, "JOUEUR")
        @save_game_window_list[i].contents.draw_text(9+1, 0+1, 167, 48, name, 2)
        @save_game_window_list[i].contents.draw_text(9+1, 12+1, 252, 48, "DUREE DE JEU")
        @save_game_window_list[i].contents.draw_text(9+1, 12+1, 167, 48, time , 2)
        @save_game_window_list[i].contents.draw_text(9+1, 24+1, 252, 48, "BADGES")
        @save_game_window_list[i].contents.draw_text(9+1, 24+1, 167, 48, badge, 2)
        @save_game_window_list[i].contents.draw_text(9+1, 36+1, 252, 48, "POKéDEX")
        @save_game_window_list[i].contents.draw_text(9+1, 36+1, 167, 48, captured, 2)
        
        @save_game_window_list[i].contents.font.color = Color.new(232, 32, 16, 255)
        @save_game_window_list[i].contents.draw_text(9, 0, 252, 48, "JOUEUR")
        @save_game_window_list[i].contents.draw_text(9, 0, 167, 48, name, 2)
        @save_game_window_list[i].contents.draw_text(9, 12, 252, 48, "DUREE DE JEU")
        @save_game_window_list[i].contents.draw_text(9, 12, 167, 48, time , 2)
        @save_game_window_list[i].contents.draw_text(9, 24, 252, 48, "BADGES")
        @save_game_window_list[i].contents.draw_text(9, 24, 167, 48, badge, 2)
        @save_game_window_list[i].contents.draw_text(9, 36, 252, 48, "POKéDEX")
        @save_game_window_list[i].contents.draw_text(9, 36, 167, 48, captured, 2)
        end
      elsif i > @index
        @save_game_window_list[i].opacity = 128
        @save_game_window_list[i].y = 15 + 48*i + 48
        @save_game_window_list[i].height = 48
        @save_game_window_list[i].contents = Bitmap.new(548, 48)
        set_window(@save_game_window_list[i])
        @save_game_window_list[i].contents.font.color = Color.new(160,160,168,255)
        @save_game_window_list[i].contents.draw_text(1,-16, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
        @save_game_window_list[i].contents.draw_text(0,-15, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
        @save_game_window_list[i].contents.draw_text(1,-15, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
        @save_game_window_list[i].contents.font.color = Color.new(80,80,88,255)
        @save_game_window_list[i].contents.draw_text(0,-16, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
      end
    end
    if @index == @number
      @new_game_window.opacity = 255
      @new_game_window.y = 15 + 48*@number
    else
      @new_game_window.opacity = 128
      @new_game_window.y = 15 + 48*(@number+1)
    end
  end
  
  def set_window(window)
    window.contents.font.name = $fontface
    window.contents.font.size = $fontsizebig
    window.contents.font.color = window.normal_color
  end
  
  # --------------------------------------------------------
  # Chargement
  # --------------------------------------------------------
  def read_preview(filename)
    file = File.open(filename, "r")
    time_stamp      = file.mtime
    characters      = Marshal.load(file)
    frame_count     = Marshal.load(file)
    game_system     = Marshal.load(file)
    game_switches   = Marshal.load(file)
    game_variables  = Marshal.load(file)
    total_sec = frame_count / Graphics.frame_rate
    
    # Non utilisé
    game_self_switches = Marshal.load(file)
    game_screen     = Marshal.load(file)
    game_actors     = Marshal.load(file)
    game_party      = Marshal.load(file)
    game_troop      = Marshal.load(file)
    game_map        = Marshal.load(file)
    game_player     = Marshal.load(file)
    # ------------
    read_data       = Marshal.load(file)
    file.close
    return [read_data, total_sec]
  end
  
  def read_save_data(file)
    characters = Marshal.load(file)
    Graphics.frame_count = Marshal.load(file)
    $game_system        = Marshal.load(file)
    $game_switches      = Marshal.load(file)
    $game_variables     = Marshal.load(file)
    $game_self_switches = Marshal.load(file)
    $game_screen        = Marshal.load(file)
    $game_actors        = Marshal.load(file)
    $game_party         = Marshal.load(file)
    $game_troop         = Marshal.load(file)
    $game_map           = Marshal.load(file)
    $game_player        = Marshal.load(file)
    $read_data          = Marshal.load(file)     
    if SAVE_CONVERT # Conversion des sauvegardes pre-v0.7 à v0.7+
      Player.set_trainer_code(Marshal.load(file)) # Variable trainer_code
      trainer_id                         = Marshal.load(file) # Variable
      $game_party.actors[0].name         = Marshal.load(file) # Game_Actor
      $game_party.actors[0].set_graphic($game_party.actors[0].character_name,
                                        $game_party.actors[0].character_hue,
                                        Marshal.load(file),
                                        $game_party.actors[0].battler_hue
                                       )# Game_Actor
    end
    $pokemon_party      = Marshal.load(file)
    $random_encounter   = Marshal.load(file)
    $data_pokedex       = Marshal.load(file)
    $data_storage       = Marshal.load(file)
    $battle_var         = Marshal.load(file)
    $existing_pokemon   = Marshal.load(file)
    $string             = Marshal.load(file)
    $SPEED_MSG          = Marshal.load(file)
    $color_menu         = Marshal.load(file)
    $NB_MSG             = Marshal.load(file)
    $MSG                = Marshal.load(file)
    $voir_anim          = Marshal.load(file)
    $choix_battle       = Marshal.load(file)
    $map_link = ($read_data != nil and $read_data[3] != nil) ? $read_data[3] : {}
    if $game_system.magic_number != $data_system.magic_number
      $game_map.setup($game_map.map_id)
      $game_player.center($game_player.x, $game_player.y)
    end
    $game_party.refresh
    POKEMON_S::set_SAVESLOT = @index
    Player.trainer_trade_code
  end
  
  def on_decision(filename)
    unless FileTest.exist?(filename)
      $game_system.se_play($data_system.buzzer_se)
      return
    end
    $game_system.se_play($data_system.load_se)
    file = File.open(filename, "rb")
    read_save_data(file)
    file.close    
    $game_system.bgm_play($game_system.playing_bgm)
    $game_system.bgs_play($game_system.playing_bgs)
    $game_map.update
    $scene = Scene_Map.new    
    $scene.update_encounter
    Player.pokedex_update
  end
  
  alias alias_command_new_game command_new_game
  def command_new_game    
    $map_link = {}
    alias_command_new_game
    #-----------------------------------------------------
    # Variables créées automatiquement au début du jeu
    #   Elles sont absolument nécessaires
    #-----------------------------------------------------
    $pokemon_party = POKEMON_S::Pokemon_Party.new
    $data_storage = [[0]]
    $pokemon_party.create_box
    Player.set_trainer_code(rand(2**32))
    $random_encounter = Array.new(7)
    $random_encounter[0] = 0
    $battle_var = POKEMON_S::Pokemon_Battle_Variable.new
    $existing_pokemon = []
    $string = []      
    POKEMON_S::set_SAVESLOT = @index
    Player.trainer_trade_code
    $data_pokedex = Array.new($data_pokemon.length-1)
    $data_pokedex[0] = false # Possède ou non
    for i in 1..$data_pokemon.length-1
      $data_pokedex[i] = [false, false] # Vu, Capturé        
    end      
    $game_switches[15] = true # Système Jour/Nuit
    #-----------------------------------------------------
    # Valeurs par défaut
    #-----------------------------------------------------    
    $SPEED_MSG = POKEMON_S::SPEED_MSG   # Vitesse message
    $color_menu = POKEMON_S::COLOR_MENU # Couleur d'image du Menu Echap
    $NB_MSG = POKEMON_S::NB_MSG         # Numéro de la fenêtre de dialogue
    $MSG = POKEMON_S::MSG               # Nom complet de la fenêtre de dialogue
    $voir_anim = true                   # Animations d'attaques
    $choix_battle = true                # Changement de Pokémon en combat
  end
end


Je précise le message d'erreur :
Code:

????? 'Scene_Title' ? 341 ??? SyntaxError ????????


Sinon je vais pas recréer un topic pour ça, j'ai un remis le code de départ et j'ai un petit bug quand mon héros est téléporté sur une map :
Code:

---------- Erreur de script : MAP ----------
----- Type
NoMethodError

----- Message
- ARGS - [1]
undefined method `[]' for nil:NilClass

----- Position dans MAP
Ligne 152

----- Backtrace
Script : MAP | Ligne : 152 | Méthode : in `initialize_world_map'
Script : Game_Map | Ligne : 138 | Méthode : in `refresh'
Script : Game_Map | Ligne : 371 | Méthode : in `update'
Script : Scene_Map | Ligne : 190 | Méthode : in `transfer_player'
Script : Scene_Map | Ligne : 55 | Méthode : in `alias_update'
Script : Scene_Map | Ligne : 46 | Méthode : in `loop'
Script : Scene_Map | Ligne : 59 | Méthode : in `alias_update'
Script : MAPPANEL* | Ligne : 89 | Méthode : in `oldUpdate'
Script : Bouton_Rouge* | Ligne : 54 | Méthode : in `update'
Script : Scene_Map | Ligne : 26 | Méthode : in `main'
Script : Scene_Map | Ligne : 21 | Méthode : in `loop'
Script : Scene_Map | Ligne : 33 | Méthode : in `main'
Script : Main | Ligne : 58



Le script MAP est celui de PSP DS v3.

Merci d'avance.

Posté par Pαlвσlѕку le 6 Juin - 17:35 (2011)
Pour ton bug de téléportation, c'est parce que tu essayes de te téléporter sur la carte du monde.
Tu peux changer son ID dans le script Config Panel.

Posté par Sphinx le 6 Juin - 17:38 (2011)
Pour ta SyntaxError, t'as un =end qui se balade dans ton code juste au dessus de la ligne 340. Je ne sais pas où était le =begin qui correspond, mais en tout état de cause il te suffit de le virer et ca marchera ptêtre mieux ^^

Posté par Nuri Yuri le 6 Juin - 17:46 (2011)
Ça ne ferais qu'empirer il y a un =begin avant.
Remplace :
Code:
end
frame = -9
end

par
Code:

frame = -9
end

Posté par Sphinx le 6 Juin - 18:24 (2011)
Relis le code & ma réponse, Yuri :p

Le second end ferme le loop do plus haut. Le supprimer ne fera que provoquer une autre SyntaxError, l'une masquant obligatoirement l'autre Clin d'œil foireux En outre, je ne dis pas de rajouter un =begin, mais bien de virer purement et simplement ce =end qui traine (ce qui corrigera cette erreur SyntaxError)

Posté par Odjavel le 6 Juin - 18:33 (2011)
Donc en gros je dois supprimer ce =end ? Si je le fais, ça me fous tout en commentaire(en vert, quoi) et ça me met une syntax error à la ligne 15. De même que si je fais la manip de Yuri. Sinon pour le premier bug, c'est réglé. Il fallait juste créer la worldmap.

Posté par Sphinx le 6 Juin - 18:38 (2011)
Ah ?

Alors c'est qu'il est utile là où il est finalement. Mais dans ce cas, supprime tous les espaces devant ce =end pour qu'il soit correctement interprété Imbécile heureux

Posté par Odjavel le 6 Juin - 18:42 (2011)
Mais ce que je comprend pas, c'est que c'est un commentaire ---> Qu'on la supprime ou non ça va rien changer.
Désolé, j'ai vraiment rien compris xD

Posté par Sphinx le 6 Juin - 18:45 (2011)
en fait, les commentaires multilignes (blocs) sont encadrés par deux balises :

=begin
au début du commentaire.

et à la fin du commentaire :
=end

^^ Et effectivement, si un ou plusieurs espaces/tabulations sont au début d'une ligne qui contient ces balises, ca plante aussi ^^"

Posté par Nuri Yuri le 6 Juin - 18:46 (2011)
T'es têtu XD
Code:
Err: C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_origin
al_require': ./ds.rb:341: syntax error, unexpected kELSIF, expecting kEND
  elsif MAPINTRO.type == Array and $_temp_map_intro == nil
       ^
./ds.rb:787: syntax error, unexpected kEND, expecting $end

ça veux dire clairement que c'est pas le com qui gène sinon il aurais dit qu'il ne trouve pas la fin du script et qu'il y a un end en trop.

Le script sans bug de compilation est celui ci :
Spoiler
Code:
#==============================================================================
# ¦ Scene_Title (Version Pokémon)
# Pokemon Script Project - Krosk
# 01/08/07
#------------------------------------------------------------------------------
# Scène modifiable
#------------------------------------------------------------------------------
# Intègre le menu de chargement
#------------------------------------------------------------------------------


class Scene_Title
 include POKEMON_S
 
 def main   
  if $BTEST
   battle_test
   return
  end 
 
 def cry_pokemon(id_data)
  if id_data.type == String
   id = id_conversion(id_data)
  elsif id_data.type == Fixnum
   id = id_data
  end
  ida = sprintf("%03d", id)
  filename = "Audio/SE/Cries/" + ida + "Cry.wav"
  if FileTest.exist?(filename)
   Audio.se_play(filename)
  end
  return true
 end
 
  if FileTest.exist?("SaveAuto.rxdata")
   print("Sauvegarde de secours détectée.\n\nAppuyez sur Entrée, puis sur Echap pour charger, ou Entrée pour continuer.")
   loop do
    Input.update
    if Input.trigger?(Input::C)
     File.delete("SaveAuto.rxdata")
     break
    end
    if Input.trigger?(Input::B)
     @auto_load = true
     break
    end
   end
  end
 
  if $game_system == nil
   $data_actors    = load_data("Data/Actors.rxdata")
   $data_classes   = load_data("Data/Classes.rxdata")
   $data_skills    = load_data("Data/Skills.rxdata")
   $data_items    = load_data("Data/Items.rxdata")
   $data_weapons   = load_data("Data/Weapons.rxdata")
   $data_armors    = load_data("Data/Armors.rxdata")
   $data_enemies   = load_data("Data/Enemies.rxdata")
   $data_troops    = load_data("Data/Troops.rxdata")
   $data_states    = load_data("Data/States.rxdata")
   $data_animations  = load_data("Data/Animations.rxdata")
   $data_tilesets   = load_data("Data/Tilesets.rxdata")
   $data_common_events = load_data("Data/CommonEvents.rxdata")
   $data_system    = load_data("Data/System.rxdata")
   $picture_data   = load_data("Data/Library.rxdata")
   
   $game_system = Game_System.new
  end
 
  if not @auto_load and not MAPINTRO
 
   # -----------------------------------------------------------------
   #  La scène d'intro commence ici (non MAPINTRO)
   # -----------------------------------------------------------------
   # Elle est bien sûr modifiable à votre goût.
   # -----------------------------------------------------------------
   view = Viewport.new(0,0,640,480)
   view.z = -5
   
   background = Sprite.new
   background.bitmap = RPG::Cache.title("Opening1.png")
   background.x = 13
   background.y = 13
   background.z = 0
   
   background2 = Sprite.new
   background2.bitmap = RPG::Cache.title("Opening2_1.png")
   background2.x = 13
   background2.y = 227
   background2.z = 0
   
   start = Sprite.new
   start.bitmap = RPG::Cache.title("Opening3.png")
   start.x = 66
   start.y = 167 + 215
   start.z = 5
   start.visible = false
   
   Graphics.transition(5)
   
   $game_system.bgm_play($data_system.title_bgm)
   Audio.me_stop
   Audio.bgs_stop
   
   timer = 0
   frame = 0
   
   loop do
    Graphics.update
    Input.update
   
    timer += 1
    frame += 1
   
    if timer > 20 and timer%35 == 0
     start.visible = !start.visible
    end
   
    if frame == 0
    background2.bitmap = RPG::Cache.title("Opening2_1.png")
    end
    if frame == 5
     background2.bitmap = RPG::Cache.title("Opening2_2.png")     
    end   
    if frame == 10
     background2.bitmap = RPG::Cache.title("Opening2_3.png")
    end
    if frame == 15
     background2.bitmap = RPG::Cache.title("Opening2_4.png")
    end
    if frame == 20
     background2.bitmap = RPG::Cache.title("Opening2_5.png")
    end
    if frame == 25
     background2.bitmap = RPG::Cache.title("Opening2_6.png")
    end
    if frame == 30
     background2.bitmap = RPG::Cache.title("Opening2_7.png")
    end
    if frame == 35
     background2.bitmap = RPG::Cache.title("Opening2_8.png")
     frame = -9
    end   
   
   if timer > 40
    if Input.trigger?(Input::C) or TACTILE.det_clique(14,270,228,420)   
     cry_pokemon(249)         
     break     
    end
   end     
  end   
   
   Graphics.freeze
   background.dispose
   background2.dispose
   start.dispose
   
   Audio.bgm_stop
   
=begin
   #view = Viewport.new(0,25,640,430)
   #view.z = 0
   background = Plane.new(view)
   background.bitmap = RPG::Cache.title("Opening2.jpg")
   #background.oy += 25
   background.z = 0
   background.tone = Tone.new(0,0,0,255)
   
   #view = Viewport.new(0,0,640,480)
   #view.z = -5
   #background_bis = Plane.new(view)
   #background_bis.bitmap = RPG::Cache.title("Opening2.jpg")
   #background_bis.z = -5
   
   band_top = Sprite.new
   band_top.bitmap = RPG::Cache.title("Opening3.png")
   band_top.z = 5
   band_bottom = Sprite.new
   band_bottom.bitmap = RPG::Cache.title("Opening3.png")
   band_bottom.z = 5
   band_bottom.y = 450
   
   band_mid = Plane.new(Viewport.new(0,0,640,480))
   band_mid.bitmap = RPG::Cache.title("Opening4.png")
   band_mid.z = 5
   
   middle = Sprite.new
   middle.bitmap = RPG::Cache.title("Opening1.png")
   middle.z = 2
   
   title1 = Sprite.new
   title1.bitmap = RPG::Cache.title("Opening6.png")
   title1.z = 3
   title1.opacity = 0
   title1.color = Color.new(255,255,255,255)
   
   title2 = Sprite.new
   title2.bitmap = RPG::Cache.title("Opening7.png")
   title2.z = 4
   title2.opacity = 0
   title2.color = Color.new(255,255,255,255)
   
   flash = Sprite.new
   flash.bitmap = RPG::Cache.title("Opening8.png")
   flash.z = 10
   flash.opacity = 0
   
   mid = Sprite.new
   mid.bitmap = RPG::Cache.title("Opening5.png")
   mid.z = 5
   mid.visible = false
   
   screen = Sprite.new
   screen.bitmap = RPG::Cache.title("Opening10.png")
   screen.z = 2
   screen.visible = false
   
   start = Sprite.new
   start.bitmap = RPG::Cache.title("Opening11.png")
   start.z = 5
   start.visible = false
   
   Graphics.transition(5)
   
   $game_system.bgm_play($data_system.title_bgm)
   Audio.me_stop
   Audio.bgs_stop
   
   timer = 0
   loop do
    Graphics.update
    Input.update
   
    timer += 1
    background.ox -= 12
    #background_bis.ox += 6
   
    if timer == 210
     background.tone.gray = 0
    end
   
    if timer > 210 and background.tone.red > 0
     background.tone.red -= 25
     background.tone.green -= 25
    end
     
    if timer > 210 and timer % (150 + rand(50)) == 0
     background.tone.red = background.tone.green = 250
    end
   
    if flash.opacity > 0
     flash.opacity -= 15
    end
   
    if timer > 5 and not band_top.disposed?
     band_top.x += 13
     if band_top.x > 640
      band_top.dispose
     end
    end
   
    if timer > 73 and not band_bottom.disposed?
     band_bottom.x -= 13
     if band_bottom.x < -640
      band_bottom.dispose
     end
    end
   
    if timer > 150 and not band_mid.disposed?
     band_mid.ox -= 20
     if timer > 210
      band_mid.dispose
      mid.visible = true
     end
    end
   
    if timer > 210 and not title1.disposed? and title1.opacity < 255
     title1.opacity += 15
     title1.color.alpha -= 15
    end
   
    if timer > 240 and not title1.disposed? and title1.opacity == 255
     title1.color.alpha += 15
    end
   
    if timer == 270
     flash.opacity = 255
     title1.dispose
     mid.dispose
     middle.dispose
     screen.visible = true
    end
   
    if timer > 270 and not title2.disposed? and title2.opacity < 255
     title2.opacity += 15
     title2.color.alpha -= 15
     if title2.opacity >= 255
      title2.dispose
     end
    end
   
    if timer > 290 and timer%20 == 0
     start.visible = !start.visible
    end
   
    if Input.trigger?(Input::C)
     $game_system.se_play($data_system.decision_se)
     break
    end
   
    if timer > 3750
     Audio.bgm_fade(1000*5)
    end
   
   end
   
   Graphics.freeze
   background.dispose if not background.disposed?
   #background_bis.dispose if not background_bis.disposed?
   band_top.dispose if not band_top.disposed?
   band_bottom.dispose if not band_bottom.disposed?
   band_mid.dispose if not band_mid.disposed?
   mid.dispose if not mid.disposed?
   middle.dispose if not middle.disposed?
   title1.dispose if not title1.disposed?
   title2.dispose if not title2.disposed?
   flash.dispose if not flash.disposed?
   start.dispose if not start.disposed?
   screen.dispose if not screen.disposed?
   Graphics.transition
   Graphics.freeze
   
   Audio.bgm_stop
=end


   # -----------------------------------------------------------------
   #  Fin de la scène d'intro
   # -----------------------------------------------------------------
 
  elsif MAPINTRO.type == Array and $_temp_map_intro == nil
   $_temp_map_intro = true
   $map_link = {}
   Audio.bgm_stop
   Graphics.frame_count = 0
   $game_temp     = Game_Temp.new
   $game_system    = Game_System.new
   $game_switches   = Game_Switches.new
   $game_variables  = Game_Variables.new
   $game_self_switches = Game_SelfSwitches.new
   $game_screen    = Game_Screen.new
   $game_actors    = Game_Actors.new
   $game_party    = Game_Party.new
   $game_troop    = Game_Troop.new
   $game_map     = Game_Map.new
   $game_player    = Game_Player.new
   # ---- Pas forcément nécessaire
   $pokemon_party = POKEMON_S::Pokemon_Party.new
   $data_storage = [[0]]
   $pokemon_party.create_box
   Player.set_trainer_code(rand(2**32))
   $random_encounter = Array.new(7)
   $random_encounter[0] = 0
   $battle_var = POKEMON_S::Pokemon_Battle_Variable.new
   $existing_pokemon = []
   $string = []
   POKEMON_S::set_SAVESLOT = @index
   Player.trainer_trade_code
   # ---- Pas forcément nécessaire
   $game_party.setup_starting_members
   $game_map.setup(MAPINTRO[0])
   $game_player.moveto(MAPINTRO[1], MAPINTRO[2])
   $game_player.refresh
   $game_map.autoplay
   $game_map.update
   $scene = Scene_Map.new
   return
  end
 
  Audio.bgm_stop
  $_temp_map_intro = nil
 
  @sprite = Sprite.new
  @sprite.bitmap = RPG::Cache.title($data_system.title_name)
 
  number = 0 # Nombre de cadres de sauvegarde à générer
  for i in 0..1
   if FileTest.exist?("Save#{i+1}.rxdata")
    number += 1
   end
  end
  @number = number
 
  @new_game_window = Window_Base.new(33, (16 + 48*@number), 216, 45)
  @new_game_window.contents = Bitmap.new(216, 48)
  set_window(@new_game_window)
  @new_game_window.contents.font.color = Color.new(160,160,168,255)
  @new_game_window.contents.draw_text(1,-16,216,48,"NOUVELLE PARTIE")
  @new_game_window.contents.draw_text(0,-15,216,48,"NOUVELLE PARTIE")
  @new_game_window.contents.draw_text(1,-15,216,48,"NOUVELLE PARTIE")
  @new_game_window.contents.font.color = Color.new(80,80,88,255)
  @new_game_window.contents.draw_text(0,-16,216,48,"NOUVELLE PARTIE")
 
  @save_game_window_list = []
  for i in 1.. @number
   window = Window_Base.new(33, 10 + (83-20)*(i-1), 216, 45)
   window.contents = Bitmap.new(548, 48)
   @save_game_window_list.push(window)
  end
 
  @index = 0
 
  @background = Plane.new(Viewport.new(136-123,33-20,256,192))
  @background.bitmap = RPG::Cache.picture("fondsaved.png")
  @background.z -= 10 
  @background2 = Sprite.new
  @background2.bitmap = RPG::Cache.title("Opening1.png")
  @background2.x = 13
  @background2.y = 227
  @background2.z = 1000
 
  refresh_all
  Graphics.transition
 
  loop do
   Graphics.update
   Input.update
   update
   if $scene != self
    break
   end
  end
 
  Graphics.freeze
 
  @new_game_window.dispose
  @background.dispose
  @background2.dispose
  for window in @save_game_window_list
   window.dispose
  end
 end
 
 def update 
  if Input.trigger?(Input::DOWN)
   $game_system.se_play($data_system.decision_se)
   @index += @index == @number ? 0 : 1
   if @erase and @index > 2
    @index = 2
   end
   refresh_all
  end
  if Input.trigger?(Input::UP)
   $game_system.se_play($data_system.decision_se)
   @index -= @index == 0 ? 0 : 1
   refresh_all
  end
 
  if Input.trigger?(Input::C)
   case @index
   when @number # Nouveau jeu
    if SAVEBOUNDSLOT and @number == 2
     $game_system.se_play($data_system.decision_se)
     @erase = true
     @index = 0
     @new_game_window.contents.clear
     @new_game_window.contents.font.color = Color.new(160,160,168,255)
     @new_game_window.contents.draw_text(1,-16,548,48,"RECOMMENCER QUELLE PARTIE?")
     @new_game_window.contents.draw_text(0,-15,548,48,"RECOMMENCER QUELLE PARTIE?")
     @new_game_window.contents.draw_text(1,-15,548,48,"RECOMMENCER QUELLE PARTIE?")
     @new_game_window.contents.font.color = Color.new(80,80,88,255)
     @new_game_window.contents.draw_text(0,-16,548,48,"RECOMMENCER QUELLE PARTIE?")
     refresh_all
    else     
     command_new_game
    end
   else # Chargement
    if @erase
     command_new_game
    else
     $game_temp = Game_Temp.new
     on_decision("Save#{@index + 1}.rxdata")
    end
   end
  end
  if Input.trigger?(Input::B) and @erase
   $game_system.se_play($data_system.cancel_se)
   @erase = false
   @index = 2
   @new_game_window.contents.clear
   @new_game_window.contents.font.color = Color.new(160,160,168,255)
   @new_game_window.contents.draw_text(1,-16,548,48,"NOUVELLE PARTIE")
   @new_game_window.contents.draw_text(0,-15,548,48,"NOUVELLE PARTIE")
   @new_game_window.contents.draw_text(1,-15,548,48,"NOUVELLE PARTIE")
   @new_game_window.contents.font.color = Color.new(80,80,88,255)
   @new_game_window.contents.draw_text(0,-16,548,48,"NOUVELLE PARTIE")
   refresh_all
  end
 
  if @auto_load != nil
   $game_temp = Game_Temp.new
   on_decision("SaveAuto.rxdata")
   File.delete("SaveAuto.rxdata")
  end
 end
 
 def refresh_all 
  for i in 0.. @number-1
   if i < @index
    @save_game_window_list[i].opacity = 128
    @save_game_window_list[i].y = 15 + 48*i
    @save_game_window_list[i].height = 48
    @save_game_window_list[i].contents = Bitmap.new(548, 48)
    set_window(@save_game_window_list[i])
    @save_game_window_list[i].contents.font.color = Color.new(160,160,168,255)
    @save_game_window_list[i].contents.draw_text(1,-16, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
    @save_game_window_list[i].contents.draw_text(0,-15, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
    @save_game_window_list[i].contents.draw_text(1,-15, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
    @save_game_window_list[i].contents.font.color = Color.new(80,80,88,255)
    @save_game_window_list[i].contents.draw_text(0,-16, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
   elsif i == @index
    @save_game_window_list[i].opacity = 255
    @save_game_window_list[i].y = 15 + 48*i
    @save_game_window_list[i].height = 97
    @save_game_window_list[i].contents = Bitmap.new(548, 131)
    set_window(@save_game_window_list[i])
    @save_game_window_list[i].contents.font.color = Color.new(160,160,168,255)
    @save_game_window_list[i].contents.draw_text(1,-16, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
    @save_game_window_list[i].contents.draw_text(0,-15, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
    @save_game_window_list[i].contents.draw_text(1,-15, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
    @save_game_window_list[i].contents.font.color = Color.new(80,80,88,255)
    @save_game_window_list[i].contents.draw_text(0,-16, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
    @filename = "Save#{i + 1}.rxdata"
    list = read_preview(@filename)
    data = list[0]
    time_sec = list[1]
    hour = (time_sec / 3600).to_s
    minute = "00"
    minute += ((time_sec%3600)/60).to_s
    minute = minute[minute.size-2, 2]
    time = hour + ":" + minute
    name = data[0].to_s
    id = data[1].to_i
    captured = data[2].to_s
    badge = 0.to_s
    #chargement des données
    file = File.open("Save#{i + 1}.rxdata", "r")
     read_save_data(file)
    file.close
    #Couleur de la police si votre heros est un garcon   
    @save_game_window_list[i].contents.font.color = Color.new(120, 184, 232, 255)
   
    @save_game_window_list[i].contents.draw_text(9+1, 0, 252, 48, "JOUEUR")
    @save_game_window_list[i].contents.draw_text(9+1, 0, 167, 48, name, 2)
    @save_game_window_list[i].contents.draw_text(9+1, 12, 252, 48, "DUREE DE JEU")
    @save_game_window_list[i].contents.draw_text(9+1, 12, 167, 48, time , 2)
    @save_game_window_list[i].contents.draw_text(9+1, 24, 252, 48, "BADGES")
    @save_game_window_list[i].contents.draw_text(9+1, 24, 167, 48, badge, 2)
    @save_game_window_list[i].contents.draw_text(9+1, 36, 252, 48, "POKéDEX")
    @save_game_window_list[i].contents.draw_text(9+1, 36, 167, 48, captured, 2)
   
    @save_game_window_list[i].contents.draw_text(9, 0+1, 252, 48, "JOUEUR")
    @save_game_window_list[i].contents.draw_text(9, 0+1, 167, 48, name, 2)
    @save_game_window_list[i].contents.draw_text(9, 12+1, 252, 48, "DUREE DE JEU")
    @save_game_window_list[i].contents.draw_text(9, 12+1, 167, 48, time , 2)
    @save_game_window_list[i].contents.draw_text(9, 24+1, 252, 48, "BADGES")
    @save_game_window_list[i].contents.draw_text(9, 24+1, 167, 48, badge, 2)
    @save_game_window_list[i].contents.draw_text(9, 36+1, 252, 48, "POKéDEX")
    @save_game_window_list[i].contents.draw_text(9, 36+1, 167, 48, captured, 2)
   
    @save_game_window_list[i].contents.draw_text(9+1, 0+1, 252, 48, "JOUEUR")
    @save_game_window_list[i].contents.draw_text(9+1, 0+1, 167, 48, name, 2)
    @save_game_window_list[i].contents.draw_text(9+1, 12+1, 252, 48, "DUREE DE JEU")
    @save_game_window_list[i].contents.draw_text(9+1, 12+1, 167, 48, time , 2)
    @save_game_window_list[i].contents.draw_text(9+1, 24+1, 252, 48, "BADGES")
    @save_game_window_list[i].contents.draw_text(9+1, 24+1, 167, 48, badge, 2)
    @save_game_window_list[i].contents.draw_text(9+1, 36+1, 252, 48, "POKéDEX")
    @save_game_window_list[i].contents.draw_text(9+1, 36+1, 167, 48, captured, 2)
   
    @save_game_window_list[i].contents.font.color = Color.new(0, 112, 248, 255)
    @save_game_window_list[i].contents.draw_text(9, 0, 252, 48, "JOUEUR")
    @save_game_window_list[i].contents.draw_text(9, 0, 167, 48, name, 2)
    @save_game_window_list[i].contents.draw_text(9, 12, 252, 48, "DUREE DE JEU")
    @save_game_window_list[i].contents.draw_text(9, 12, 167, 48, time , 2)
    @save_game_window_list[i].contents.draw_text(9, 24, 252, 48, "BADGES")
    @save_game_window_list[i].contents.draw_text(9, 24, 167, 48, badge, 2)
    @save_game_window_list[i].contents.draw_text(9, 36, 252, 48, "POKéDEX")
    @save_game_window_list[i].contents.draw_text(9, 36, 167, 48, captured, 2)
    # XX est a remplacer par le numero de l'intérupteur qui détermine si vous
    # avez choisi un Garcon ou une fille
    if $game_variables[11] == 2
     #Couleur de la police si votre heros est une fille
    @save_game_window_list[i].contents.font.color = Color.new(248, 168, 184, 255)
   
    @save_game_window_list[i].contents.draw_text(9+1, 0, 252, 48, "JOUEUR")
    @save_game_window_list[i].contents.draw_text(9+1, 0, 167, 48, name, 2)
    @save_game_window_list[i].contents.draw_text(9+1, 12, 252, 48, "DUREE DE JEU")
    @save_game_window_list[i].contents.draw_text(9+1, 12, 167, 48, time , 2)
    @save_game_window_list[i].contents.draw_text(9+1, 24, 252, 48, "BADGES")
    @save_game_window_list[i].contents.draw_text(9+1, 24, 167, 48, badge, 2)
    @save_game_window_list[i].contents.draw_text(9+1, 36, 252, 48, "POKéDEX")
    @save_game_window_list[i].contents.draw_text(9+1, 36, 167, 48, captured, 2)
   
    @save_game_window_list[i].contents.draw_text(9, 0+1, 252, 48, "JOUEUR")
    @save_game_window_list[i].contents.draw_text(9, 0+1, 167, 48, name, 2)
    @save_game_window_list[i].contents.draw_text(9, 12+1, 252, 48, "DUREE DE JEU")
    @save_game_window_list[i].contents.draw_text(9, 12+1, 167, 48, time , 2)
    @save_game_window_list[i].contents.draw_text(9, 24+1, 252, 48, "BADGES")
    @save_game_window_list[i].contents.draw_text(9, 24+1, 167, 48, badge, 2)
    @save_game_window_list[i].contents.draw_text(9, 36+1, 252, 48, "POKéDEX")
    @save_game_window_list[i].contents.draw_text(9, 36+1, 167, 48, captured, 2)
   
    @save_game_window_list[i].contents.draw_text(9+1, 0+1, 252, 48, "JOUEUR")
    @save_game_window_list[i].contents.draw_text(9+1, 0+1, 167, 48, name, 2)
    @save_game_window_list[i].contents.draw_text(9+1, 12+1, 252, 48, "DUREE DE JEU")
    @save_game_window_list[i].contents.draw_text(9+1, 12+1, 167, 48, time , 2)
    @save_game_window_list[i].contents.draw_text(9+1, 24+1, 252, 48, "BADGES")
    @save_game_window_list[i].contents.draw_text(9+1, 24+1, 167, 48, badge, 2)
    @save_game_window_list[i].contents.draw_text(9+1, 36+1, 252, 48, "POKéDEX")
    @save_game_window_list[i].contents.draw_text(9+1, 36+1, 167, 48, captured, 2)
   
    @save_game_window_list[i].contents.font.color = Color.new(232, 32, 16, 255)
    @save_game_window_list[i].contents.draw_text(9, 0, 252, 48, "JOUEUR")
    @save_game_window_list[i].contents.draw_text(9, 0, 167, 48, name, 2)
    @save_game_window_list[i].contents.draw_text(9, 12, 252, 48, "DUREE DE JEU")
    @save_game_window_list[i].contents.draw_text(9, 12, 167, 48, time , 2)
    @save_game_window_list[i].contents.draw_text(9, 24, 252, 48, "BADGES")
    @save_game_window_list[i].contents.draw_text(9, 24, 167, 48, badge, 2)
    @save_game_window_list[i].contents.draw_text(9, 36, 252, 48, "POKéDEX")
    @save_game_window_list[i].contents.draw_text(9, 36, 167, 48, captured, 2)
    end
   elsif i > @index
    @save_game_window_list[i].opacity = 128
    @save_game_window_list[i].y = 15 + 48*i + 48
    @save_game_window_list[i].height = 48
    @save_game_window_list[i].contents = Bitmap.new(548, 48)
    set_window(@save_game_window_list[i])
    @save_game_window_list[i].contents.font.color = Color.new(160,160,168,255)
    @save_game_window_list[i].contents.draw_text(1,-16, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
    @save_game_window_list[i].contents.draw_text(0,-15, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
    @save_game_window_list[i].contents.draw_text(1,-15, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
    @save_game_window_list[i].contents.font.color = Color.new(80,80,88,255)
    @save_game_window_list[i].contents.draw_text(0,-16, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
   end
  end
  if @index == @number
   @new_game_window.opacity = 255
   @new_game_window.y = 15 + 48*@number
  else
   @new_game_window.opacity = 128
   @new_game_window.y = 15 + 48*(@number+1)
  end
 end
 
 def set_window(window)
  window.contents.font.name = $fontface
  window.contents.font.size = $fontsizebig
  window.contents.font.color = window.normal_color
 end
 
 # --------------------------------------------------------
 # Chargement
 # --------------------------------------------------------
 def read_preview(filename)
  file = File.open(filename, "r")
  time_stamp   = file.mtime
  characters   = Marshal.load(file)
  frame_count  = Marshal.load(file)
  game_system  = Marshal.load(file)
  game_switches = Marshal.load(file)
  game_variables = Marshal.load(file)
  total_sec = frame_count / Graphics.frame_rate
 
  # Non utilisé
  game_self_switches = Marshal.load(file)
  game_screen  = Marshal.load(file)
  game_actors  = Marshal.load(file)
  game_party   = Marshal.load(file)
  game_troop   = Marshal.load(file)
  game_map    = Marshal.load(file)
  game_player  = Marshal.load(file)
  # ------------
  read_data   = Marshal.load(file)
  file.close
  return [read_data, total_sec]
 end
 
 def read_save_data(file)
  characters = Marshal.load(file)
  Graphics.frame_count = Marshal.load(file)
  $game_system    = Marshal.load(file)
  $game_switches   = Marshal.load(file)
  $game_variables  = Marshal.load(file)
  $game_self_switches = Marshal.load(file)
  $game_screen    = Marshal.load(file)
  $game_actors    = Marshal.load(file)
  $game_party    = Marshal.load(file)
  $game_troop    = Marshal.load(file)
  $game_map     = Marshal.load(file)
  $game_player    = Marshal.load(file)
  $read_data     = Marshal.load(file) 
  if SAVE_CONVERT # Conversion des sauvegardes pre-v0.7 à v0.7+
   Player.set_trainer_code(Marshal.load(file)) # Variable trainer_code
   trainer_id            = Marshal.load(file) # Variable
   $game_party.actors[0].name    = Marshal.load(file) # Game_Actor
   $game_party.actors[0].set_graphic($game_party.actors[0].character_name,
                    $game_party.actors[0].character_hue,
                    Marshal.load(file),
                    $game_party.actors[0].battler_hue
                   )# Game_Actor
  end
  $pokemon_party   = Marshal.load(file)
  $random_encounter = Marshal.load(file)
  $data_pokedex   = Marshal.load(file)
  $data_storage   = Marshal.load(file)
  $battle_var    = Marshal.load(file)
  $existing_pokemon = Marshal.load(file)
  $string      = Marshal.load(file)
  $SPEED_MSG     = Marshal.load(file)
  $color_menu    = Marshal.load(file)
  $NB_MSG      = Marshal.load(file)
  $MSG        = Marshal.load(file)
  $voir_anim     = Marshal.load(file)
  $choix_battle   = Marshal.load(file)
  $map_link = ($read_data != nil and $read_data[3] != nil) ? $read_data[3] : {}
  if $game_system.magic_number != $data_system.magic_number
   $game_map.setup($game_map.map_id)
   $game_player.center($game_player.x, $game_player.y)
  end
  $game_party.refresh
  POKEMON_S::set_SAVESLOT = @index
  Player.trainer_trade_code
 end
 
 def on_decision(filename)
  unless FileTest.exist?(filename)
   $game_system.se_play($data_system.buzzer_se)
   return
  end
  $game_system.se_play($data_system.load_se)
  file = File.open(filename, "rb")
  read_save_data(file)
  file.close 
  $game_system.bgm_play($game_system.playing_bgm)
  $game_system.bgs_play($game_system.playing_bgs)
  $game_map.update
  $scene = Scene_Map.new 
  $scene.update_encounter
  Player.pokedex_update
 end
 
 alias alias_command_new_game command_new_game
 def command_new_game 
  $map_link = {}
  alias_command_new_game
  #-----------------------------------------------------
  # Variables créées automatiquement au début du jeu
  # Elles sont absolument nécessaires
  #-----------------------------------------------------
  $pokemon_party = POKEMON_S::Pokemon_Party.new
  $data_storage = [[0]]
  $pokemon_party.create_box
  Player.set_trainer_code(rand(2**32))
  $random_encounter = Array.new(7)
  $random_encounter[0] = 0
  $battle_var = POKEMON_S::Pokemon_Battle_Variable.new
  $existing_pokemon = []
  $string = []   
  POKEMON_S::set_SAVESLOT = @index
  Player.trainer_trade_code
  $data_pokedex = Array.new($data_pokemon.length-1)
  $data_pokedex[0] = false # Possède ou non
  for i in 1..$data_pokemon.length-1
   $data_pokedex[i] = [false, false] # Vu, Capturé   
  end   
  $game_switches[15] = true # Système Jour/Nuit
  #-----------------------------------------------------
  # Valeurs par défaut
  #----------------------------------------------------- 
  $SPEED_MSG = POKEMON_S::SPEED_MSG # Vitesse message
  $color_menu = POKEMON_S::COLOR_MENU # Couleur d'image du Menu Echap
  $NB_MSG = POKEMON_S::NB_MSG    # Numéro de la fenêtre de dialogue
  $MSG = POKEMON_S::MSG       # Nom complet de la fenêtre de dialogue
  $voir_anim = true         # Animations d'attaques
  $choix_battle = true        # Changement de Pokémon en combat
 end
end

Posté par Sphinx le 6 Juin - 18:57 (2011)
son erreur cible la première ligne qui suit le =end... Cette ligne ne contient pas de elsif, Yuri. Je suis peut être têtu, et effectivement il aura peut être une autre erreur sur la ligne que tu indiques... Mais les SyntaxError doivent se régler dans l'ordre Clin d'œil foireux

Posté par Nuri Yuri le 6 Juin - 19:00 (2011)
Certes mais si le =end était le problème c'est la ligne du =end qui aurais été visée et si y avais des espaces le compilateur aurais dit ça :
embedded document meets end of file.
Si il y avais pas le =begin avant ça aurais fait ça :
syntax error, unexpected '=', expecting $end #ligne visée

Posté par Pαlвσlѕку le 6 Juin - 19:12 (2011)
Yuri a corrigé le bug mais en fait il était tout simple.

Il y avait un end en trop. Voici le morceau du script très simplifié :

Code:
if truc
end # le problème corrigé par Yuri
=begin
commentaire
=end
elsif pouet
end

Posté par Odjavel le 6 Juin - 19:37 (2011)
J'ai mis ton script youri, je suis chiant mais il y a une syntax erreur à la ligne 24 Imbécile heureux

Posté par Nuri Yuri le 6 Juin - 19:47 (2011)
Heu ..., J'ai pas changé la ligne 24 ...
Moi je t'envois le fichier d'origine, normalement y'a pas d'erreur à cette ligne avec le fichier.
http://www.sendspace.com/file/3ux663

(le problème viens surement du fait que tu utilise google chrome, cette merde sans nom met des caractères illicites dans les versions texte)

Posté par Odjavel le 6 Juin - 19:56 (2011)
En effet, le problème venait de google chrome. Passé sous firefox j'ai copié-collé ton code et ça marche impecc !
Je met le sujet résolu, avec un grand merci à Yuri ! :D