Sujet n°1974
Posté par Suicune31 le 18 Oct - 03:22 (2008)
Titre : BUG pokemon_custom - ok
BUG Ligne 250 lorsque j'ajoute ceci dans POKEMON CUSTOM :


 
Code:
     # -----------------------------------------------------------------
    #  Zarbi à l'état sauvage
    # -----------------------------------------------------------------
    alias temp_initialize initialize
    def initialize(id_data = 1, level = 1, shiny = false)
      temp_initialize(id_data, level, shiny)             <--- LIGNE 250
      if name == "ZARBI"
        @form = rand(28) + 1
      end
    end  
    
    # -----------------------------------------------------------------
    #  Objet tenu, changement de forme
    # -----------------------------------------------------------------
    def item_hold=(item_id)
      @item_hold = item_id
      if name == "DEOXYS"
        @form = 5 if item_id == 1
        @form = 0 if item_id != 1
      end
    end

Rapport de LOG.txt


 
Code:
 ---------- Erreur de script : Pokemon_Custom ----------
----- Type
ArgumentError

----- Message
wrong number of arguments(3 for 0)

----- Position dans Pokemon_Custom
Ligne 250

----- Backtrace
Script : Pokemon_Custom | Ligne : 250 | Méthode : in `temp_initialize'
Script : Pokemon_Custom | Ligne : 250 | Méthode : in `initialize'
Script : Main | Ligne : 49 | Méthode : in `new'
Script : Main | Ligne : 49



Posté par Krosk le 18 Oct - 15:37 (2008)
Citation:
lorsque j'ajoute ceci

qu'est-ce que tu a ajouté?

Posté par Suicune31 le 19 Oct - 14:02 (2008)
Désolé j'en ai trop mis Lordork chez mémé

J'ai ajouté ça ^^


 
Code:
      # ----------------------------------------------------------------- 
    #  Zarbi à l'état sauvage 
    # ----------------------------------------------------------------- 
    alias temp_initialize initialize 
    def initialize(id_data = 1, level = 1, shiny = false) 
      temp_initialize(id_data, level, shiny)             <--- LIGNE 250
      if name == "ZARBI" 
        @form = rand(28) + 1 
      end 
    end   

Posté par Newtiteuf le 22 Oct - 18:30 (2008)
Essai de remplacer False par 0 (je ne suis sur de rien du tout !)

Posté par Krosk le 22 Oct - 18:37 (2008)
dis moi, ton bug tu la au démarrage du jeu? tu peux me poster ton script entier de Pokemon_Custom? Je sens comme une modification foireuse des scripts.

Posté par Suicune31 le 22 Oct - 18:54 (2008)
 Voici le script : Pokemon_Custom Bouche extensiblek:


Spoiler
 
Code:
  #==============================================================================
# ■ Pokemon_Custom
# Pokemon Script Project - Krosk 
# 05/09/08
#-----------------------------------------------------------------------------
# Méthodes spéciales pour Pokémons et capacités spécifiques
#-----------------------------------------------------------------------------
# Ce script sert à placer les modifications de méthodes propres à certains 
# Pokémons ou capacités spéciales, pour éviter de modifier les scripts clés
#-----------------------------------------------------------------------------
# La méthode à suivre doit être comprise avant d'essayer d'ajouter des règles...
#-----------------------------------------------------------------------------


module POKEMON_S
  class Pokemon
    
    # -----------------------------------------------------------------
    #  Stat spéciale Munja
    # -----------------------------------------------------------------
    alias temp_maxhp_basis maxhp_basis
    def maxhp_basis
      if name == "MUNJA"
        return 1
      end
      temp_maxhp_basis
    end
    
    # -----------------------------------------------------------------
    #  Stat spéciale Deoxys
    # -----------------------------------------------------------------
    # 1 : Attaque
    # 2 : Defense
    # 3 : Normal
    # 4 : Vitesse
    alias temp_base_atk base_atk
    def base_atk
      if name == "DEOXYS"
        return 180 if form == 1
        return 70 if form == 2
        return 95 if form == 4
      end
      temp_base_atk
    end
    
    alias temp_base_dfe base_dfe
    def base_dfe
      if name == "DEOXYS"
        return 20 if form == 1
        return 160 if form == 2
        return 90 if form == 4
      end
      temp_base_dfe
    end
    
    alias temp_base_spd base_spd
    def base_spd
      if name == "DEOXYS"
        return 150 if form == 1
        return 90 if form == 2
        return 180 if form == 4
      end
      temp_base_spd
    end
    
    alias temp_base_ats base_ats
    def base_ats
      if name == "DEOXYS"
        return 180 if form == 1
        return 70 if form == 2
        return 95 if form == 4
      end
      temp_base_ats
    end
    
    alias temp_base_dfs base_dfs
    def base_dfs
      if name == "DEOXYS"
        return 20 if form == 1
        return 160 if form == 2
        return 90 if form == 4
      end
      temp_base_dfs
    end
    
    # -----------------------------------------------------------------
    #  Effect
    # -----------------------------------------------------------------
    #  La suite n'est à modifier que si vous savez ce que vous faites
    # -----------------------------------------------------------------
    alias temp_skill_effect_reset skill_effect_reset
    def skill_effect_reset
      # Transform / Morphing cleaning
      if effect_list.include?(0x39)
        index = effect_list.index(0x39)
        transform_effect(@effect[index][2], true)
        @effect.delete_at(index)
      end
      # Copie / Mimic cleaning
      if effect_list.include?(0x52)
        index = effect_list.index(0x52)
        skill_index = @skills_set.index(@effect[index][2][1])
        @skills_set[skill_index] = @effect[index][2][0]
        @effect.delete(effect)
      end
      temp_skill_effect_reset
    end
    
    # --------- ----------
    # Morphing / Transform
    # --------- ----------
    def transform_effect(target, recover = false)
      @type1 = target.type1
      @type2 = target.type2
      @atk = target.atk
      @dfe = target.dfe
      @ats = target.ats
      @dfs = target.dfs
      @spd = target.spd
      @base_atk = target.base_atk
      @base_ats = target.base_ats
      @base_dfe = target.base_dfe
      @base_dfs = target.base_dfs
      @base_spd = target.base_spd
      @dv_atk = target.dv_atk
      @dv_ats = target.dv_ats
      @dv_dfe = target.dv_dfe
      @dv_dfs = target.dv_dfs
      @dv_spd = target.dv_spd
      @battle_stage = target.battle_stage
      @atk_plus = target.atk_plus
      @dfe_plus = target.dfe_plus
      @ats_plus = target.ats_plus
      @dfs_plus = target.dfs_plus
      @spd_plus = target.spd_plus
      @ability = target.ability
      @battler_id = target.id
      if recover
        @skills_set = target.skills_set
      end
      statistic_refresh
    end
    
    # -----------------------------------------------------------------
    #  Capacités spéciales
    # -----------------------------------------------------------------
    #  La suite n'est à modifier que si vous savez ce que vous faites
    # -----------------------------------------------------------------
    
    alias temp_change_stat change_stat
    def change_stat(stat_id, amount = 0)
      # Corps sain / Clear Body (ab) // Mist / Brume
      if amount < 0 and (effect_list.include?(0x2E) or @ability == 29) 
        return 0
      end
      # Regard Vif / Keen Eye (ab)
      if amount < 0 and stat_id == 6 and @ability == 51
        return 0
      end
      # Hyper Cutter (ab)
      if amount < 0 and stat_id == 0 and @ability == 52
        return 0
      end
      temp_change_stat(stat_id, amount)
    end
    
    alias temp_spd_modifier spd_modifier
    def spd_modifier
      n = 1
      # Swift Swim / Glissade (ab)
      if @ability == 33 and $battle_var.rain?
        n *= 2
      end
      # Chlorophyle (ab)
      if @ability == 34 and $battle_var.sunny?
        n *= 2
      end
      return n*temp_spd_modifier
    end
    
    alias temp_sleep_check sleep_check
    def sleep_check
      if @ability == 48 # Matinal / Early Bird (ab)
        @status_count -= 1
      end
      temp_sleep_check
    end
    
    # -----------------------------------------------------------------
    #  Pension et Oeufs
    # -----------------------------------------------------------------
    #  La suite n'est à modifier que si vous savez ce que vous faites
    # -----------------------------------------------------------------
    
    def breeding_custom_rules(baby, father, mother)
      baby_id = baby
      # Base mère = Metamorph
      if Pokemon_Info.name(baby_id) == "METAMORPH"
        baby_id = base_id(father.id)
      end
      # Base mère = Nidoran femelle
      if Pokemon_Info.name(baby_id) == "NIDORAN♀"
        baby_id = Pokemon_Info.id(["NIDORAN♀", "NIDORAN♂"][rand(2)])
      end
      # Base mère = Lumivole
      if Pokemon_Info.name(baby_id) == "LUMIVOLE"
        baby_id = Pokemon_Info.id(["LUMIVOLE", "MUCIOLE"][rand(2)])
      end
      # Base mère = Manaphy
      if Pokemon_Info.name(baby_id) == "MANAPHY"
        baby_id = Pokemon_Info.id("PHIONE")
      end
      # Base mère = Oke oke avec Encens doux
      if Pokemon_Info.name(baby_id) == "OKEOKE"
        if Item.name(mother.item_hold) == "ENCENS DOUX" and 
            Pokemon_Info.id(base_id(mother.id)) == "OKEOKE"
        
        elsif Item.name(father.item_hold) == "ENCENS DOUX" and
            Pokemon_Info.id(base_id(mother.id)) == "OKEOKE"
            
        else
          baby_id = Pokemon_Info.id("QULBUTOKE")
        end
      end
      # Base mère = Azurill avec Encens mer
      if Pokemon_Info.name(baby_id) == "AZURILL"
        if Item.name(mother.item_hold) == "ENCENS MER" and 
            Pokemon_Info.id(base_id(mother.id)) == "AZURILL"
          
        elsif Item.name(father.item_hold) == "ENCENS MER" and 
            Pokemon_Info.id(base_id(father.id)) == "AZURILL"
          
        else
          baby_id = Pokemon_Info.id("MARILL")
        end
      end
      return baby_id
    end
    
    
    
  end
  end


    # -----------------------------------------------------------------
    #  Objet tenu, changement de forme
    # -----------------------------------------------------------------
    def item_hold=(item_id)
      @item_hold = item_id
      if name == "DEOXYS"
        @form = 5 if item_id == 1
        @form = 0 if item_id != 1
      end
    end
    
          # ----------------------------------------------------------------- 
    #  Zarbi à l'état sauvage 
    # ----------------------------------------------------------------- 
    alias temp_initialize initialize 
    def initialize(id_data = 1, level = 1, shiny = false) 
      temp_initialize(id_data, level, shiny)             <--- LIGNE 250
      if name == "ZARBI" 
        @form = rand(28) + 1 
      end 
    end   


Posté par Krosk le 22 Oct - 20:16 (2008)
je pige.

Au lieu de les coller tout à la fin, colle les avant les 2 end de la fin.
Citation:
end
end


ca devrait etre bon