Sujet n°11919
Posté par MrWolfplayer97 le 19 Aoû - 13:14 (2012)
Titre : Bug Script pokédex[ Résolu ]
Bonjour (oui je sais je suis chiant) alors voilà je fais comme il est dit dans le manuel pour activer le pokédex, mais IG quand je vais sur pokédex un message d'erreur apparait et voici ce qu'il y a dans les logs:

Code:
---------- Erreur de script : Pokemon_Pokedex ----------
----- Type
NoMethodError

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

----- Position dans Pokemon_Pokedex
Ligne 676

----- Backtrace
Script : Pokemon_Pokedex | Ligne : 676 | Méthode : in `initialize'
Script : Pokemon_Pokedex | Ligne : 52 | Méthode : in `new'
Script : Pokemon_Pokedex | Ligne : 52 | Méthode : in `main'
Script : Main | Ligne : 49


Et la c'est la ligne ou il y à le premier bug (la 676):

Code:
@last = id_list[-1]


Le deuxième et troisième(52):

Code:
@pokemon_list = POKEMON_S::Pokemon_List.new(@table, @list, @index, @show)


et le 4ème (49):

Code:
$game_variables[5000]["pokedex"]["vus"] += 1 if $data_pokedex[i][0]


Voila que dois-je faire ?
Merci d'avance

Posté par MrWolfplayer97 le 21 Aoû - 18:43 (2012)
Up, vous ne savez pas ce que je dois faire ?

Posté par Silver le 21 Aoû - 18:58 (2012)
Merci de ne pas faire de Up, les double-post sont à éviter, tu peux supprimer le topic et le reposter, et si personne ne te réponds, personne n'a la solution.

Posté par Nuri Yuri le 21 Aoû - 19:03 (2012)
T'as ajouté un pokémon avant ou pas ?

Posté par MrWolfplayer97 le 25 Aoû - 17:01 (2012)
@Silver : Ok je ne le referait plus. Je pensait qu'apres 24H c'était bon.

@Nyuky : Ah non je vait voir si sa marche

EDIT: ça ne marche toujours pas...

Posté par Gemini le 25 Aoû - 18:03 (2012)
Fais une copie de ton projet (par précaution) puis essaye de remplacer ton pokemon_pokedex par celui-ci :

Pokemon_pokedex
#==============================================================================
# ¦ Pokemon_Pokedex
# Pokemon Script Project - Krosk
# 18/07/07
# 07/09/08 - révision v0.7, Pokédex de Shaolan (PSP4G) simplifié et optimisé
# (crédits : Shaolan, Slash)
# 03/01/09 - révision
#-----------------------------------------------------------------------------
# Scène modifiable
#-----------------------------------------------------------------------------
# Pokédex
#-----------------------------------------------------------------------------

module POKEMON_S
class Pokemon_Pokedex #(Numérique)
def initialize(index = 0, show = true)
@index = index
@show = show
@table = []
# Regional
if POKEMON_S._DEXREG
for id in 1..$data_pokedex.length-1
@table[Pokemon_Info.id_bis(id)] = id
end
@table.shift # débarasser l'élément 0
@table.compact!
else
# National
for id in 1..$data_pokedex.length-1
@table.push(id)
end
end
end

def main
# Fenêtre principale
# Fond
@background = Sprite.new
@background.bitmap = RPG::Cache.picture("PokedexSh.png")
@background.z = 5
@backbackground = Sprite.new
@backbackground.bitmap = RPG::Cache.picture("PokedexShback.png")
@backbackground.z = 0

# Liste
@list = []
$game_variables[5000]["pokedex"]["vus"] = 0
$game_variables[5000]["pokedex"]["captures"] = 0
for i in 1... @table.length
if $data_pokedex[@table[i]][0]
$game_variables[5000]["pokedex"]["vus"] += 1
@list.push(@table[i]) # liste des ID vus
end

$game_variables[5000]["pokedex"]["captures"] += 1 if $data_pokedex[i][1]
end
@pokemon_list = POKEMON_S::Pokemon_List.new(@table, @list, @index, @show)
@pokemon_list.active = true

# Vu/Capture
#@pokemon_amount = Window_Base.new(27 - 16, 432 - 16, 420 + 32, 48 + 32)
@pokemon_amount = Window_Base.new(27 - 16, 70, 155, 400)
@pokemon_amount.contents = Bitmap.new(155-32, 400-32)
#@pokemon_amount.contents = Bitmap.new(420, 48)
@pokemon_amount.contents.font.name = $fontface
@pokemon_amount.contents.font.size = $fontsize
@pokemon_amount.contents.font.italic = true
@pokemon_amount.opacity = 0







#@pokemon_amount.contents.draw_text(0, 0, 420, 48, "VUS " + viewed, 0)
#@pokemon_amount.contents.draw_text(0, 0, 420, 48, "CAPTURéS " + captured.to_s, 2)
@pokemon_amount.contents.draw_text(0, 0, 155-32, 35, "VUS", 1)# + viewed, 1)
@pokemon_amount.contents.draw_text(0, 78, 155-32, 35, "PRIS", 1)# + captured.to_s, 1)
rect = Rect.new (32, 35, 120, 3)
@pokemon_amount.contents.fill_rect(rect, Color.new(0, 0, 0))
rect = Rect.new (30, 33, 120, 3)
@pokemon_amount.contents.fill_rect(rect, Color.new(255, 255, 255))
rect = Rect.new (32, 78 + 35, 120, 3)
@pokemon_amount.contents.fill_rect(rect, Color.new(0, 0, 0))
rect = Rect.new (30, 78 + 33, 120, 3)
@pokemon_amount.contents.fill_rect(rect, Color.new(255, 255, 255))
string_viewed = sprintf("% 3s", $game_variables[5000]["pokedex"]["vus"].to_s)
string_captured = sprintf("% 3s", $game_variables[5000]["pokedex"]["captures"].to_s)
@pokemon_amount.contents.draw_text(0, 37, 155-32, 35, string_viewed, 1)
@pokemon_amount.contents.draw_text(0, 78 + 37, 155-32, 35, string_captured, 1)

@pokemon_list.update
@pokemon_list.refresh
# Fin Fenêtre principale


Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@pokemon_list.dispose
@pokemon_amount.dispose
@background.dispose
@backbackground.dispose
end

def update
@pokemon_list.update
@index = @pokemon_list.index

if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = POKEMON_S::Pokemon_Menu.new(0)
return
end

if Input.trigger?(Input::C)
if @show
pokemon_id = @table[@index]
else
pokemon_id = @list[@index]
end
seen = $data_pokedex[pokemon_id][0]
if seen == false
$game_system.se_play($data_system.buzzer_se)
return
end
$scene = Pokemon_Detail.new(pokemon_id, @show)
return
end

if Input.trigger?(Input::A)
@show = @show ? false : true
@index = 0
@pokemon_list.dispose
@pokemon_list = POKEMON_S::Pokemon_List.new(@table, @list, @index, @show)
@pokemon_list.active = true
@pokemon_list.update
@pokemon_list.refresh
end
end
end


class Pokemon_Detail
def initialize(id, show, mode = 0, appel = "pkdx", z_level = 100)
@id = id
@show = show
@mode = mode
@appel = appel
@z_level = z_level
@table = []
# Regional
if POKEMON_S._DEXREG
for id in 1..$data_pokedex.length-1
@table[Pokemon_Info.id_bis(id)] = id
end
@table.shift # débarasser l'élément 0
@table.compact!
else
# National
for id in 1..$data_pokedex.length-1
@table.push(id)
end
end
end

def main
# Fenêtre détail
@background = Sprite.new
@background.bitmap = RPG::Cache.picture("PokedexShfond1.png")
@background.z = @z_level

# Sprite
@pokemon_sprite = Sprite.new
@pokemon_sprite.x = 26
@pokemon_sprite.y = 71
@pokemon_sprite.z = 10 + @z_level
@pokemon_sprite.visible = false

# Identité
@data_window = Window_Base.new(233-16, 76-16, 370+32, 196+32)
@data_window.contents = Bitmap.new(370, 196)
color = Color.new(60,60,60)
@data_window.contents.font.name = $fontface
@data_window.contents.font.size = $fontsizebig
@data_window.contents.font.color = color
@data_window.opacity = 0
@data_window.z = 10 + @z_level
@data_window.visible = false

# Descr
@text_window = Window_Base.new(60 - 16, 252 - 16 + 51, 550 + 32, 160 + 32)
@text_window.contents = Bitmap.new(550 , 160)
@text_window.contents.font.name = $fontface
@text_window.contents.font.size = $fontsize
@text_window.contents.font.color = color
@text_window.opacity = 0
@text_window.z = 10 + @z_level
@text_window.visible = false

@list = []
for i in 0.. @table.length-1
if $data_pokedex[@table[i]][0]
@list.push(@table[i])
end
end

if @mode == 0
filename = "Audio/SE/Cries/" + sprintf("%03d", @id) + "Cry.wav"
if FileTest.exist?(filename)
Audio.se_play(filename)
end
end

data_refresh
@background.visible = false
@pokemon_sprite.visible = false
@data_window.visible = false
@text_window.visible = false
case @mode
when 0
@background.visible = true
@pokemon_sprite.visible = true
@data_window.visible = true
@text_window.visible = true
when 1
refresh_zone
when 2
refresh_cri
when 3
refresh_tail
end

Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@background.dispose
@data_window.dispose
@pokemon_sprite.dispose
@text_window.dispose
end

def update
case @appel
when "pkdx"
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
Graphics.freeze
hide
if @show
index = @table.index(@id)
else
index = @list.index(@id)
end
$scene = Pokemon_Pokedex.new(index, @show)
return
end

if Input.trigger?(Input::C) and @mode == 1
Graphics.freeze
hide
$game_system.se_play($data_system.decision_se)
$game_temp.map_temp = ["PKDX", false, $game_map.map_id, $game_player.x,
$game_player.y, $game_player.direction, $game_player.character_name,
$game_player.character_hue, $game_player.step_anime,
$game_system.menu_disabled, POKEMON_S::_MAPLINK, @id, @show]
$game_temp.transition_processing = true
$game_temp.transition_name = ""
POKEMON_S::_MAPLINK = false

$scene = Scene_Map.new
$game_map.setup(POKEMON_S::_WMAPID)
$game_player.moveto(9, 7)
$game_map.autoplay
$game_map.update
return
end

if Input.trigger?(Input::C) and @mode == 2
filename = "Audio/SE/Cries/" + sprintf("%03d", @id) + "Cry.wav"
if FileTest.exist?(filename)
Audio.se_play(filename)
end
end

if Input.trigger?(Input::DOWN)
Graphics.freeze
index = @list.index(@id)
if @id == @list.last
@id = @list.first
else
@id = @list[index+1]
end
hide
Graphics.transition(5)
Graphics.freeze
@mode = 0
data_refresh
Graphics.transition
filename = "Audio/SE/Cries/" + sprintf("%03d", @id) + "Cry.wav"
if FileTest.exist?(filename)
Audio.se_play(filename)
end
end

if Input.trigger?(Input::UP)
Graphics.freeze
index = @list.index(@id)
if @id == @list.first
@id = @list.last
else
@id = @list[index-1]
end
hide
Graphics.transition(5)
Graphics.freeze
@mode = 0
data_refresh
Graphics.transition
filename = "Audio/SE/Cries/" + sprintf("%03d", @id) + "Cry.wav"
if FileTest.exist?(filename)
Audio.se_play(filename)
end
end

if Input.trigger?(Input::A) and @pokemon_sprite.visible == false
@show = @show ? false : true
@index = 0
@pokemon_list.dispose
@pokemon_list = POKEMON_S::Pokemon_List.new(@list, @index, @show)
@pokemon_list.active = true
@pokemon_list.update
@pokemon_list.refresh
end

if Input.trigger?(Input::LEFT)
if @mode > 0
Graphics.freeze
hide
#Graphics.transition(1)
@mode -= 1
#Graphics.freeze
case @mode
when 0
data_refresh
when 1
refresh_zone
when 2
refresh_cri
when 3
refresh_tail
end
Graphics.transition(1)
end
end

if Input.trigger?(Input::RIGHT)
if @mode < 3
Graphics.freeze
hide
#Graphics.transition(1)
@mode += 1
#Graphics.freeze
case @mode
when 0
data_refresh
when 1
refresh_zone
when 2
refresh_cri
when 3
refresh_tail
end
Graphics.transition(1)
end
end
when "map"
if Input.trigger?(Input::B)
$game_system.se_play($data_system.buzzer_se)
end

if Input.trigger?(Input::C)
$game_system.se_play($data_system.cancel_se)
Graphics.freeze
$scene = Scene_Map.new
return
end

if Input.trigger?(Input::DOWN)
$game_system.se_play($data_system.buzzer_se)
end

if Input.trigger?(Input::UP)
$game_system.se_play($data_system.buzzer_se)
end

if Input.trigger?(Input::A)
$game_system.se_play($data_system.buzzer_se)
end

if Input.trigger?(Input::LEFT)
$game_system.se_play($data_system.buzzer_se)
end

if Input.trigger?(Input::RIGHT)
$game_system.se_play($data_system.buzzer_se)
end
when "combat"
if Input.trigger?(Input::B)
$game_system.se_play($data_system.buzzer_se)
end

if Input.trigger?(Input::C)
$game_system.se_play($data_system.cancel_se)
Graphics.freeze
self.dispose
Graphics.transition
return
end

if Input.trigger?(Input::DOWN)
$game_system.se_play($data_system.buzzer_se)
end

if Input.trigger?(Input::UP)
$game_system.se_play($data_system.buzzer_se)
end

if Input.trigger?(Input::A)
$game_system.se_play($data_system.buzzer_se)
end

if Input.trigger?(Input::LEFT)
$game_system.se_play($data_system.buzzer_se)
end

if Input.trigger?(Input::RIGHT)
$game_system.se_play($data_system.buzzer_se)
end
end
end

def hide
@background.visible = false
@pokemon_sprite.visible = false
case @mode
when 0
@data_window.visible = false
@text_window.visible = false
when 1
@text.dispose
when 2
@data_window.visible = false
@text_window.visible = false
when 3
@trainer.dispose
@pokemon_new_sprite.dispose
@text.dispose
end
end


def data_refresh
@background.bitmap = RPG::Cache.picture("PokedexShfond1.png")
@pokemon_sprite.x = 26
@pokemon_sprite.y = 71
@data_window.x = 233-16
@data_window.y = 76-16
@pokemon_sprite.visible = true
@background.visible = true
@data_window.visible = true
@text_window.visible = true

@pokemon = $data_pokemon[@id]
show = $data_pokedex[@id][1]
ida = sprintf("%03d", @id)
@pokemon_sprite.bitmap = RPG::Cache.battler("Front_Male/" + ida + ".png", 0)

if POKEMON_S._DEXREG
name = "N." + sprintf("%03d", Pokemon_Info.id_bis(@id)) + " " + @pokemon[0]
else
name = "N." + ida + " " + @pokemon[0]
end

if show # Descr accessible
species = @pokemon[9][1]
height_data = @pokemon[9][2]
weight = @pokemon[9][3]
else
species = "???"
height_data = "???"
weight = "??? "
end

@data_window.contents.clear
@data_window.contents.draw_text(15, 0, 370, 47, name)
@data_window.contents.draw_text(15, 41, 370, 47, "Pokémon " + species)
@data_window.contents.draw_text(41, 95, 230, 47, "Taille: ")
@data_window.contents.draw_text(41, 95, 212, 47, height_data, 2)
@data_window.contents.draw_text(41, 148, 230, 47, "Poids: ")
@data_window.contents.draw_text(41, 148, 230, 47, weight, 2)

@text_window.contents.clear
if show
text = @pokemon[9][0]
string = string_builder(text, 51)
string1 = string[0]
string2 = string[1]
string3 = string[2]
string4 = string[3]
@text_window.contents.draw_text(0, 0, 550, 40, string1)
@text_window.contents.draw_text(0, 40, 550, 40, string2)
@text_window.contents.draw_text(0, 80, 550, 40, string3)
@text_window.contents.draw_text(0, 120, 550, 40, string4)
end
end

def refresh_zone
@background.bitmap = RPG::Cache.picture("PokedexShfond2.png")
@background.visible = true
@text = Window_Base.new(32-16, 223-16, 576+32, 47+32)
@text.contents = Bitmap.new(576, 47)
@text.contents.font.name = $fontface
@text.contents.font.size = $fontsizebig
@text.contents.font.color = Color.new(60,60,60)
@text.contents.draw_text(0, 0, 576, 47, "OUVRIR LA CARTE", 1)
@text.opacity = 0
end

def refresh_cri
@background.bitmap = RPG::Cache.picture("PokedexShfond3.png")
@pokemon_sprite.visible = true
@background.visible = true
@data_window.visible = true
@pokemon_sprite.x = 51
@pokemon_sprite.y = 75
@data_window.x = 211 - 16
@data_window.y = 75 - 5
@data_window.contents.clear
@data_window.contents.draw_text(0, 0, 339, 47, "CRI DE")
@data_window.contents.draw_text(0, 41, 339, 47, @pokemon[0])
end

def refresh_tail
@background.bitmap = RPG::Cache.picture("PokedexShfond4.png")
@background.visible = true
@pokemon_new_sprite = Sprite.new
ida = sprintf("%03d", @id)
@pokemon_new_sprite.bitmap = RPG::Cache.battler("Front_Male/" + ida + ".png", 0)
@pokemon_new_sprite.color = Color.new(0, 0, 0, 255)

@trainer = Sprite.new
@trainer.bitmap = RPG::Cache.battler("trainer000.png", 0)
@trainer.color = Color.new(0, 0, 0, 255)

sizes = []
for sprite in [@trainer, @pokemon_new_sprite]
i = j = 0
while sprite.bitmap.get_pixel(i,j).alpha == 0
i += 1
if i > sprite.bitmap.width
i = 0
j += 1
end
end
up_pix = j
i = 0
j = sprite.bitmap.height
while sprite.bitmap.get_pixel(i,j).alpha == 0
i += 1
if i > sprite.bitmap.width
i = 0
j -= 1
end
end
down_pix = j
sizes.push( down_pix-up_pix + 0.0 )
sizes.push( down_pix )
end

if $data_pokemon[@id][9][2].to_f > 1.50
zoom_pok = 1.00
zoom_dre = 1.50 / $data_pokemon[@id][9][2].to_f * sizes[2] / sizes[0]
else
zoom_pok = $data_pokemon[@id][9][2].to_f/1.50 * sizes[0] / sizes[2]
zoom_dre = 1.00
end

@pokemon_new_sprite.ox = @pokemon_new_sprite.bitmap.width/2
@pokemon_new_sprite.oy = sizes[3]#@pokemon_new_sprite.bitmap.height
@pokemon_new_sprite.x = 141 + @pokemon_new_sprite.ox
@pokemon_new_sprite.y = 92 + 160#@pokemon_new_sprite.oy

@trainer.ox = @trainer.bitmap.width/2
@trainer.oy = sizes[1]#@trainer.bitmap.height
@trainer.x = 339 + @trainer.ox
@trainer.y = 92 + 160 #@trainer.oy

@pokemon_new_sprite.zoom_x = @pokemon_new_sprite.zoom_y = zoom_pok
@trainer.zoom_x = @trainer.zoom_y = zoom_dre

@text = Window_Base.new(32-16, 367-16, 576+32, 47+32)
@text.contents = Bitmap.new(576, 47)
@text.contents.font.name = $fontface
@text.contents.font.size = $fontsizebig
@text.contents.font.color = Color.new(60,60,60)
@text.contents.draw_text(0, 0, 576, 47, "TAILLE COMPARE A #{Player.name}", 1)
@text.opacity = 0
end

def string_builder(text, limit)
length = text.length
full1 = false
full2 = false
full3 = false
full4 = false
string1 = ""
string2 = ""
string3 = ""
string4 = ""
word = ""
for i in 0..length
letter = text[i..i]
if letter != " " and i != length
word += letter.to_s
else
word = word + " "
if (string1 + word).length < limit and not(full1)
string1 += word
word = ""
else
full1 = true
end

if (string2 + word).length < limit and not(full2)
string2 += word
word = ""
else
full2 = true
end

if (string3 + word).length < limit and not(full3)
string3 += word
word = ""
else
full3 = true
end

if (string4 + word).length < limit and not(full4)
string4 += word
word = ""
else
full4 = true
end
end
end
return [string1, string2, string3, string4]
end


end


class Pokemon_List < Window_Selectable
def initialize(table, id_list = [], menu_index = 0, show = true)
# show montre les pokémons intermédiaires
# id_list liste des pokémons vu/attrapés
#super(50-16, 48-16, 560+32, 387+32, 43)
@hauteur = 35
super(340, 32, 560+32, 384+32, @hauteur)#(640 - 320, 48-16, 560+32, 387+32, 43)
@index = menu_index
@table = table
@id_list = id_list
@last = id_list[-1]
@show = show
self.opacity = 0
if @show
value = @table.index(@last)
value += 1 if value != nil
else
value = id_list.length
end
if value == nil
value = 1
@last = 1
end
@flag_up = 0
@flag_down = 0
@item_max = value
@pokeball = Sprite.new
@pokeball.bitmap = RPG::Cache.picture("PokedexShBall.png")
@pokeball.ox = 150
@pokeball.oy = 150
@pokeball.y = 240
@pokeball.z = 6
self.contents = Bitmap.new(width - 32, value * @hauteur)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
@sprite_array = []
for i in 1..5
sprite = Sprite.new
sprite.z = 4
sprite.x = 185
sprite.y = -4 + 160*(i-2)
@sprite_array.push(sprite)
end
sprite_refresh
@pokeball.angle = - @index * 22.5
end

def dispose
super
for sprite in @sprite_array
sprite.dispose
end
@pokeball.dispose
end

def update
if @flag_up > 0
@flag_up -= 1
self.oy -= 7
#self.oy += 1 if @flag_up == 0
@pokeball.angle += 4.5
for sprite in @sprite_array
sprite.y += 32
end
if @flag_up == 0
@sprite_array.unshift(@sprite_array.pop)
@sprite_array[0].y -= 800
sprite_refresh
end
return
end
if @flag_down > 0
@flag_down -= 1
self.oy += 7
#self.oy -= 1 if @flag_down == 0
@pokeball.angle -= 4.5
for sprite in @sprite_array
sprite.y -= 32
end
if @flag_down == 0
@sprite_array.push(@sprite_array.shift)
@sprite_array[4].y += 800
sprite_refresh
end
return
end
if self.active and @item_max > 0 and @index >= 0
if Input.repeat?(Input::DOWN)
if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
@index < @item_max - @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index + @column_max) % @item_max
@flag_down += 5
return
end
end

if Input.repeat?(Input::UP)
if (@column_max == 1 and Input.trigger?(Input::UP)) or
@index >= @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index - @column_max + @item_max) % @item_max
@flag_up += 5
return
end
end

if Input.repeat?(Input::RIGHT)
if @column_max >= 2 and @index < @item_max - 1
$game_system.se_play($data_system.cursor_se)
@index += 1
end
end

if Input.repeat?(Input::LEFT)
if @column_max >= 2 and @index > 0
$game_system.se_play($data_system.cursor_se)
@index -= 1
end
end

if Input.repeat?(Input::R)
if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
$game_system.se_play($data_system.cursor_se)
@index = [@index + self.page_item_max - 2, @item_max - 1].min
self.top_row += self.page_row_max
sprite_refresh
end
end

if Input.repeat?(Input::L)
if self.top_row > 0
$game_system.se_play($data_system.cursor_se)
@index = [@index - self.page_item_max + 2, 0].max
self.top_row -= self.page_row_max
sprite_refresh
end
end
end

if self.active and @help_window != nil
update_help
end

update_cursor_rect

if @index < 6 and self.oy != 35 + (4-@index) * @hauteur
self.oy = -(35 + (4-@index) * @hauteur)
end
end

def update_cursor_rect
self.cursor_rect.empty
row = @index / @column_max
if row < self.top_row + 5
self.top_row = row - 5
end
if row > self.top_row + (self.page_row_max - 5)
self.top_row = row - (self.page_row_max - 5)
end
end

def sprite_refresh
for i in 0..4
if not @show and $data_pokedex[@id_list[(@index+i-2)%@id_list.length]][0]
@sprite_array[i].bitmap = RPG::Cache.battler("Front_Male/#{sprintf('%03d', @id_list[(@index+i-2)%@id_list.length])}.png", 0)
elsif @show
if $data_pokedex[@table[(@index+i-2)%(@table.index(@last)+1)]][0] #(@index+i-2)%@last + 1)
@sprite_array[i].bitmap = RPG::Cache.battler("Front_Male/#{sprintf('%03d', @table[(@index+i-2)%@last])}.png", 0)
else
@sprite_array[i].bitmap = RPG::Cache.battler("Front_Male/000.png", 0)
end
end
end
end

def refresh
self.contents.clear
normal_color = Color.new(60,60,60)
self.contents.font.color = normal_color
i = 0 # désigne l'entrée

for value in @table
if @id_list.include?(value)
i += 1
ida = sprintf("%03d", @table.index(value) + 1)
string = " N." + ida
self.contents.draw_text(10, @hauteur * (i-1), 480, @hauteur, string)
string = Pokemon_Info.name(value)
self.contents.draw_text(110, @hauteur * (i-1), 300, @hauteur, string)
if $data_pokedex[value][1]
bitmap = RPG::Cache.picture("Pokedexball.png")
self.contents.blt(80, 5 + @hauteur * (i-1), bitmap, Rect.new(0, 0, 24, 24))
end
elsif @show and i < @table.index(@last) + 1
i += 1
ida = sprintf("%03d", @table.index(value) + 1)
string = " N." + ida
self.contents.draw_text(10, @hauteur * (i-1), 480, @hauteur, string)
string = "-------"
self.contents.draw_text(110, @hauteur * (i-1), 300, @hauteur, string)
elsif i >= @table.index(@last) + 1
break
else
next
end

end
end

end
end


PS.Désolé, je n'ai pas réussi à faire fonctionner la balise code.

Posté par MrWolfplayer97 le 25 Aoû - 22:41 (2012)
Salut sa marche ! Mais je te met juste un screen pour savoir si c'est normal ce résultat:
Spoiler


Qu'il n'y est pas de nom a coté du pokémon et qu'il y a l'image qui se répette.
Merci d'avance

Posté par Gemini le 26 Aoû - 01:22 (2012)
Non pas normal. Lis le manuel il y a probablement quelque chose à activer..

Posté par MrWolfplayer97 le 26 Aoû - 09:26 (2012)
Dans le manuel il y à juste activer le pokédex et la ligne de script à insérer...


Spoiler
Code:
#==============================================================================
# ¦ Pokemon_Pokedex
# Pokemon Script Project - Krosk
# 18/07/07
# 07/09/08 - révision v0.7, Pokédex de Shaolan (PSP4G) simplifié et optimisé
# (crédits : Shaolan, Slash)
# 03/01/09 - révision
#-----------------------------------------------------------------------------
# Scène modifiable
#-----------------------------------------------------------------------------
# Pokédex
#-----------------------------------------------------------------------------

module POKEMON_S
class Pokemon_Pokedex #(Numérique)
def initialize(index = 0, show = true)
@index = index
@show = show
@table = []
# Regional
if POKEMON_S._DEXREG
for id in 1..$data_pokedex.length-1
@table[Pokemon_Info.id_bis(id)] = id
end
@table.shift # débarasser l'élément 0
@table.compact!
else
# National
for id in 1..$data_pokedex.length-1
@table.push(id)
end
end
end

def main
# Fenêtre principale
# Fond
@background = Sprite.new
@background.bitmap = RPG::Cache.picture("PokedexSh.png")
@background.z = 5
@backbackground = Sprite.new
@backbackground.bitmap = RPG::Cache.picture("PokedexShback.png")
@backbackground.z = 0

# Liste
@list = []
$game_variables[5000]["pokedex"]["vus"] = 0
$game_variables[5000]["pokedex"]["captures"] = 0
for i in 1... @table.length
if $data_pokedex[@table[i]][0]
$game_variables[5000]["pokedex"]["vus"] += 1
@list.push(@table[i]) # liste des ID vus
end

$game_variables[5000]["pokedex"]["captures"] += 1 if $data_pokedex[i][1]
end
@pokemon_list = POKEMON_S::Pokemon_List.new(@table, @list, @index, @show)
@pokemon_list.active = true

# Vu/Capture
#@pokemon_amount = Window_Base.new(27 - 16, 432 - 16, 420 + 32, 48 + 32)
@pokemon_amount = Window_Base.new(27 - 16, 70, 155, 400)
@pokemon_amount.contents = Bitmap.new(155-32, 400-32)
#@pokemon_amount.contents = Bitmap.new(420, 48)
@pokemon_amount.contents.font.name = $fontface
@pokemon_amount.contents.font.size = $fontsize
@pokemon_amount.contents.font.italic = true
@pokemon_amount.opacity = 0







#@pokemon_amount.contents.draw_text(0, 0, 420, 48, "VUS " + viewed, 0)
#@pokemon_amount.contents.draw_text(0, 0, 420, 48, "CAPTURéS " + captured.to_s, 2)
@pokemon_amount.contents.draw_text(0, 0, 155-32, 35, "VUS", 1)# + viewed, 1)
@pokemon_amount.contents.draw_text(0, 78, 155-32, 35, "PRIS", 1)# + captured.to_s, 1)
rect = Rect.new (32, 35, 120, 3)
@pokemon_amount.contents.fill_rect(rect, Color.new(0, 0, 0))
rect = Rect.new (30, 33, 120, 3)
@pokemon_amount.contents.fill_rect(rect, Color.new(255, 255, 255))
rect = Rect.new (32, 78 + 35, 120, 3)
@pokemon_amount.contents.fill_rect(rect, Color.new(0, 0, 0))
rect = Rect.new (30, 78 + 33, 120, 3)
@pokemon_amount.contents.fill_rect(rect, Color.new(255, 255, 255))
string_viewed = sprintf("% 3s", $game_variables[5000]["pokedex"]["vus"].to_s)
string_captured = sprintf("% 3s", $game_variables[5000]["pokedex"]["captures"].to_s)
@pokemon_amount.contents.draw_text(0, 37, 155-32, 35, string_viewed, 1)
@pokemon_amount.contents.draw_text(0, 78 + 37, 155-32, 35, string_captured, 1)

@pokemon_list.update
@pokemon_list.refresh
# Fin Fenêtre principale


Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@pokemon_list.dispose
@pokemon_amount.dispose
@background.dispose
@backbackground.dispose
end

def update
@pokemon_list.update
@index = @pokemon_list.index

if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = POKEMON_S::Pokemon_Menu.new(0)
return
end

if Input.trigger?(Input::C)
if @show
pokemon_id = @table[@index]
else
pokemon_id = @list[@index]
end
seen = $data_pokedex[pokemon_id][0]
if seen == false
$game_system.se_play($data_system.buzzer_se)
return
end
$scene = Pokemon_Detail.new(pokemon_id, @show)
return
end

if Input.trigger?(Input::A)
@show = @show ? false : true
@index = 0
@pokemon_list.dispose
@pokemon_list = POKEMON_S::Pokemon_List.new(@table, @list, @index, @show)
@pokemon_list.active = true
@pokemon_list.update
@pokemon_list.refresh
end
end
end


class Pokemon_Detail
def initialize(id, show, mode = 0, appel = "pkdx", z_level = 100)
@id = id
@show = show
@mode = mode
@appel = appel
@z_level = z_level
@table = []
# Regional
if POKEMON_S._DEXREG
for id in 1..$data_pokedex.length-1
@table[Pokemon_Info.id_bis(id)] = id
end
@table.shift # débarasser l'élément 0
@table.compact!
else
# National
for id in 1..$data_pokedex.length-1
@table.push(id)
end
end
end

def main
# Fenêtre détail
@background = Sprite.new
@background.bitmap = RPG::Cache.picture("PokedexShfond1.png")
@background.z = @z_level

# Sprite
@pokemon_sprite = Sprite.new
@pokemon_sprite.x = 26
@pokemon_sprite.y = 71
@pokemon_sprite.z = 10 + @z_level
@pokemon_sprite.visible = false

# Identité
@data_window = Window_Base.new(233-16, 76-16, 370+32, 196+32)
@data_window.contents = Bitmap.new(370, 196)
color = Color.new(60,60,60)
@data_window.contents.font.name = $fontface
@data_window.contents.font.size = $fontsizebig
@data_window.contents.font.color = color
@data_window.opacity = 0
@data_window.z = 10 + @z_level
@data_window.visible = false

# Descr
@text_window = Window_Base.new(60 - 16, 252 - 16 + 51, 550 + 32, 160 + 32)
@text_window.contents = Bitmap.new(550 , 160)
@text_window.contents.font.name = $fontface
@text_window.contents.font.size = $fontsize
@text_window.contents.font.color = color
@text_window.opacity = 0
@text_window.z = 10 + @z_level
@text_window.visible = false

@list = []
for i in 0.. @table.length-1
if $data_pokedex[@table[i]][0]
@list.push(@table[i])
end
end

if @mode == 0
filename = "Audio/SE/Cries/" + sprintf("%03d", @id) + "Cry.wav"
if FileTest.exist?(filename)
Audio.se_play(filename)
end
end

data_refresh
@background.visible = false
@pokemon_sprite.visible = false
@data_window.visible = false
@text_window.visible = false
case @mode
when 0
@background.visible = true
@pokemon_sprite.visible = true
@data_window.visible = true
@text_window.visible = true
when 1
refresh_zone
when 2
refresh_cri
when 3
refresh_tail
end

Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@background.dispose
@data_window.dispose
@pokemon_sprite.dispose
@text_window.dispose
end

def update
case @appel
when "pkdx"
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
Graphics.freeze
hide
if @show
index = @table.index(@id)
else
index = @list.index(@id)
end
$scene = Pokemon_Pokedex.new(index, @show)
return
end

if Input.trigger?(Input::C) and @mode == 1
Graphics.freeze
hide
$game_system.se_play($data_system.decision_se)
$game_temp.map_temp = ["PKDX", false, $game_map.map_id, $game_player.x,
$game_player.y, $game_player.direction, $game_player.character_name,
$game_player.character_hue, $game_player.step_anime,
$game_system.menu_disabled, POKEMON_S::_MAPLINK, @id, @show]
$game_temp.transition_processing = true
$game_temp.transition_name = ""
POKEMON_S::_MAPLINK = false

$scene = Scene_Map.new
$game_map.setup(POKEMON_S::_WMAPID)
$game_player.moveto(9, 7)
$game_map.autoplay
$game_map.update
return
end

if Input.trigger?(Input::C) and @mode == 2
filename = "Audio/SE/Cries/" + sprintf("%03d", @id) + "Cry.wav"
if FileTest.exist?(filename)
Audio.se_play(filename)
end
end

if Input.trigger?(Input::DOWN)
Graphics.freeze
index = @list.index(@id)
if @id == @list.last
@id = @list.first
else
@id = @list[index+1]
end
hide
Graphics.transition(5)
Graphics.freeze
@mode = 0
data_refresh
Graphics.transition
filename = "Audio/SE/Cries/" + sprintf("%03d", @id) + "Cry.wav"
if FileTest.exist?(filename)
Audio.se_play(filename)
end
end

if Input.trigger?(Input::UP)
Graphics.freeze
index = @list.index(@id)
if @id == @list.first
@id = @list.last
else
@id = @list[index-1]
end
hide
Graphics.transition(5)
Graphics.freeze
@mode = 0
data_refresh
Graphics.transition
filename = "Audio/SE/Cries/" + sprintf("%03d", @id) + "Cry.wav"
if FileTest.exist?(filename)
Audio.se_play(filename)
end
end

if Input.trigger?(Input::A) and @pokemon_sprite.visible == false
@show = @show ? false : true
@index = 0
@pokemon_list.dispose
@pokemon_list = POKEMON_S::Pokemon_List.new(@list, @index, @show)
@pokemon_list.active = true
@pokemon_list.update
@pokemon_list.refresh
end

if Input.trigger?(Input::LEFT)
if @mode > 0
Graphics.freeze
hide
#Graphics.transition(1)
@mode -= 1
#Graphics.freeze
case @mode
when 0
data_refresh
when 1
refresh_zone
when 2
refresh_cri
when 3
refresh_tail
end
Graphics.transition(1)
end
end

if Input.trigger?(Input::RIGHT)
if @mode < 3
Graphics.freeze
hide
#Graphics.transition(1)
@mode += 1
#Graphics.freeze
case @mode
when 0
data_refresh
when 1
refresh_zone
when 2
refresh_cri
when 3
refresh_tail
end
Graphics.transition(1)
end
end
when "map"
if Input.trigger?(Input::B)
$game_system.se_play($data_system.buzzer_se)
end

if Input.trigger?(Input::C)
$game_system.se_play($data_system.cancel_se)
Graphics.freeze
$scene = Scene_Map.new
return
end

if Input.trigger?(Input::DOWN)
$game_system.se_play($data_system.buzzer_se)
end

if Input.trigger?(Input::UP)
$game_system.se_play($data_system.buzzer_se)
end

if Input.trigger?(Input::A)
$game_system.se_play($data_system.buzzer_se)
end

if Input.trigger?(Input::LEFT)
$game_system.se_play($data_system.buzzer_se)
end

if Input.trigger?(Input::RIGHT)
$game_system.se_play($data_system.buzzer_se)
end
when "combat"
if Input.trigger?(Input::B)
$game_system.se_play($data_system.buzzer_se)
end

if Input.trigger?(Input::C)
$game_system.se_play($data_system.cancel_se)
Graphics.freeze
self.dispose
Graphics.transition
return
end

if Input.trigger?(Input::DOWN)
$game_system.se_play($data_system.buzzer_se)
end

if Input.trigger?(Input::UP)
$game_system.se_play($data_system.buzzer_se)
end

if Input.trigger?(Input::A)
$game_system.se_play($data_system.buzzer_se)
end

if Input.trigger?(Input::LEFT)
$game_system.se_play($data_system.buzzer_se)
end

if Input.trigger?(Input::RIGHT)
$game_system.se_play($data_system.buzzer_se)
end
end
end

def hide
@background.visible = false
@pokemon_sprite.visible = false
case @mode
when 0
@data_window.visible = false
@text_window.visible = false
when 1
@text.dispose
when 2
@data_window.visible = false
@text_window.visible = false
when 3
@trainer.dispose
@pokemon_new_sprite.dispose
@text.dispose
end
end


def data_refresh
@background.bitmap = RPG::Cache.picture("PokedexShfond1.png")
@pokemon_sprite.x = 26
@pokemon_sprite.y = 71
@data_window.x = 233-16
@data_window.y = 76-16
@pokemon_sprite.visible = true
@background.visible = true
@data_window.visible = true
@text_window.visible = true

@pokemon = $data_pokemon[@id]
show = $data_pokedex[@id][1]
ida = sprintf("%03d", @id)
@pokemon_sprite.bitmap = RPG::Cache.battler("Front_Male/" + ida + ".png", 0)

if POKEMON_S._DEXREG
name = "N." + sprintf("%03d", Pokemon_Info.id_bis(@id)) + " " + @pokemon[0]
else
name = "N." + ida + " " + @pokemon[0]
end

if show # Descr accessible
species = @pokemon[9][1]
height_data = @pokemon[9][2]
weight = @pokemon[9][3]
else
species = "???"
height_data = "???"
weight = "??? "
end

@data_window.contents.clear
@data_window.contents.draw_text(15, 0, 370, 47, name)
@data_window.contents.draw_text(15, 41, 370, 47, "Pokémon " + species)
@data_window.contents.draw_text(41, 95, 230, 47, "Taille: ")
@data_window.contents.draw_text(41, 95, 212, 47, height_data, 2)
@data_window.contents.draw_text(41, 148, 230, 47, "Poids: ")
@data_window.contents.draw_text(41, 148, 230, 47, weight, 2)

@text_window.contents.clear
if show
text = @pokemon[9][0]
string = string_builder(text, 51)
string1 = string[0]
string2 = string[1]
string3 = string[2]
string4 = string[3]
@text_window.contents.draw_text(0, 0, 550, 40, string1)
@text_window.contents.draw_text(0, 40, 550, 40, string2)
@text_window.contents.draw_text(0, 80, 550, 40, string3)
@text_window.contents.draw_text(0, 120, 550, 40, string4)
end
end

def refresh_zone
@background.bitmap = RPG::Cache.picture("PokedexShfond2.png")
@background.visible = true
@text = Window_Base.new(32-16, 223-16, 576+32, 47+32)
@text.contents = Bitmap.new(576, 47)
@text.contents.font.name = $fontface
@text.contents.font.size = $fontsizebig
@text.contents.font.color = Color.new(60,60,60)
@text.contents.draw_text(0, 0, 576, 47, "OUVRIR LA CARTE", 1)
@text.opacity = 0
end

def refresh_cri
@background.bitmap = RPG::Cache.picture("PokedexShfond3.png")
@pokemon_sprite.visible = true
@background.visible = true
@data_window.visible = true
@pokemon_sprite.x = 51
@pokemon_sprite.y = 75
@data_window.x = 211 - 16
@data_window.y = 75 - 5
@data_window.contents.clear
@data_window.contents.draw_text(0, 0, 339, 47, "CRI DE")
@data_window.contents.draw_text(0, 41, 339, 47, @pokemon[0])
end

def refresh_tail
@background.bitmap = RPG::Cache.picture("PokedexShfond4.png")
@background.visible = true
@pokemon_new_sprite = Sprite.new
ida = sprintf("%03d", @id)
@pokemon_new_sprite.bitmap = RPG::Cache.battler("Front_Male/" + ida + ".png", 0)
@pokemon_new_sprite.color = Color.new(0, 0, 0, 255)

@trainer = Sprite.new
@trainer.bitmap = RPG::Cache.battler("trainer000.png", 0)
@trainer.color = Color.new(0, 0, 0, 255)

sizes = []
for sprite in [@trainer, @pokemon_new_sprite]
i = j = 0
while sprite.bitmap.get_pixel(i,j).alpha == 0
i += 1
if i > sprite.bitmap.width
i = 0
j += 1
end
end
up_pix = j
i = 0
j = sprite.bitmap.height
while sprite.bitmap.get_pixel(i,j).alpha == 0
i += 1
if i > sprite.bitmap.width
i = 0
j -= 1
end
end
down_pix = j
sizes.push( down_pix-up_pix + 0.0 )
sizes.push( down_pix )
end

if $data_pokemon[@id][9][2].to_f > 1.50
zoom_pok = 1.00
zoom_dre = 1.50 / $data_pokemon[@id][9][2].to_f * sizes[2] / sizes[0]
else
zoom_pok = $data_pokemon[@id][9][2].to_f/1.50 * sizes[0] / sizes[2]
zoom_dre = 1.00
end

@pokemon_new_sprite.ox = @pokemon_new_sprite.bitmap.width/2
@pokemon_new_sprite.oy = sizes[3]#@pokemon_new_sprite.bitmap.height
@pokemon_new_sprite.x = 141 + @pokemon_new_sprite.ox
@pokemon_new_sprite.y = 92 + 160#@pokemon_new_sprite.oy

@trainer.ox = @trainer.bitmap.width/2
@trainer.oy = sizes[1]#@trainer.bitmap.height
@trainer.x = 339 + @trainer.ox
@trainer.y = 92 + 160 #@trainer.oy

@pokemon_new_sprite.zoom_x = @pokemon_new_sprite.zoom_y = zoom_pok
@trainer.zoom_x = @trainer.zoom_y = zoom_dre

@text = Window_Base.new(32-16, 367-16, 576+32, 47+32)
@text.contents = Bitmap.new(576, 47)
@text.contents.font.name = $fontface
@text.contents.font.size = $fontsizebig
@text.contents.font.color = Color.new(60,60,60)
@text.contents.draw_text(0, 0, 576, 47, "TAILLE COMPARE A #{Player.name}", 1)
@text.opacity = 0
end

def string_builder(text, limit)
length = text.length
full1 = false
full2 = false
full3 = false
full4 = false
string1 = ""
string2 = ""
string3 = ""
string4 = ""
word = ""
for i in 0..length
letter = text[i..i]
if letter != " " and i != length
word += letter.to_s
else
word = word + " "
if (string1 + word).length < limit and not(full1)
string1 += word
word = ""
else
full1 = true
end

if (string2 + word).length < limit and not(full2)
string2 += word
word = ""
else
full2 = true
end

if (string3 + word).length < limit and not(full3)
string3 += word
word = ""
else
full3 = true
end

if (string4 + word).length < limit and not(full4)
string4 += word
word = ""
else
full4 = true
end
end
end
return [string1, string2, string3, string4]
end


end


class Pokemon_List < Window_Selectable
def initialize(table, id_list = [], menu_index = 0, show = true)
# show montre les pokémons intermédiaires
# id_list liste des pokémons vu/attrapés
#super(50-16, 48-16, 560+32, 387+32, 43)
@hauteur = 35
super(340, 32, 560+32, 384+32, @hauteur)#(640 - 320, 48-16, 560+32, 387+32, 43)
@index = menu_index
@table = table
@id_list = id_list
@last = id_list[-1]
@show = show
self.opacity = 0
if @show
value = @table.index(@last)
value += 1 if value != nil
else
value = id_list.length
end
if value == nil
value = 1
@last = 1
end
@flag_up = 0
@flag_down = 0
@item_max = value
@pokeball = Sprite.new
@pokeball.bitmap = RPG::Cache.picture("PokedexShBall.png")
@pokeball.ox = 150
@pokeball.oy = 150
@pokeball.y = 240
@pokeball.z = 6
self.contents = Bitmap.new(width - 32, value * @hauteur)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
@sprite_array = []
for i in 1..5
sprite = Sprite.new
sprite.z = 4
sprite.x = 185
sprite.y = -4 + 160*(i-2)
@sprite_array.push(sprite)
end
sprite_refresh
@pokeball.angle = - @index * 22.5
end

def dispose
super
for sprite in @sprite_array
sprite.dispose
end
@pokeball.dispose
end

def update
if @flag_up > 0
@flag_up -= 1
self.oy -= 7
#self.oy += 1 if @flag_up == 0
@pokeball.angle += 4.5
for sprite in @sprite_array
sprite.y += 32
end
if @flag_up == 0
@sprite_array.unshift(@sprite_array.pop)
@sprite_array[0].y -= 800
sprite_refresh
end
return
end
if @flag_down > 0
@flag_down -= 1
self.oy += 7
#self.oy -= 1 if @flag_down == 0
@pokeball.angle -= 4.5
for sprite in @sprite_array
sprite.y -= 32
end
if @flag_down == 0
@sprite_array.push(@sprite_array.shift)
@sprite_array[4].y += 800
sprite_refresh
end
return
end
if self.active and @item_max > 0 and @index >= 0
if Input.repeat?(Input::DOWN)
if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
@index < @item_max - @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index + @column_max) % @item_max
@flag_down += 5
return
end
end

if Input.repeat?(Input::UP)
if (@column_max == 1 and Input.trigger?(Input::UP)) or
@index >= @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index - @column_max + @item_max) % @item_max
@flag_up += 5
return
end
end

if Input.repeat?(Input::RIGHT)
if @column_max >= 2 and @index < @item_max - 1
$game_system.se_play($data_system.cursor_se)
@index += 1
end
end

if Input.repeat?(Input::LEFT)
if @column_max >= 2 and @index > 0
$game_system.se_play($data_system.cursor_se)
@index -= 1
end
end

if Input.repeat?(Input::R)
if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
$game_system.se_play($data_system.cursor_se)
@index = [@index + self.page_item_max - 2, @item_max - 1].min
self.top_row += self.page_row_max
sprite_refresh
end
end

if Input.repeat?(Input::L)
if self.top_row > 0
$game_system.se_play($data_system.cursor_se)
@index = [@index - self.page_item_max + 2, 0].max
self.top_row -= self.page_row_max
sprite_refresh
end
end
end

if self.active and @help_window != nil
update_help
end

update_cursor_rect

if @index < 6 and self.oy != 35 + (4-@index) * @hauteur
self.oy = -(35 + (4-@index) * @hauteur)
end
end

def update_cursor_rect
self.cursor_rect.empty
row = @index / @column_max
if row < self.top_row + 5
self.top_row = row - 5
end
if row > self.top_row + (self.page_row_max - 5)
self.top_row = row - (self.page_row_max - 5)
end
end

def sprite_refresh
for i in 0..4
if not @show and $data_pokedex[@id_list[(@index+i-2)%@id_list.length]][0]
@sprite_array[i].bitmap = RPG::Cache.battler("Front_Male/#{sprintf('%03d', @id_list[(@index+i-2)%@id_list.length])}.png", 0)
elsif @show
if $data_pokedex[@table[(@index+i-2)%(@table.index(@last)+1)]][0] #(@index+i-2)%@last + 1)
@sprite_array[i].bitmap = RPG::Cache.battler("Front_Male/#{sprintf('%03d', @table[(@index+i-2)%@last])}.png", 0)
else
@sprite_array[i].bitmap = RPG::Cache.battler("Front_Male/000.png", 0)
end
end
end
end

def refresh
self.contents.clear
normal_color = Color.new(60,60,60)
self.contents.font.color = normal_color
i = 0 # désigne l'entrée

for value in @table
if @id_list.include?(value)
i += 1
ida = sprintf("%03d", @table.index(value) + 1)
string = " N." + ida
self.contents.draw_text(10, @hauteur * (i-1), 480, @hauteur, string)
string = Pokemon_Info.name(value)
self.contents.draw_text(110, @hauteur * (i-1), 300, @hauteur, string)
if $data_pokedex[value][1]
bitmap = RPG::Cache.picture("Pokedexball.png")
self.contents.blt(80, 5 + @hauteur * (i-1), bitmap, Rect.new(0, 0, 24, 24))
end
elsif @show and i < @table.index(@last) + 1
i += 1
ida = sprintf("%03d", @table.index(value) + 1)
string = " N." + ida
self.contents.draw_text(10, @hauteur * (i-1), 480, @hauteur, string)
string = "-------"
self.contents.draw_text(110, @hauteur * (i-1), 300, @hauteur, string)
elsif i >= @table.index(@last) + 1
break
else
next
end

end
end

end
end



J'ai mis le code dans les balises pour faciliter la tache des personnes qui aurait le même problème que moi.

Posté par Gemini le 26 Aoû - 15:36 (2012)
Quelle version de PSP utilise tu ? Le pokemon_pokedex est peut-être incompatible avec ta version.

Posté par MrWolfplayer97 le 27 Aoû - 18:51 (2012)
J'ai le psp4g+. Mais si je télécharge psp 0.7 je pourrait reprendre mon projet ? (map...)
Et 0.7 est meiux que 4g+ ?

Merci d'avance

Posté par The_Doctor le 27 Aoû - 19:44 (2012)
moi je te conseil de garder psp 4G+ car le pokedex fait le meme probleme ( du pokemon multiple ) dans psp v 0.7

Posté par MrWolfplayer97 le 27 Aoû - 21:29 (2012)
Ah ok merci. Peut être que quand il en-magazine plusieurs pokémons le bug ne se voit plus... Mais ce que je trouve étrange c'est qu'il n'y es pas de nom à coté de l'id du pokémon...

Posté par The_Doctor le 27 Aoû - 23:26 (2012)
voila tien le bon script Imbécile heureux

Spoiler
Code:
#==============================================================================
# ■ Pokemon_Pokedex
# Pokemon Script Project - Krosk
# 18/07/07
# 07/09/08 - révision v0.7, Pokédex de Shaolan (PSP4G) simplifié et optimisé
#             (crédits : Shaolan, Slash)
# 03/01/09 - révision
#-----------------------------------------------------------------------------
# Scène modifiable
#-----------------------------------------------------------------------------
# Pokédex
#-----------------------------------------------------------------------------

module POKEMON_S
  class Pokemon_Pokedex #(Numérique)
    def initialize(index = 0, show = true)
      @index = index
      @show = show
      @table = []
      # Regional
      if POKEMON_S._DEXREG
        for id in 1..$data_pokedex.length-1
          @table[Pokemon_Info.id_bis(id)] = id
        end
        @table.shift # débarasser l'élément 0
        @table.compact!
      else
      # National
        for id in 1..$data_pokedex.length-1
          @table.push(id)
        end
      end
    end
   
    def main
      # Fenêtre principale
      # Fond
      @background = Sprite.new
      @background.bitmap = RPG::Cache.picture("PokedexSh.png")
      @background.z = 5
      @backbackground = Sprite.new
      @backbackground.bitmap = RPG::Cache.picture("PokedexShback.png")
      @backbackground.z = 0
     
      # Liste
      @list = []
      for i in 0..@table.length-1
        if $data_pokedex[@table[i]][0]
          @list.push(@table[i]) # liste des ID vus
        end
      end
      @pokemon_list = POKEMON_S::Pokemon_List.new(@table, @list, @index, @show)
      @pokemon_list.active = true
     
      # Vu/Capture
      #@pokemon_amount = Window_Base.new(27 - 16, 432 - 16, 420 + 32, 48 + 32)
      @pokemon_amount = Window_Base.new(27 - 16, 70, 155, 400)
      @pokemon_amount.contents = Bitmap.new(155-32, 400-32)
      #@pokemon_amount.contents = Bitmap.new(420, 48)
      @pokemon_amount.contents.font.name = $fontface
      @pokemon_amount.contents.font.size = $fontsize
      @pokemon_amount.contents.font.italic = true
      @pokemon_amount.opacity = 0
      viewed = @list.length.to_s
      captured = 0
      for element in @list
        if $data_pokedex[element][1]
          captured += 1
        end
      end
      #@pokemon_amount.contents.draw_text(0, 0, 420, 48, "VUS " + viewed, 0)
      #@pokemon_amount.contents.draw_text(0, 0, 420, 48, "CAPTURéS " + captured.to_s, 2)
      @pokemon_amount.contents.draw_text(0, 0, 155-32, 35, "VUS", 1)# + viewed, 1)
      @pokemon_amount.contents.draw_text(0, 78, 155-32, 35, "PRIS", 1)# + captured.to_s, 1)
      rect = Rect.new (32, 35, 120, 3)
      @pokemon_amount.contents.fill_rect(rect, Color.new(0, 0, 0))
      rect = Rect.new (30, 33, 120, 3)
      @pokemon_amount.contents.fill_rect(rect, Color.new(255, 255, 255))
      rect = Rect.new (32, 78 + 35, 120, 3)
      @pokemon_amount.contents.fill_rect(rect, Color.new(0, 0, 0))
      rect = Rect.new (30, 78 + 33, 120, 3)
      @pokemon_amount.contents.fill_rect(rect, Color.new(255, 255, 255))
      string_viewed = sprintf("% 3s", viewed)
      string_captured = sprintf("% 3s", captured.to_s)
      @pokemon_amount.contents.draw_text(0, 37, 155-32, 35, string_viewed, 1)
      @pokemon_amount.contents.draw_text(0, 78 + 37, 155-32, 35, string_captured, 1)
     
      @pokemon_list.update
      @pokemon_list.refresh
      # Fin Fenêtre principale

     
      Graphics.transition
      loop do
        Graphics.update
        Input.update
        update
        if $scene != self
          break
        end
      end
      Graphics.freeze
      @pokemon_list.dispose
      @pokemon_amount.dispose
      @background.dispose
      @backbackground.dispose
    end
   
    def update
      @pokemon_list.update
      @index = @pokemon_list.index
     
      if Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        $scene = POKEMON_S::Pokemon_Menu.new(0)
        return
      end
     
      if Input.trigger?(Input::C)
        if @show
          pokemon_id = @table[@index]
        else
          pokemon_id = @list[@index]
        end
        seen = $data_pokedex[pokemon_id][0]
        if seen == false
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        $scene = Pokemon_Detail.new(pokemon_id, @show)
        return
      end
     
      if Input.trigger?(Input::A)
        @show = @show ? false : true
        @index = 0
        @pokemon_list.dispose
        @pokemon_list = POKEMON_S::Pokemon_List.new(@table, @list, @index, @show)
        @pokemon_list.active = true
        @pokemon_list.update
        @pokemon_list.refresh
      end
    end
  end
 
 
  class Pokemon_Detail
    def initialize(id, show, mode = 0)
      @id = id
      @show = show
      @mode = mode
      @table = []
      # Regional
      if POKEMON_S._DEXREG
        for id in 1..$data_pokedex.length-1
          @table[Pokemon_Info.id_bis(id)] = id
        end
        @table.shift # débarasser l'élément 0
        @table.compact!
      else
      # National
        for id in 1..$data_pokedex.length-1
          @table.push(id)
        end
      end
    end
   
    def main
      # Fenêtre détail
      @background = Sprite.new
      @background.bitmap = RPG::Cache.picture("PokedexShfond1.png")
      @background.z = 0
     
      # Sprite
      @pokemon_sprite = Sprite.new
      @pokemon_sprite.x = 26
      @pokemon_sprite.y = 71
      @pokemon_sprite.z = 10
      @pokemon_sprite.visible = false
     
      # Identité
      @data_window = Window_Base.new(233-16, 76-16, 370+32, 196+32)
      @data_window.contents = Bitmap.new(370, 196)
      color = Color.new(60,60,60)
      @data_window.contents.font.name = $fontface
      @data_window.contents.font.size = $fontsizebig
      @data_window.contents.font.color = color
      @data_window.opacity = 0
      @data_window.z = 10
      @data_window.visible = false
     
      # Descr
      @text_window = Window_Base.new(60 - 16, 252 - 16 + 51, 550 + 32, 160 + 32)
      @text_window.contents = Bitmap.new(550 , 160)
      @text_window.contents.font.name = $fontface
      @text_window.contents.font.size = $fontsize
      @text_window.contents.font.color = color
      @text_window.opacity = 0
      @text_window.z = 10
      @text_window.visible = false
     
      @list = []
      for i in 0..@table.length-1
        if $data_pokedex[@table[i]][0]
          @list.push(@table[i])
        end
      end
     
      if @mode == 0
        filename = "Audio/SE/Cries/" + sprintf("%03d", @id) + "Cry.wav"
        if FileTest.exist?(filename)
          Audio.se_play(filename)
        end
      end
     
      data_refresh
      @background.visible = false
      @pokemon_sprite.visible = false
      @data_window.visible = false
      @text_window.visible = false
      case @mode
      when 0
        @background.visible = true
        @pokemon_sprite.visible = true
        @data_window.visible = true
        @text_window.visible = true
      when 1
        refresh_zone
      when 2
        refresh_cri
      when 3
        refresh_tail
      end
       
      Graphics.transition
      loop do
        Graphics.update
        Input.update
        update
        if $scene != self
          break
        end
      end
      Graphics.freeze
      @background.dispose
      @data_window.dispose
      @pokemon_sprite.dispose
      @text_window.dispose
    end
   
    def update
      if Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        Graphics.freeze
        hide
        if @show
          index = @table.index(@id)
        else
          index = @list.index(@id)
        end
        $scene = Pokemon_Pokedex.new(index, @show)
        return
      end
     
      if Input.trigger?(Input::C) and @mode == 1
        Graphics.freeze
        hide
        $game_system.se_play($data_system.decision_se)
        $game_temp.map_temp = ["PKDX", false, $game_map.map_id, $game_player.x,
          $game_player.y, $game_player.direction, $game_player.character_name,
          $game_player.character_hue, $game_player.step_anime,
          $game_system.menu_disabled, POKEMON_S::_MAPLINK, @id, @show]
        $game_temp.transition_processing = true
        $game_temp.transition_name = ""
        POKEMON_S::_MAPLINK = false
       
        $scene = Scene_Map.new
        $game_map.setup(POKEMON_S::_WMAPID)
        $game_player.moveto(9, 7)
        $game_map.autoplay
        $game_map.update
        return
      end
     
      if Input.trigger?(Input::C) and @mode == 2
        filename = "Audio/SE/Cries/" + sprintf("%03d", @id) + "Cry.wav"
        if FileTest.exist?(filename)
          Audio.se_play(filename)
        end
      end
     
      if Input.trigger?(Input::DOWN)
        Graphics.freeze
        index = @list.index(@id)
        if @id == @list.last
          @id = @list.first
        else
          @id = @list[index+1]
        end
        hide
        Graphics.transition(5)
        Graphics.freeze
        @mode = 0
        data_refresh
        Graphics.transition
        filename = "Audio/SE/Cries/" + sprintf("%03d", @id) + "Cry.wav"
        if FileTest.exist?(filename)
          Audio.se_play(filename)
        end
      end
     
      if Input.trigger?(Input::UP)
        Graphics.freeze
        index = @list.index(@id)
        if @id == @list.first
          @id = @list.last
        else
          @id = @list[index-1]
        end
        hide
        Graphics.transition(5)
        Graphics.freeze
        @mode = 0
        data_refresh
        Graphics.transition
        filename = "Audio/SE/Cries/" + sprintf("%03d", @id) + "Cry.wav"
        if FileTest.exist?(filename)
          Audio.se_play(filename)
        end
      end
     
      if Input.trigger?(Input::A) and @pokemon_sprite.visible == false
        @show = @show ? false : true
        @index = 0
        @pokemon_list.dispose
        @pokemon_list = POKEMON_S::Pokemon_List.new(@list, @index, @show)
        @pokemon_list.active = true
        @pokemon_list.update
        @pokemon_list.refresh
      end
     
      if Input.trigger?(Input::LEFT)
        if @mode > 0
          Graphics.freeze
          hide
          #Graphics.transition(1)
          @mode -= 1
          #Graphics.freeze
          case @mode
          when 0
            data_refresh
          when 1
            refresh_zone
          when 2
            refresh_cri
          when 3
            refresh_tail
          end
          Graphics.transition(1)
        end
      end
     
      if Input.trigger?(Input::RIGHT)
        if @mode < 3
          Graphics.freeze
          hide
          #Graphics.transition(1)
          @mode += 1
          #Graphics.freeze
          case @mode
          when 0
            data_refresh
          when 1
            refresh_zone
          when 2
            refresh_cri
          when 3
            refresh_tail
          end
          Graphics.transition(1)
        end
      end
    end
   
    def hide
      @background.visible = false
      @pokemon_sprite.visible = false
      case @mode
      when 0
        @data_window.visible = false
        @text_window.visible = false
      when 1
        @text.dispose
      when 2
        @data_window.visible = false
        @text_window.visible = false
      when 3
        @trainer.dispose
        @pokemon_new_sprite.dispose
        @text.dispose
      end
    end
       
   
    def data_refresh
      @background.bitmap = RPG::Cache.picture("PokedexShfond1.png")
      @pokemon_sprite.x = 26
      @pokemon_sprite.y = 71
      @data_window.x = 233-16
      @data_window.y = 76-16
      @pokemon_sprite.visible = true
      @background.visible = true
      @data_window.visible = true
      @text_window.visible = true
     
      @pokemon = $data_pokemon[@id]
      show = $data_pokedex[@id][1]
      ida = sprintf("%03d", @id)
      @pokemon_sprite.bitmap = RPG::Cache.battler("Front_Male/" + ida + ".png", 0)

      if POKEMON_S._DEXREG
        name = "N." + sprintf("%03d", Pokemon_Info.id_bis(@id)) + "  " + @pokemon[0]
      else
        name = "N." + ida + "  " + @pokemon[0]
      end

      if show # Descr accessible
        species = @pokemon[9][1]
        height_data = @pokemon[9][2]
        weight = @pokemon[9][3]
      else
        species = "???"
        height_data = "???"
        weight = "???  "
      end
     
      @data_window.contents.clear
      @data_window.contents.draw_text(15, 0, 370, 47, name)
      @data_window.contents.draw_text(15, 41, 370, 47, "Pokémon " + species)
      @data_window.contents.draw_text(41, 95, 230, 47, "Taille: ")
      @data_window.contents.draw_text(41, 95, 212, 47, height_data, 2)
      @data_window.contents.draw_text(41, 148, 230, 47, "Poids: ")
      @data_window.contents.draw_text(41, 148, 230, 47, weight, 2)
     
      @text_window.contents.clear
      if show
        text = @pokemon[9][0]
        string = string_builder(text, 51)
        string1 = string[0]
        string2 = string[1]
        string3 = string[2]
        string4 = string[3]
        @text_window.contents.draw_text(0, 0, 550, 40, string1)
        @text_window.contents.draw_text(0, 40, 550, 40, string2)
        @text_window.contents.draw_text(0, 80, 550, 40, string3)
        @text_window.contents.draw_text(0, 120, 550, 40, string4)
      end
    end
   
    def refresh_zone
      @background.bitmap = RPG::Cache.picture("PokedexShfond2.png")
      @background.visible = true
      @text = Window_Base.new(32-16, 223-16, 576+32, 47+32)
      @text.contents = Bitmap.new(576, 47)
      @text.contents.font.name = $fontface
      @text.contents.font.size = $fontsizebig
      @text.contents.font.color = Color.new(60,60,60)
      @text.contents.draw_text(0, 0, 576, 47, "OUVRIR LA CARTE", 1)
      @text.opacity = 0
    end
   
    def refresh_cri
      @background.bitmap = RPG::Cache.picture("PokedexShfond3.png")
      @pokemon_sprite.visible = true
      @background.visible = true
      @data_window.visible = true
      @pokemon_sprite.x = 51
      @pokemon_sprite.y = 75
      @data_window.x = 211 - 16
      @data_window.y = 75 - 5
      @data_window.contents.clear
      @data_window.contents.draw_text(0, 0, 339, 47, "CRI DE")
      @data_window.contents.draw_text(0, 41, 339, 47, @pokemon[0])
    end
   
    def refresh_tail
      @background.bitmap = RPG::Cache.picture("PokedexShfond4.png")
      @background.visible = true
      @pokemon_new_sprite = Sprite.new
      ida = sprintf("%03d", @id)
      @pokemon_new_sprite.bitmap = RPG::Cache.battler("Front_Male/" + ida + ".png", 0)
      @pokemon_new_sprite.color = Color.new(0, 0, 0, 255)
     
      @trainer = Sprite.new
      @trainer.bitmap = RPG::Cache.battler("trainer000.png", 0)
      @trainer.color = Color.new(0, 0, 0, 255)
     
      sizes = []
      for sprite in [@trainer, @pokemon_new_sprite]
        i = j = 0
        while sprite.bitmap.get_pixel(i,j).alpha == 0
          i += 1
          if i > sprite.bitmap.width
            i = 0
            j += 1
          end
        end
        up_pix = j
        i = 0
        j = sprite.bitmap.height
        while sprite.bitmap.get_pixel(i,j).alpha == 0
          i += 1
          if i > sprite.bitmap.width
            i = 0
            j -= 1
          end
        end
        down_pix = j
        sizes.push( down_pix-up_pix + 0.0 )
        sizes.push( down_pix )
      end
     
      if $data_pokemon[@id][9][2].to_f > 1.50
        zoom_pok = 1.00
        zoom_dre = 1.50 / $data_pokemon[@id][9][2].to_f * sizes[2] / sizes[0]
      else
        zoom_pok = $data_pokemon[@id][9][2].to_f/1.50 * sizes[0] / sizes[2]
        zoom_dre = 1.00
      end
     
      @pokemon_new_sprite.ox = @pokemon_new_sprite.bitmap.width/2
      @pokemon_new_sprite.oy = sizes[3]#@pokemon_new_sprite.bitmap.height
      @pokemon_new_sprite.x = 141 + @pokemon_new_sprite.ox
      @pokemon_new_sprite.y = 92 + 160#@pokemon_new_sprite.oy
     
      @trainer.ox = @trainer.bitmap.width/2
      @trainer.oy = sizes[1]#@trainer.bitmap.height
      @trainer.x = 339 + @trainer.ox
      @trainer.y = 92 + 160 #@trainer.oy
     
      @pokemon_new_sprite.zoom_x = @pokemon_new_sprite.zoom_y = zoom_pok
      @trainer.zoom_x = @trainer.zoom_y = zoom_dre
     
      @text = Window_Base.new(32-16, 367-16, 576+32, 47+32)
      @text.contents = Bitmap.new(576, 47)
      @text.contents.font.name = $fontface
      @text.contents.font.size = $fontsizebig
      @text.contents.font.color = Color.new(60,60,60)
      @text.contents.draw_text(0, 0, 576, 47, "TAILLE COMPARE A #{Player.name}", 1)
      @text.opacity = 0
    end
   
    def string_builder(text, limit)
      length = text.length
      full1 = false
      full2 = false
      full3 = false
      full4 = false
      string1 = ""
      string2 = ""
      string3 = ""
      string4 = ""
      word = ""
      for i in 0..length
        letter = text[i..i]
        if letter != " " and i != length
          word += letter.to_s
        else
          word = word + " "
          if (string1 + word).length < limit and not(full1)
            string1 += word
            word = ""
          else
            full1 = true
          end
         
          if (string2 + word).length < limit and not(full2)
            string2 += word
            word = ""
          else
            full2 = true
          end
         
          if (string3 + word).length < limit and not(full3)
            string3 += word
            word = ""
          else
            full3 = true
          end
         
          if (string4 + word).length < limit and not(full4)
            string4 += word
            word = ""
          else
            full4 = true
          end
        end
      end
      return [string1, string2, string3, string4]
    end
   
   
  end
 
 
  class Pokemon_List < Window_Selectable
    def initialize(table, id_list = [], menu_index = 0, show = true)
      # show montre les pokémons intermédiaires
      # id_list liste des pokémons vu/attrapés
      #super(50-16, 48-16, 560+32, 387+32, 43)
      @hauteur = 35
      super(340, 32, 560+32, 384+32, @hauteur)#(640 - 320, 48-16, 560+32, 387+32, 43)
      @index = menu_index
      @table = table
      @id_list = id_list
      @last = id_list[-1]
      @show = show
      self.opacity = 0
      if @show
        value = @table.index(@last)
        value += 1 if value != nil
      else
        value = id_list.length
      end
      if value == nil
        value = 1
        @last = 1
      end
      @flag_up = 0
      @flag_down = 0
      @item_max = value
      @pokeball = Sprite.new
      @pokeball.bitmap = RPG::Cache.picture("PokedexShBall.png")
      @pokeball.ox = 150
      @pokeball.oy = 150
      @pokeball.y = 240
      @pokeball.z = 6
      self.contents = Bitmap.new(width - 32, value * @hauteur)
      self.contents.font.name = $fontface
      self.contents.font.size = $fontsize
      @sprite_array = []
      for i in 1..5
        sprite = Sprite.new
        sprite.z = 4
        sprite.x = 185
        sprite.y = -4 + 160*(i-2)
        @sprite_array.push(sprite)
      end
      sprite_refresh
      @pokeball.angle = - @index * 22.5
    end
   
    def dispose
      super
      for sprite in @sprite_array
        sprite.dispose
      end
      @pokeball.dispose
    end
   
    def update
      if @flag_up > 0
        @flag_up -= 1
        self.oy -= 7
        #self.oy += 1 if @flag_up == 0
        @pokeball.angle += 4.5
        for sprite in @sprite_array
          sprite.y += 32
        end
        if @flag_up == 0
          @sprite_array.unshift(@sprite_array.pop)
          @sprite_array[0].y -= 800
          sprite_refresh
        end
        return
      end
      if @flag_down > 0
        @flag_down -= 1
        self.oy += 7
        #self.oy -= 1 if @flag_down == 0
        @pokeball.angle -= 4.5
        for sprite in @sprite_array
          sprite.y -= 32
        end
        if @flag_down == 0
          @sprite_array.push(@sprite_array.shift)
          @sprite_array[4].y += 800
          sprite_refresh
        end
        return
      end
      if self.active and @item_max > 0 and @index >= 0
        if Input.repeat?(Input::DOWN)
          if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
             @index < @item_max - @column_max
            $game_system.se_play($data_system.cursor_se)
            @index = (@index + @column_max) % @item_max
            @flag_down += 5
            return
          end
        end
       
        if Input.repeat?(Input::UP)
          if (@column_max == 1 and Input.trigger?(Input::UP)) or
             @index >= @column_max
            $game_system.se_play($data_system.cursor_se)
            @index = (@index - @column_max + @item_max) % @item_max
            @flag_up += 5
            return
          end
        end

        if Input.repeat?(Input::RIGHT)
          if @column_max >= 2 and @index < @item_max - 1
            $game_system.se_play($data_system.cursor_se)
            @index += 1
          end
        end

        if Input.repeat?(Input::LEFT)
          if @column_max >= 2 and @index > 0
            $game_system.se_play($data_system.cursor_se)
            @index -= 1
          end
        end

        if Input.repeat?(Input::R)
          if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
            $game_system.se_play($data_system.cursor_se)
            @index = [@index + self.page_item_max - 2, @item_max - 1].min
            self.top_row += self.page_row_max
            sprite_refresh
          end
        end

        if Input.repeat?(Input::L)
          if self.top_row > 0
            $game_system.se_play($data_system.cursor_se)
            @index = [@index - self.page_item_max + 2, 0].max
            self.top_row -= self.page_row_max
            sprite_refresh
          end
        end
      end
     
      if self.active and @help_window != nil
        update_help
      end
     
      update_cursor_rect
   
      if @index < 6 and self.oy != 35 + (4-@index) * @hauteur
        self.oy = -(35 + (4-@index) * @hauteur)
      end
    end
   
    def update_cursor_rect
      self.cursor_rect.empty
      row = @index / @column_max
      if row < self.top_row + 5
        self.top_row = row - 5
      end
      if row > self.top_row + (self.page_row_max - 5)
        self.top_row = row - (self.page_row_max - 5)
      end
    end
   
    def sprite_refresh
      for i in 0..4
        if not @show and $data_pokedex[@id_list[(@index+i-2)%@id_list.length]][0]
          @sprite_array[i].bitmap = RPG::Cache.battler("Front_Male/#{sprintf('%03d', @id_list[(@index+i-2)%@id_list.length])}.png", 0)
        elsif @show
          if $data_pokedex[@table[(@index+i-2)%(@table.index(@last)+1)]][0] #(@index+i-2)%@last + 1)
            @sprite_array[i].bitmap = RPG::Cache.battler("Front_Male/#{sprintf('%03d', @table[(@index+i-2)%@last])}.png", 0)
          else
            @sprite_array[i].bitmap = RPG::Cache.battler("Front_Male/000.png", 0)
          end
        end
      end
    end
   
    def refresh
      self.contents.clear
      normal_color = Color.new(60,60,60)
      self.contents.font.color = normal_color
      i = 0 # désigne l'entrée
     
      for value in @table
        if @id_list.include?(value)
          i += 1
          ida = sprintf("%03d", @table.index(value) + 1)
          string = "  N." + ida
          self.contents.draw_text(10, @hauteur * (i-1), 480, @hauteur, string)
          string = Pokemon_Info.name(value)
          self.contents.draw_text(110, @hauteur * (i-1), 300, @hauteur, string)
          if $data_pokedex[value][1]
            bitmap = RPG::Cache.picture("Pokedexball.png")
            self.contents.blt(80, 5 + @hauteur * (i-1), bitmap, Rect.new(0, 0, 24, 24))
          end
        elsif @show and i < @table.index(@last) + 1
          i += 1
          ida = sprintf("%03d", @table.index(value) + 1)
          string = "  N." + ida
          self.contents.draw_text(10, @hauteur * (i-1), 480, @hauteur, string)
          string = "-------"
          self.contents.draw_text(110, @hauteur * (i-1), 300, @hauteur, string)
        elsif i >= @table.index(@last) + 1
          break
        else
          next
        end
       
      end
    end
   
  end
end

Posté par MrWolfplayer97 le 28 Aoû - 08:04 (2012)
Il me dit qu'il y a une syntax error a la ligne 47 au démarage du jeu...
Je sais que je suis un peu ch**** mais bon j'y connais rien en script (pour le moment)

Posté par Opale le 28 Aoû - 09:58 (2012)
C'est normal, il y a du HTML qui s'est glissé à l'intérieur...

Posté par MrWolfplayer97 le 28 Aoû - 14:27 (2012)
Ce qui veut dire ? Car je ne voit pas de différence...

Voila les ligne a partir de 15 à 53:

Code:
# Liste 
      @list = [] 
      for i in <a href="mailto:0..@table.length">0..@table.length</a>-1 
        if $data_pokedex[@table[i]][0] 
          @list.push(@table[i]) # liste des ID vus 
        end 
      end 
      @pokemon_list = POKEMON_S::Pokemon_List.new(@table, @list, @index, @show) 
      @pokemon_list.active = true 

Posté par Rey' le 28 Aoû - 14:39 (2012)
MrWolfplayer97 a écrit:
Ce qui veut dire ? Car je ne voit pas de différence...

Voila les ligne a partir de 15 à 53:

Code:
# Liste 
      @list = [] 
      for i in <a href="mailto:0..@table.length">0..@table.length</a>-1 
        if $data_pokedex[@table[i]][0] 
          @list.push(@table[i]) # liste des ID vus 
        end 
      end 
      @pokemon_list = POKEMON_S::Pokemon_List.new(@table, @list, @index, @show) 
      @pokemon_list.active = true 


Regarde cette ligne : for i in "0..@table.length-1"
Elle comporte du code HTML.

Posté par Silver le 28 Aoû - 14:45 (2012)
Il faut remplacer cette ligne par :
for i in 0.. @table.length-1
Il a suffit de retirer les signes qui se trouvaient entre les < et >.
La balise code crée parfois ce genre de chose.

Posté par MrWolfplayer97 le 28 Aoû - 17:48 (2012)
Ah ok (on en apprend tout les jours...) Merci je vais test et je vous dit

EDIT: Super sa marche ! Juste pourquoi il met juste les ID en dessous du Pokémon connu en premier ?
(Un screen car je suis sur que je ne suis pas clair ^^)



Merci d'avance

Posté par Opale le 28 Aoû - 19:28 (2012)
Au dessus plutôt ?
C'est normal.
C'est pareil dans les jeux officiels. De plus, je ne vois pas à quoi ça servirait.

Posté par MrWolfplayer97 le 28 Aoû - 19:32 (2012)
Dans les jeux officiel il n'y a pas tout les ID déjà dispo ? (sans les info sur le pokémon) Sinon pourquoi il met juste les pokémon inconnus en dessous de l'ID de salamèche ?

Posté par The_Doctor le 29 Aoû - 13:01 (2012)
le truc met les info des pke connu et met les ID des pokemon se trouvant avant dans la liste du pokedex national c'esst out ce n'est pas un probleme il met l'ID et l'image de http://www.pokepedia.fr/index.php/Dix_points_d'interrogation

Posté par MrWolfplayer97 le 29 Aoû - 13:16 (2012)
Ah ok merci à tous pour votre aide !