Sujet n°9081
Posté par Minart le 30 Jan - 19:47 (2011)
Titre : Bug Scene_title + Pokemon_Evolve* résoudre s'il vous plait.
Bonsoir,


J'ai eu un bug quand je voulais reprendre ma partie d'avant, et =/ sa bug.


J'ai plusieurs screen a vous montrez !


Merci d'avance, s'il vous plait.


= 1er 
= 2ème 
= 3ème 
= 4ème 


Re merci d'avance, je vous en prie l'équipe !

Posté par Nuri Yuri le 30 Jan - 19:58 (2011)
Supprime la partie.
C'est une sauvegarde non-à jour.

Posté par Minart le 30 Jan - 20:16 (2011)
D'accord je vais essayé, merci a toi !

Posté par IamTheAdic le 31 Jan - 15:47 (2011)
Juste, as-tu me le NM7 dans ton projet ?

Posté par Zoroark9999 le 31 Jan - 15:59 (2011)
J'ai eu assez récemment ce bug, il peut s'agir d'un problème provenant de


Code:
forcer_sauvegarde


Si c'est cela, remplace la commande ci-dessus par<> Ouvrir le menu de sauvegarde

Si ça marche, remplace TOUTES les commandes forcer_sauvegarde par
<> Ouvrir le menu de sauvegarde

Sinon, comme le dit Youri, supprime la sauvegarde.

Posté par Minart le 31 Jan - 18:47 (2011)
IamTheAdic a écrit:
Juste, as-tu me le NM7 dans ton projet ?













Non, je l'utilise pas. J'ai un nouveau problème ! Avec Pokemon_Evolve*, je poste encore un post ou je poste la dans se sujet ?


Je me lance =/


Quand mon pokemon monte d'un niveau, et, c'est a ce niveau qu'il évolue alors sa bug *-*


J'ai des screen !


= 1er 
=2ème 

Merci de m'aider ! S'il vous plait.
= Script 


#==============================================================================
# ■ Pokemon_Evolve
# Pokemon Script Project - Krosk 
# 01/08/07
# 27/08/08 - révision pour les oeufs
#-----------------------------------------------------------------------------
# Scène à ne pas modifier de préférence
#-----------------------------------------------------------------------------
# Scène appelée en cas de evolve
#-----------------------------------------------------------------------------


module POKEMON_S
  class Pokemon_Evolve
    def initialize(pokemon, evolve_id, z_level = 400, forcing = false)
      Graphics.freeze
      @z_level = z_level
      @forcing = forcing
      @cancel = false
      @pokemon = pokemon
      
      cry_pokemon(@pokemon.id)     
      $game_temp.map_bgm = $game_system.playing_bgm       
      Audio.bgm_play("Audio/BGM/PkmRS-Evolving.mid")
      
      @evolve_id = evolve_id
      @background = Sprite.new 
      @background.x = 13
      @background.y = 13
      @background.bitmap = RPG::Cache.battleback("HatchBack.png")     
      
      @background.z = @z_level
      @background.color = Color.new(0, 0, 0, 0)      
     
      @text_window = Window_Base.new(0, 132, 250, 400)
      @text_window.opacity = 0
      @text_window.z = @z_level + 2
      @text_window.contents = Bitmap.new(608, 412)
      @text_window.contents.font.name = "Pokemon Emerald"
      @text_window.contents.font.size = $fontsize
      
      @message_background = Sprite.new
      @message_background.x = 15
      @message_background.y = 158
      @message_background.z = @z_level + 1
      @message_background.bitmap = RPG::Cache.picture($MSG)
      
      @pokemon_sprite = Sprite.new
      @pokemon_sprite.bitmap = RPG::Cache.battler(@pokemon.battler_face, 0)
      @pokemon_sprite.ox = @pokemon_sprite.bitmap.width / 2
      @pokemon_sprite.oy = @pokemon_sprite.bitmap.height / 2
      @pokemon_sprite.x = 140
      @pokemon_sprite.y = 95
      @pokemon_sprite.z = @z_level + 5
      @pokemon_sprite.color = Color.new(255,255,255,0)
      #@pokemon_sprite.zoom_x = 0.5
      #@pokemon_sprite.zoom_y = 0.5
      
      if @pokemon.egg
        @egg_sprite = Sprite.new
        @egg_sprite.bitmap = RPG::Cache.battler("BreakEgg0", 0)
        @egg_sprite.ox = @egg_sprite.bitmap.width / 2
        @egg_sprite.oy = @egg_sprite.bitmap.height / 2
        @egg_sprite.x = 140
        @egg_sprite.y = 95
        @egg_sprite.z = @z_level + 10
        @egg_sprite.visible = false
        @egg_sprite.zoom_x = 0.5
        @egg_sprite.zoom_y = 0.5
      end
      
      @evolved_sprite = Sprite.new
      @evolved_sprite.x = 140
      @evolved_sprite.y = 95
      @evolved_sprite.bitmap = RPG::Cache.battler(evolved_sprite_generation, 0)
      @evolved_sprite.ox = @evolved_sprite.bitmap.width / 2
      @evolved_sprite.oy = @evolved_sprite.bitmap.height / 2
      @evolved_sprite.z = @z_level + 6
      @evolved_sprite.zoom_x = 0
      @evolved_sprite.zoom_y = 0
      @evolved_sprite.color = Color.new(255,255,255,255)      
      Graphics.transition(20)
    end
    
    
    def main
      if not @pokemon.egg
        draw_text("Quoi ?", @pokemon.given_name + " évolue !")
        wait(40)
      
        # Blanchissement
        until @pokemon_sprite.color.alpha >= 255
          @pokemon_sprite.color.alpha += 20
          @background.color.alpha += 10
          Graphics.update
        end
        
        # Oscillement
        t = 0
        loop do
          t += 1
          if t > 100
            t +=1
          end
          if t > 250
            t += 1
          end
          if t > 450
            t += 1
          end
          pi = 3.14159265
          @pokemon_sprite.zoom_x = (Math.cos(t*2*pi/50)+1)/2
          @pokemon_sprite.zoom_y = (Math.cos(t*2*pi/50)+1)/2
          @evolved_sprite.zoom_x = (Math.cos(t*2*pi/50+pi)+1)/2
          @evolved_sprite.zoom_y = (Math.cos(t*2*pi/50+pi)+1)/2
          Input.update
          Graphics.update
          if t >= 650
            break
          end
          if Input.trigger?(Input::B) and not @forcing
            @cancel = true
            break
          end
        end
      else        
        wait(40)
        t = 0
        loop do
          t += 1
          if ( t >= 0 and t < 20 ) or ( t >= 60 and t < 80) or
            ( t >= 130 and t < 170 ) or ( t >= 220 and t < 260 )
            @pokemon_sprite.x += 3 * (2*(t%2) - 1)
            @egg_sprite.x += 3 * (2*(t%2) - 1)
          end
          Graphics.update
          if t == 20
            @egg_sprite.visible = true
            @egg_sprite.bitmap = RPG::Cache.battler("BreakEgg0", 0)
            @egg_sprite.update
          end
          if t == 80
            @egg_sprite.bitmap = RPG::Cache.battler("BreakEgg1", 0)
            @egg_sprite.update
          end
          if t == 170
            @egg_sprite.visible = true
            @egg_sprite.bitmap = RPG::Cache.battler("BreakEgg2", 0)
            @egg_sprite.update
          end
          if t > 260
            @evolved_sprite.zoom_x = 0.3
            @evolved_sprite.zoom_y = 0.3
            @egg_sprite.color = Color.new(255,255,255,0)
            break
          end
        end
      end
      
      if @cancel and not @forcing
        until @pokemon_sprite.zoom_x >= 1
          @evolved_sprite.zoom_x -= 0.1
          @evolved_sprite.zoom_y -= 0.1
          @pokemon_sprite.zoom_x += 0.1
          @pokemon_sprite.zoom_y += 0.1
          Graphics.update
        end
        @pokemon_sprite.zoom_y = 1
        @pokemon_sprite.zoom_x = 1
        @evolved_sprite.zoom_x = 0
        @evolved_sprite.zoom_y = 0
        Graphics.update
        until @pokemon_sprite.color.alpha <= 0
          @pokemon_sprite.color.alpha -= 20
          @background.color.alpha -= 10
          Graphics.update
        end
        Graphics.update
        draw_text("Que... ! "+@pokemon.given_name, "n'a pas évolué !")
        wait(40)
        wait_hit
        draw_text("", "")
      else
        # Rétablissement
        until @evolved_sprite.zoom_x >= 1
          @evolved_sprite.zoom_x += 0.1
          @evolved_sprite.zoom_y += 0.1
          @pokemon_sprite.zoom_x -= 0.1
          @pokemon_sprite.zoom_y -= 0.1
          if @pokemon.egg
            @evolved_sprite.zoom_x += 0.1
            @evolved_sprite.zoom_y += 0.1
            @pokemon_sprite.zoom_x += 0.40
            @pokemon_sprite.zoom_y += 0.40
            @pokemon_sprite.color.alpha += 40
            @pokemon_sprite.opacity -= 40
            @egg_sprite.zoom_x += 0.15
            @egg_sprite.zoom_y += 0.15
            @egg_sprite.opacity -= 40
            @egg_sprite.color.alpha += 40
          end
          Graphics.update
        end
        
        @evolved_sprite.zoom_x = 1
        @evolved_sprite.zoom_y = 1
        @pokemon_sprite.zoom_x = 0
        @pokemon_sprite.zoom_y = 0
        Graphics.update
        
        # Colorisation
        until @evolved_sprite.color.alpha == 0
          @evolved_sprite.color.alpha -= 20
          @background.color.alpha -= 10
          Graphics.update
        end
        
        loop do
          if @pokemon_sprite.color.alpha == 255 and @pokemon_sprite.zoom_x > 0
            @pokemon_sprite.zoom_x -= 0.1
            @pokemon_sprite.zoom_y -= 0.1
            @evolved_sprite.zoom_x += 0.1
            @evolved_sprite.zoom_y += 0.1
          end
          if @evolved_sprite.zoom_x >= 1
            @evolved_sprite.color.alpha -= 20
            @background.color.alpha -= 10
          end
          Graphics.update
          if @evolved_sprite.color.alpha == 0
            break
          end
        end        
        cry_pokemon(@evolve_id)
        wait(20)
        Audio.me_play("Audio/ME/PkmRS-Caught.mid")
        if not @pokemon.egg
          draw_text("Félicitations ! "+@pokemon.given_name, 
          "a évolué en "+Pokemon_Info.name(@evolve_id)+" !")
        else
          draw_text(Pokemon_Info.name(@evolve_id),"vient de sortir de l'OEUF !")
          end
        wait(40)
        wait_hit
        draw_text("", "")
        if @forcing
          @pokemon.evolve(@evolve_id)
        else
          @pokemon.evolve
        end
        $data_pokedex[@pokemon.id] = [ true, true ]
      end
      
      Graphics.freeze
      $game_system.bgm_play($game_temp.map_bgm)
      Audio.me_stop
      @text_window.dispose
      @message_background.dispose
      @background.dispose
      @pokemon_sprite.dispose
      @evolved_sprite.dispose
      if @pokemon.egg
        @egg_sprite.dispose
      end
      @text_window = nil
    end
    
    def evolved_sprite_generation
      ida = sprintf("%03d", @evolve_id)
      if @pokemon.gender == 1 or @pokemon.gender == 0
        string = "Front_Male/" + ida + ".png"
      elsif @pokemon.gender == 2
        string = "Front_Female/" + ida + ".png"
        #if not(FileTest.exist?("Graphics/Battlers/" + string))
        if not($picture_data["Graphics/Battlers/" + string])
          string = "Front_Male/" + ida + ".png"
        end
      end
      
      if @pokemon.shiny
        string2 = "Shiny_" + string
        #if FileTest.exist?("Graphics/Battlers/" + string2)
        if $picture_data["Graphics/Battlers/" + string2]
          string = string2
        end
      end
      
      return string
    end
    
    def draw_text(line1 = "", line2 = "")
      Graphics.freeze
      @text_window.contents.clear
      @text_window.draw_text(13, 8, 212, 32, line1)
      @text_window.draw_text(13, 24, 212, 32, line2)     
      Graphics.transition(5)
    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 
  
    def wait_hit
      loop do
        Graphics.update
        Input.update
        if Input.trigger?(Input::C)
          $game_system.se_play($data_system.decision_se)
          break
        end
      end
    end
      
    def wait(frame)
      i = 0
      loop do
        i += 1
        Graphics.update
        if i >= frame
          break
        end
      end
    end
  end
end