Sujet n°7750
Posté par RevengeOfShadow le 4 Sep - 11:04 (2010)
Titre : [TUTO] Système de PCos
Bonjour à tous !
Comme en ce moment je suis à fond sur les tutos en voici un pour faire les boutiques avec un système de PCo !

I) Les pré-requis 

Niveau :
Nombre d'interrupteurs : 0
Nombre de variables : 2
Nombre d'events/events communs : 1
Nombre d'objets : 1
Autre : 1 Modification de script

II) Les scripts 

Dans le second script Interpreter (--- Système general).
Cherchez :
Code:

  #-----------------------------------------------------------------------------
  # draw_choice
  #   Fenêtre de choix Oui, non
  #-----------------------------------------------------------------------------   
  def draw_choice(arg1 = "OUI", arg2 = "NON")
    window = Window_Command.new(1, [arg1, arg2], $fontsizebig)
    width = [window.contents.text_size(arg1).width, window.contents.text_size(arg2).width].max + 16
    window.dispose
    @command = Window_Command.new(width + 32, [arg1, arg2], $fontsizebig)
    @command.x = 605 - width
    @command.y = 215
    @command.z = 10000
    loop do
      Graphics.update
      Input.update
      @command.update
      if Input.trigger?(Input::C) and @command.index == 0
        @command.dispose
        @command = nil
        #Input.update
        @wait_count = 2
        return true
      elsif Input.trigger?(Input::C) and @command.index == 1
        @command.dispose
        @command = nil
        #Input.update
        @wait_count = 2
        return false
      elsif Input.trigger?(Input::B)
        @command.dispose
        @command = nil
        #Input.update
        @wait_count = 2
        return false
      end
    end
  end


Ajouter après :
Code:

   def marchand_pco_ct(arg1 = "CT85    10PCo", arg2 = "CT44    20PCo", arg3 = "CT61    20PCo", arg4 = "CT38    30PCo", arg5 = "Quitter")
    window = Window_Command.new(1, [arg1, arg2, arg3, arg4, arg5], $fontsizebig)
    width = [window.contents.text_size(arg1).width, window.contents.text_size(arg2).width, window.contents.text_size(arg3).width, window.contents.text_size(arg4).width, window.contents.text_size(arg5).width].max + 16
    window.dispose
    @command = Window_Command.new(width + 32, [arg1, arg2, arg3, arg4, arg5], $fontsizebig)
    @command.x = 605 - width
    @command.y = 86
    loop do
      Graphics.update
      Input.update
      @command.update
      if Input.trigger?(Input::C) and @command.index == 0
        $game_variables[516] = 1
        @command.dispose
        @command = nil
        #Input.update
        @wait_count = 2
        return true
      end
      if Input.trigger?(Input::C) and @command.index == 1
        $game_variables[516] = 2
        @command.dispose
        @command = nil
        #Input.update
        @wait_count = 2
        return true
      end
      if Input.trigger?(Input::C) and @command.index == 2
        $game_variables[516] = 3
        @command.dispose
        @command = nil
        #Input.update
        @wait_count = 2
        return true
      end
      if Input.trigger?(Input::C) and @command.index == 3
        $game_variables[516] = 4
        @command.dispose
        @command = nil
        #Input.update
        @wait_count = 2
        return true
      end
      if Input.trigger?(Input::C) and @command.index == 4
        @command.dispose
        @command = nil
        #Input.update
        @wait_count = 2
        return false
      end
    end
  end


Pour la syntaxe, un excellent tuto de Sphinx de Pokemon Script Project : ./1144.html

III) Les objets 

Créez un nouvel objet comme ceci :


IV) Les events 

Créez un nouvel event comme ceci :





Ce sera tout pour ce tuto ! Merci à tous de l'avoir suivi ...


Ce tuto provient de mon forum.

Posté par Sphinx le 7 Sep - 13:18 (2010)
J'aurais juste une question : qu'est-ce qu'un PCo ? xP

Posté par Nuri Yuri le 7 Sep - 22:39 (2010)
Les points de combats que tu gagne dans la zone de combat (DPP/HGSS).

Posté par RevengeOfShadow le 9 Sep - 18:16 (2010)
Après faut réaliser le système de tour de combat mais en events ça va Clin d'œil foireux.