J'ai un prob avec le script OmegaX Achivements. Voilà le script:
Spoiler:
# ============================================================================= # Game Achievements # Version: 1.1 # Author: Omegas7 # Site: http://omegas7.blogspot.com || http://omegadev.biz # ----------------------------------------------------------------------------- # Features: # > 1.1 # > Achievements linked to game switches # > Achievement Bar appears when achievement switch activated # > Menu showing achievements separated by All, Unlocked and Locked. # > Achievements descriptions # > Achievements descriptions can have a background image # > Each achievement is represented by a 90x90 image # > Menu background image # > Locked achievement image (90x90) # > Achievements menu cursor is an image (90x90) # > Achievement bar image # > Achievement complete & incomplete graphic for description screen # ----------------------------------------------------------------------------- # Instructions # First, this will be the basic template for your achievement: # # Achievements[ID] = ["Name","GaphicName",SwitchID] # Descriptions[ID] = ["Line1","Line2","Line3"] # # ID = ID of achievement for the script to use. Each achievement has one # unique ID number. Starting from 0. # "Name" => Name displayed for the achievement. Inside quotes " " # "GraphicnName" => 90x90 graphic name located in [Pictures] folder # inside quotes " " # SwitchID => ID of game switch you want to link this achievement to. # You can add as many Description lines as you want. # Each line is inside quotes " ", and each line is separated by a comma. # =============================================================================
AchievementIsCompleteGraphic = "AchievementCompleted" # [Pictures] folder AchievementIsIncompleteGraphic = "AchievementIncomplete" # [Pictures] folder # That last two graphics will appear at the bottom right of the screen # when used *
Achievements[2] = ["Tête de prix","Trophy5",3] Descriptions[2] = ["Vaincre la capitaine de Werc.","Difficulté : Moyen"]
Achievements[3] = ["Riche avec un ''R''","Trophy4",8] Descriptions[3] = ["Obtenir 5000$.","Difficulté : Moyen-Difficile"]
Achievements[4] = ["Vers à terre",9] Descriptions[4] = ["Vaincre 5 vers de terre.","Difficulté : Moyen"] end
class Achievements < Scene_Base include AchievementsDATA def initialize create_background create_menu create_trohpies @view = 'NONE' @chosen = false @locked = 0 @unlocked = 0 for i in 0...Achievements.size if $game_switches[Achievements[i][2]] @unlocked += 1 else @locked += 1 end end end def update updateInput updateMenus if !@chosen @chosen = false end def updateMenus case @view when 'NONE' @menu.update when 'TROPHIES' @trophyMenu.update end end def updateInput if Input.trigger?(Input::C) && @view == 'NONE' case @menu.index when 0 # All @view = 'TROPHIES' @trophyMenu.setView('all') @trophyMenu.setOpacity(255) Sound.play_decision @chosen = true return when 1 # Unlocked if @unlocked <= 0 Sound.play_buzzer return end @view = 'TROPHIES' @trophyMenu.setView('unlocked') @trophyMenu.setOpacity(255) Sound.play_decision @chosen = true return when 2 # Locked if @locked <= 0 Sound.play_buzzer return end @view = 'TROPHIES' @trophyMenu.setView('locked') @trophyMenu.setOpacity(255) Sound.play_decision @chosen = true return when 3 # Exit @trophyMenu.finish @bg.dispose @menu.dispose $scene = Scene_Map.new @chosen = true return end end if Input.trigger?(Input::B) && @view == 'NONE' @trophyMenu.finish @bg.dispose @menu.dispose $scene = Scene_Map.new @chosen = true return end if Input.trigger?(Input::B) && @view == 'TROPHIES' && !@trophyMenu.description? @view = 'NONE' @trophyMenu.setOpacity(0) Sound.play_cancel end end def create_background @bg = Sprite_Base.new @bg.bitmap = Cache.picture(MenuBackground) @bg.z = 0 end def create_menu commands = ['All','Unlocked','Locked','Back'] @menu = Window_Command.new(130,commands) @menu.contents.font.size = 20 @menu.refresh @menu.opacity = 0 @menu.z = 9 end def create_trohpies @trophyMenu = AchievementTrophyMenuManager.new @trophyMenu.setOpacity(0) end end
class AchievementTrophyMenuManager include AchievementsDATA def initialize @trophies = [] draw_trophies('all') @moved_y = 0 if !@trophies.empty? @cursor = Sprite_Base.new @cursor.bitmap = Cache.picture(TrophyCursorGraphic) @cursor.z = 2 @cursor.x,@cursor.y = @trophies[0].sprite.x,@trophies[0].sprite.y end @cursorIndex = 0 @toBeY = 0 @viewingDescription = false @description = Sprite_Base.new @description.bitmap = Cache.picture(DescriptionScreenGraphic) @description.z = 100 @description.opacity = 0 @descriptionWindow = Window_Base.new(30,90,544 - 60,270) @descriptionWindow.opacity = 0 @name = Window_Base.new(12,-12,300,90) @name.contents.font.size = 18 @name.opacity = 0 @block = false end def draw_trophies(view) @trophies = [] @chart = [] trueIndex = 0 for i in 0...Achievements.size if $game_switches[Achievements[i][2]] if view == 'all' || view == 'unlocked' @trophies.push(AchievementTrophy.new(trueIndex,true,Achievements[i][0])) @chart.push(Descriptions[i]) trueIndex += 1 end else if view == 'all' || view == 'locked' @trophies.push(AchievementTrophy.new(trueIndex,false,Achievements[i][0])) @chart.push(Descriptions[i]) trueIndex += 1 end end end end def update if !@viewingDescription if Input.trigger?(Input::DOWN) Sound.play_cursor @cursorIndex += 4 end if Input.trigger?(Input::UP) Sound.play_cursor @cursorIndex -= 4 end if Input.trigger?(Input::RIGHT) Sound.play_cursor @cursorIndex += 1 end if Input.trigger?(Input::LEFT) Sound.play_cursor @cursorIndex -= 1 end checkCursorPosition if Input.trigger?(Input::C) @descriptionWindow.contents.clear @name.contents.clear @description.opacity = 255 for i in 0...@chart[@cursorIndex].size @descriptionWindow.contents.draw_text(0,(20 * i),500,20,@chart[@cursorIndex][i].to_s) end @viewingDescription = true @block = true @name.contents.draw_text(0,0,300,20,@trophies[@cursorIndex].name) @completed = Sprite_Base.new if @trophies[@cursorIndex].obtained @completed.bitmap = Cache.picture(AchievementIsCompleteGraphic) else @completed.bitmap = Cache.picture(AchievementIsIncompleteGraphic) end @completed.x = 544 - @completed.width @completed.y = 416 - @completed.height @completed.z = 300 return end else if (Input.trigger?(Input::C) || Input.trigger?(Input::B)) && !@block Sound.play_cancel @descriptionWindow.contents.clear @name.contents.clear @description.opacity = 0 @viewingDescription = false @completed.dispose @completed = nil return end end @block = false if Input.trigger?(Input::L) print @description.opacity end end def description? return @viewingDescription end def checkCursorPosition if @cursorIndex < 0 @cursorIndex = 0 end if @cursorIndex > @trophies.size - 1 @cursorIndex = @trophies.size - 1 end @toBeY = @trophies[@cursorIndex].sprite.y a = false while @toBeY >= 10 + (90 * 4) moveY(-90) a = true end if !a while @toBeY < 10 moveY(90) end end @cursor.x = @trophies[@cursorIndex].sprite.x @cursor.y = @trophies[@cursorIndex].sprite.y end def moveY(y) for i in 0...@trophies.size @trophies[i].sprite.y += y @toBeY += y end end def setOpacity(n) for i in 0...@trophies.size @trophies[i].sprite.opacity = n end @cursor.opacity = n end def setView(view) for i in 0...@trophies.size @trophies[i].sprite.dispose @trophies[i] = nil end @cursorIndex = 0 @trophies.compact! @chart = [] draw_trophies(view) end def finish @cursor.dispose for i in 0...@trophies.size @trophies[i].sprite.dispose @trophies[i] = nil end @trophies.compact! @description.dispose @descriptionWindow.dispose @name.dispose end end
class AchievementTrophy include AchievementsDATA attr_accessor :sprite attr_reader :obtained attr_reader :name def initialize(index,obtained,name) @sprite = Sprite_Base.new if obtained @sprite.bitmap = Cache.picture(Achievements[index][1]) else @sprite.bitmap = Cache.picture(LockedTrohyGraphic) end @sprite.z = 1 @sprite.x = 180 + (90 * (index % 4)) @sprite.y = 10 + (90 * (index / 4)) @obtained = obtained @name = name end end
class Game_Party alias omega_achievements_initialize initialize attr_accessor :achievements def initialize omega_achievements_initialize @achievements = [] for i in 0...AchievementsDATA::Achievements.size @achievements.push([AchievementsDATA::Achievements[i][2], $game_switches[AchievementsDATA::Achievements[i][2]]]) end end end
class AchievementBar include AchievementsDATA attr_reader :finished def initialize(id) @sprite = Sprite_Base.new @sprite.bitmap = Cache.picture(AchievementBarGraphic) @sprite.z = 300 @sprite.x = 272 - (@sprite.width/2) @sprite.y = 416 - @sprite.height @sprite.zoom_x = 0.1 @sprite.zoom_y = 0.1 @timer = -1 @leaving = false @finished = false end def update if @sprite.zoom_x < 1.0 @sprite.zoom_x += 0.05 @sprite.zoom_y += 0.05 if @sprite.zoom_x >= 1.0 @timer = 140 end end if @timer > 0 @timer -= 1 else if !@leaving && @sprite.zoom_x >= 1.0 @leaving = true end end if @leaving @sprite.opacity -= 3 if (@sprite.opacity <= 0) && (!@finished) finish end end end def finish @sprite.dispose @finished = true end end
class Scene_Map alias omegaAchievementInitialize initialize alias omegaAchievementUpdate update alias omegaAachievementTerminate terminate def initialize omegaAchievementInitialize @achievements = [] end def update omegaAchievementUpdate for i in 0...@achievements.size @achievements[i].update if @achievements[i].finished @achievements[i] = nil end end @achievements.compact! end def terminate omegaAachievementTerminate for i in 0...@achievements.size @achievements[i].finish end end def addAchievementBar(id) @achievements.push(AchievementBar.new(id)) end end
class Game_Interpreter alias omegaAchievementsSwitch command_121 def command_121 omegaAchievementsSwitch if $scene.is_a?(Scene_Map) for i in 0...$game_party.achievements.size if $game_party.achievements[i][1] != $game_switches[$game_party.achievements[i][0]] if $game_switches[$game_party.achievements[i][0].to_i] $game_party.achievements[i][1] = $game_switches[$game_party.achievements[i][0]] $scene.addAchievementBar(i) break end end end end end end
Lorsque que je le mets, ya ça:
C'est là que c'est incompatible :
Voyez vous quelque chose qui cloche?
Please aidez moi.
Invité
Invité
Sujet: Re: Script problème Dim 7 Oct 2012 - 16:16
Le problème vient du script Omega
JSAJHIJACM
Poulet carnivore Lv.2
Inscrit le : 27/07/2012 Messages : 24
Sujet: Re: Script problème Dim 7 Oct 2012 - 17:40
je crois comprendre quand je mets un cinquième succès le message s'est affiché quand je l'enlève non.
Mais je ne veux pas un jeu entier avec 4 succès, alors aidez moi SVP.
nuki
Citadin Lv.7
Age : 35 Inscrit le : 17/05/2010 Messages : 212
Sujet: Re: Script problème Dim 7 Oct 2012 - 19:13
Ce que Grim voulait dire c'est que sans le script original c'est un peu compliqué de trouver le problème.
JSAJHIJACM
Poulet carnivore Lv.2
Inscrit le : 27/07/2012 Messages : 24
Sujet: Re: Script problème Lun 8 Oct 2012 - 13:13
voilà le script original :
Code:
# ============================================================================= # Game Achievements # Version: 1.1 # Author: Omegas7 # Site: http://omegas7.blogspot.com || http://omegadev.biz # ----------------------------------------------------------------------------- # Features: # > 1.1 # > Achievements linked to game switches # > Achievement Bar appears when achievement switch activated # > Menu showing achievements separated by All, Unlocked and Locked. # > Achievements descriptions # > Achievements descriptions can have a background image # > Each achievement is represented by a 90x90 image # > Menu background image # > Locked achievement image (90x90) # > Achievements menu cursor is an image (90x90) # > Achievement bar image # > Achievement complete & incomplete graphic for description screen # ----------------------------------------------------------------------------- # Instructions # First, this will be the basic template for your achievement: # # Achievements[ID] = ["Name","GaphicName",SwitchID] # Descriptions[ID] = ["Line1","Line2","Line3"] # # ID = ID of achievement for the script to use. Each achievement has one # unique ID number. Starting from 0. # "Name" => Name displayed for the achievement. Inside quotes " " # "GraphicnName" => 90x90 graphic name located in [Pictures] folder # inside quotes " " # SwitchID => ID of game switch you want to link this achievement to. # You can add as many Description lines as you want. # Each line is inside quotes " ", and each line is separated by a comma. # =============================================================================
AchievementIsCompleteGraphic = "AchievementCompleted" # [Pictures] folder AchievementIsIncompleteGraphic = "AchievementIncomplete" # [Pictures] folder # That last two graphics will appear at the bottom right of the screen # when used *
Achievements = [] Descriptions = []
Achievements[0] = ["Greedy Ralph","Trophy",1] Descriptions[0] = ["Open 5 chests!","Commonly known as a noob-level achievement."]
Achievements[1] = ["Defeat Gary","Trophy",2] Descriptions[1] = ["Beat evil Gary at the garden!"]
Achievements[2] = ["LOVE OMEGAS7","Trophy",3] Descriptions[2] = ["Show your love for Omegas7 to a stranger."] end
class Achievements < Scene_Base include AchievementsDATA def initialize create_background create_menu create_trohpies @view = 'NONE' @chosen = false @locked = 0 @unlocked = 0 for i in 0...Achievements.size if $game_switches[Achievements[i][2]] @unlocked += 1 else @locked += 1 end end end def update updateInput updateMenus if !@chosen @chosen = false end def updateMenus case @view when 'NONE' @menu.update when 'TROPHIES' @trophyMenu.update end end def updateInput if Input.trigger?(Input::C) && @view == 'NONE' case @menu.index when 0 # All @view = 'TROPHIES' @trophyMenu.setView('all') @trophyMenu.setOpacity(255) Sound.play_decision @chosen = true return when 1 # Unlocked if @unlocked <= 0 Sound.play_buzzer return end @view = 'TROPHIES' @trophyMenu.setView('unlocked') @trophyMenu.setOpacity(255) Sound.play_decision @chosen = true return when 2 # Locked if @locked <= 0 Sound.play_buzzer return end @view = 'TROPHIES' @trophyMenu.setView('locked') @trophyMenu.setOpacity(255) Sound.play_decision @chosen = true return when 3 # Exit @trophyMenu.finish @bg.dispose @menu.dispose $scene = Scene_Map.new @chosen = true return end end if Input.trigger?(Input::B) && @view == 'NONE' @trophyMenu.finish @bg.dispose @menu.dispose $scene = Scene_Map.new @chosen = true return end if Input.trigger?(Input::B) && @view == 'TROPHIES' && !@trophyMenu.description? @view = 'NONE' @trophyMenu.setOpacity(0) Sound.play_cancel end end def create_background @bg = Sprite_Base.new @bg.bitmap = Cache.picture(MenuBackground) @bg.z = 0 end def create_menu commands = ['All','Unlocked','Locked','Back'] @menu = Window_Command.new(130,commands) @menu.contents.font.size = 20 @menu.refresh @menu.opacity = 0 @menu.z = 9 end def create_trohpies @trophyMenu = AchievementTrophyMenuManager.new @trophyMenu.setOpacity(0) end end
class AchievementTrophyMenuManager include AchievementsDATA def initialize @trophies = [] draw_trophies('all') @moved_y = 0 if !@trophies.empty? @cursor = Sprite_Base.new @cursor.bitmap = Cache.picture(TrophyCursorGraphic) @cursor.z = 2 @cursor.x,@cursor.y = @trophies[0].sprite.x,@trophies[0].sprite.y end @cursorIndex = 0 @toBeY = 0 @viewingDescription = false @description = Sprite_Base.new @description.bitmap = Cache.picture(DescriptionScreenGraphic) @description.z = 100 @description.opacity = 0 @descriptionWindow = Window_Base.new(30,90,544 - 60,270) @descriptionWindow.opacity = 0 @name = Window_Base.new(12,-12,300,90) @name.contents.font.size = 18 @name.opacity = 0 @block = false end def draw_trophies(view) @trophies = [] @chart = [] trueIndex = 0 for i in 0...Achievements.size if $game_switches[Achievements[i][2]] if view == 'all' || view == 'unlocked' @trophies.push(AchievementTrophy.new(trueIndex,true,Achievements[i][0])) @chart.push(Descriptions[i]) trueIndex += 1 end else if view == 'all' || view == 'locked' @trophies.push(AchievementTrophy.new(trueIndex,false,Achievements[i][0])) @chart.push(Descriptions[i]) trueIndex += 1 end end end end def update if !@viewingDescription if Input.trigger?(Input::DOWN) Sound.play_cursor @cursorIndex += 4 end if Input.trigger?(Input::UP) Sound.play_cursor @cursorIndex -= 4 end if Input.trigger?(Input::RIGHT) Sound.play_cursor @cursorIndex += 1 end if Input.trigger?(Input::LEFT) Sound.play_cursor @cursorIndex -= 1 end checkCursorPosition if Input.trigger?(Input::C) @descriptionWindow.contents.clear @name.contents.clear @description.opacity = 255 for i in 0...@chart[@cursorIndex].size @descriptionWindow.contents.draw_text(0,(20 * i),500,20,@chart[@cursorIndex][i].to_s) end @viewingDescription = true @block = true @name.contents.draw_text(0,0,300,20,@trophies[@cursorIndex].name) @completed = Sprite_Base.new if @trophies[@cursorIndex].obtained @completed.bitmap = Cache.picture(AchievementIsCompleteGraphic) else @completed.bitmap = Cache.picture(AchievementIsIncompleteGraphic) end @completed.x = 544 - @completed.width @completed.y = 416 - @completed.height @completed.z = 300 return end else if (Input.trigger?(Input::C) || Input.trigger?(Input::B)) && !@block Sound.play_cancel @descriptionWindow.contents.clear @name.contents.clear @description.opacity = 0 @viewingDescription = false @completed.dispose @completed = nil return end end @block = false if Input.trigger?(Input::L) print @description.opacity end end def description? return @viewingDescription end def checkCursorPosition if @cursorIndex < 0 @cursorIndex = 0 end if @cursorIndex > @trophies.size - 1 @cursorIndex = @trophies.size - 1 end @toBeY = @trophies[@cursorIndex].sprite.y a = false while @toBeY >= 10 + (90 * 4) moveY(-90) a = true end if !a while @toBeY < 10 moveY(90) end end @cursor.x = @trophies[@cursorIndex].sprite.x @cursor.y = @trophies[@cursorIndex].sprite.y end def moveY(y) for i in 0...@trophies.size @trophies[i].sprite.y += y @toBeY += y end end def setOpacity(n) for i in 0...@trophies.size @trophies[i].sprite.opacity = n end @cursor.opacity = n end def setView(view) for i in 0...@trophies.size @trophies[i].sprite.dispose @trophies[i] = nil end @cursorIndex = 0 @trophies.compact! @chart = [] draw_trophies(view) end def finish @cursor.dispose for i in 0...@trophies.size @trophies[i].sprite.dispose @trophies[i] = nil end @trophies.compact! @description.dispose @descriptionWindow.dispose @name.dispose end end
class AchievementTrophy include AchievementsDATA attr_accessor :sprite attr_reader :obtained attr_reader :name def initialize(index,obtained,name) @sprite = Sprite_Base.new if obtained @sprite.bitmap = Cache.picture(Achievements[index][1]) else @sprite.bitmap = Cache.picture(LockedTrohyGraphic) end @sprite.z = 1 @sprite.x = 180 + (90 * (index % 4)) @sprite.y = 10 + (90 * (index / 4)) @obtained = obtained @name = name end end
class Game_Party alias omega_achievements_initialize initialize attr_accessor :achievements def initialize omega_achievements_initialize @achievements = [] for i in 0...AchievementsDATA::Achievements.size @achievements.push([AchievementsDATAAchievements[i][2], $game_switches[AchievementsDATAAchievements[i][2]]]) end end end
class AchievementBar include AchievementsDATA attr_reader :finished def initialize(id) @sprite = Sprite_Base.new @sprite.bitmap = Cache.picture(AchievementBarGraphic) @sprite.z = 300 @sprite.x = 272 - (@sprite.width/2) @sprite.y = 416 - @sprite.height @sprite.zoom_x = 0.1 @sprite.zoom_y = 0.1 @timer = -1 @leaving = false @finished = false end def update if @sprite.zoom_x < 1.0 @sprite.zoom_x += 0.05 @sprite.zoom_y += 0.05 if @sprite.zoom_x >= 1.0 @timer = 140 end end if @timer > 0 @timer -= 1 else if !@leaving && @sprite.zoom_x >= 1.0 @leaving = true end end if @leaving @sprite.opacity -= 3 if (@sprite.opacity <= 0) && (!@finished) finish end end end def finish @sprite.dispose @finished = true end end
class Scene_Map alias omegaAchievementInitialize initialize alias omegaAchievementUpdate update alias omegaAachievementTerminate terminate def initialize omegaAchievementInitialize @achievements = [] end def update omegaAchievementUpdate for i in 0...@achievements.size @achievements[i].update if @achievements[i].finished @achievements[i] = nil end end @achievements.compact! end def terminate omegaAachievementTerminate for i in 0...@achievements.size @achievements[i].finish end end def addAchievementBar(id) @achievements.push(AchievementBar.new(id)) end end
class Game_Interpreter alias omegaAchievementsSwitch command_121 def command_121 omegaAchievementsSwitch if $scene.is_a?(Scene_Map) for i in 0...$game_party.achievements.size if $game_party.achievements[i][1] != $game_switches[$game_party.achievements[i][0]] if $game_switches[$game_party.achievements[i][0].to_i] $game_party.achievements[i][1] = $game_switches[$game_party.achievements[i][0]] $scene.addAchievementBar(i) break end end end end end end