Sujet n°8821
Posté par Warp' le 28 Déc - 18:52 (2010)
Titre : Choix OUI/NON en image dans les combats
Bonjour à vous. Voici un script que vous comprendrez lorsque vous verrez la vidéo.

1.Le Script
Il faut remplacer, dans le script Pokemon_Battle_Core1*, ceci :
 
Spoiler

Code:


     def draw_choice
      @command = Window_Command.new(50, ["OUI", "NON"], $fontsizebig)
      @command.x = 217
      @command.y = 94
      loop do
        Graphics.update
        Input.update
        @command.update
        if Input.trigger?(Input::C) and @command.index == 0
          $game_system.se_play($data_system.decision_se)
          @command.dispose
          @command = nil
          Input.update
          return true
        end
        if Input.trigger?(Input::C) and @command.index == 1
          $game_system.se_play($data_system.decision_se)
          @command.dispose
          @command = nil
          Input.update
          return false
        end 

      
 
par ceci :  
 
Spoiler

Code:

     def draw_choice
    @command = Window_Command.new(50, ["OUI", "NON"], $fontsizebig)
    @command.x = 13
    @command.y = 13 
    @command.index = 0
    @command.z = @z_level + 10
    @command.visible = false
      
    @backchoice = Sprite.new
    @backchoice.bitmap = RPG::Cache.picture("BATTLE OUI NON")
    @backchoice.x = 13
    @backchoice.y = 227
    @backchoice.z = @z_level + 1000
      
    @select_choice = Sprite.new
    @select_choice.bitmap = RPG::Cache.picture("BATTLE OUI NON_c")
    @select_choice.x = 36
    @select_choice.y = 278
    @select_choice.z = @z_level + 1100
    
    loop do           
      if @command.index == 0
        @select_choice.y = 278
      elsif @command.index == 1
        @select_choice.y = 326
      end              
      Graphics.update
      Input.update
      @command.update
      if Input.trigger?(Input::C) and @command.index == 0
        $game_system.se_play($data_system.decision_se) 
        @command.dispose
        @backchoice.dispose
        @select_choice.dispose
        Input.update
        return true
      end
      if Input.trigger?(Input::C) and @command.index == 1
        $game_system.se_play($data_system.decision_se)    
        @command.dispose
        @backchoice.dispose
        @select_choice.dispose
        Input.update          
        return false
      end
    
 
2.Les images
Voici les deux images nécessaires à placer dans le dossier Pictures.
La première doit être nommée BATTLE OUI NON.png et la seconde BATTLE OUI NON_c.png
Images




3.Vidéo
Voici un aperçu du script. Vous verrez ce que ça donne à la fin de la vidéo. 

    


         

Posté par Ashikata le 28 Déc - 18:56 (2010)
Ah cool !
Merci de l'avoir fait je trouvais vraiment le petit cadre blanc pas beau et vu que j'ai aucune compétence (même infime) en script... =/
J'espère que Palb' l'ajoutera à la prochaine version de PSP DS pour pas avoir à le mettre à chaque fois.

Posté par Master of Dragons le 28 Déc - 18:56 (2010)
C'est sympa  Clin d'œil foireux
Un petit plus qui peut, qui va surement servir ^^

Posté par Warp' le 28 Déc - 18:57 (2010)
Merci à vous.
Moi aussi le petit carré blanc m'énervait... XD