Sujet n°1768
Posté par Suicune31 le 14 Sep - 01:54 (2008)
Titre : [OK] L'écran titre ne s'affiche pas
Bonjour :D

voilà j'ai pitit problème :( . c'est que aprés ma Scene d'intro . . . Mon écrans titre ne s'afiche pas . Meme si je fait (Retour a l'ecrans titire ou si je fait $scene = Scene_Title.new" Sa m'amene toujours la :

Spoiler




Et je suis sur PSP v 0.7 .. et je c'est que le script "Scene_Title" n'est pas le meme que celui de PSP 4G . . . (jose pas le modifié) vu que j'ais vu qu'il y a la sauvegarde de secours . Je ne veux pas trafiqué qu'elle que chose :mdr: .

Serait-il possible de modifié le script de PSP 0.7 pour avoir l'écrans titre de comme dans PSP 4G . tout en gardant les ajout de la Màj de PSP 0.7 ?

Posté par Krosk le 14 Sep - 10:41 (2008)
Oui, soit tu installe le correctif 2 en le téléchargeant, soit tu effectue les modifications manuellement ./1723-Corrections-manuelles-a-apporter…. Ou peut etre que c'est déjà installé.

Et dans cette maj, il y a un mode qui s'appelle MAPINTRO dans config panel:
Code:
  # --------------------------------------------------------
  # MAPINTRO
  #   - Ecrivez [numéro de map, position x, position y]
  #     si vous voulez spécifiez une intro faite sur une map de votre choix.
  #     Ecrivez false sinon : l'intro en script sera utilisée
  #     Exemple : [5, 12, 13] => commence une intro sur la map 5, x=12, y=13
  #   - Quand votre intro est terminée, inscrivez
  # --------------------------------------------------------
  MAPINTRO = false


C'est la même fonction que Scene_Intro (que tu va devoir supprimer, et remettre Scene_Title.new dans le script main. Ainsi, quand tu referra "retour à l'écran titre", ca retournera bien au titre avec l'intro.

Posté par Suicune31 le 15 Sep - 16:48 (2008)
Arf . j'y suis toujours pas arriver Pleurnicheur .

et il y a déja Scene_Title.new dans main

Posté par Krosk le 15 Sep - 16:56 (2008)
A faire marcher ou à installer le correctif?

Posté par Suicune31 le 15 Sep - 20:53 (2008)
A le faire marché

Enfaite j'ai pas vraiment compris ce  qu'il fallait faire exactement . . . Trop noob :cry:

Posté par Krosk le 15 Sep - 23:12 (2008)
As tu compris ce qu'il faut écrire en face de MAPINTRO dans le script config Panel? As tu écrit quelque chose?

Posté par Suicune31 le 16 Sep - 12:39 (2008)
Dans MAP intro j'ai mis


 
Spoiler
 
Code:
   # --------------------------------------------------------
   # MAPINTRO
   #   - Ecrivez [numéro de map, position x, position y]
   #     si vous voulez spécifiez une intro faite sur une map de votre choix.
   #     Ecrivez false sinon : l'intro en script sera utilisée
   #     Exemple : [5, 12, 13] => commence une intro sur la map 5, x=12, y=13
   #   - Quand votre intro est terminée, inscrivez
   # --------------------------------------------------------
   MAPINTRO = [1, 12, 13]
  

Mais sa je sais que c'est pour l'intro . . .

Donc c'est pour ça que je comprend pas . si je mets pas ça l'intro s'affichera plus nan ?

Posté par Krosk le 16 Sep - 12:52 (2008)
Citation:
# Ecrivez false sinon : l'intro en script sera utilisée


C'est écrit que si tu ne mets pas d'intro sur une map, l'intro en script (celle que j'ai programmée avec le giratina) s'affiche.

Si tu mets une intro sur une carte, l'intro avec giratina ne s'affichera pas.


Si tu veux à la fois les 2 (ce que je n'avais pas compris, car si tu fais une intro sur map, tu peux AUSSI faire un écran titre sur cette même map), dans le script Scene_Title ligne 55
Code:
    if not @auto_load and not MAPINTRO

remplace par
Code:
    if not @auto_load

Posté par Suicune31 le 16 Sep - 12:57 (2008)
ça commence directement sur l'intro de giratina :(

Je te montre tout mes script concernant l'intro et l'écran titre ?

(on va y arriver jesper xD)

EDIT : Dois-je faire l'écrans titre par event ? comme mon intro ?

je fait une boucle avec : afficher image1 attendre afficher image2  attendre

Posté par Krosk le 16 Sep - 13:22 (2008)
Pas besoin de me montrer les scripts, je les connais.

Pour ma part, le plus sage est de faire un ecran titre en event, tu aura plus de contrôle dessus sur les images que tu veux faire.

Si tu compte quand même utiliser l'intro scriptée avec giratina, essaie de remplacer dans Scene Title de la ligne 55 à 279:
Spoiler
Code:

    if MAPINTRO.type == Array and $_temp_map_intro == nil
      $_temp_map_intro = true
      $map_link = {}
      Audio.bgm_stop
      Graphics.frame_count = 0
      $game_temp          = Game_Temp.new
      $game_system        = Game_System.new
      $game_switches      = Game_Switches.new
      $game_variables     = Game_Variables.new
      $game_self_switches = Game_SelfSwitches.new
      $game_screen        = Game_Screen.new
      $game_actors        = Game_Actors.new
      $game_party         = Game_Party.new
      $game_troop         = Game_Troop.new
      $game_map           = Game_Map.new
      $game_player        = Game_Player.new
      # ---- Pas forcément nécessaire
      $pokemon_party = POKEMON_S::Pokemon_Party.new
      $data_storage = [[0]]
      $pokemon_party.create_box
      Player.set_trainer_code(rand(2**32))
      $random_encounter = Array.new(7)
      $random_encounter[0] = 0
      $battle_var = POKEMON_S::Pokemon_Battle_Variable.new
      $existing_pokemon = []
      $string = []
      POKEMON_S::set_SAVESLOT = @index
      Player.trainer_trade_code
      # ---- Pas forcément nécessaire
      $game_party.setup_starting_members
      $game_map.setup(MAPINTRO[0])
      $game_player.moveto(MAPINTRO[1], MAPINTRO[2])
      $game_player.refresh
      $game_map.autoplay
      $game_map.update
      $scene = Scene_Map.new
      return
    else
      # -----------------------------------------------------------------
      #     La scène d'intro commence ici (non MAPINTRO)
      # -----------------------------------------------------------------
      # Elle est bien sûr modifiable à votre goût.
      # -----------------------------------------------------------------
      view = Viewport.new(0,0,640,480)
      view.z = -5
      #view = Viewport.new(0,25,640,430)
      #view.z = 0
      background = Plane.new(view)
      background.bitmap = RPG::Cache.title("Opening2.jpg")
      #background.oy += 25
      background.z = 0
      background.tone = Tone.new(0,0,0,255)
     
      #view = Viewport.new(0,0,640,480)
      #view.z = -5
      #background_bis = Plane.new(view)
      #background_bis.bitmap = RPG::Cache.title("Opening2.jpg")
      #background_bis.z = -5
     
      band_top = Sprite.new
      band_top.bitmap = RPG::Cache.title("Opening3.png")
      band_top.z = 5
      band_bottom = Sprite.new
      band_bottom.bitmap = RPG::Cache.title("Opening3.png")
      band_bottom.z = 5
      band_bottom.y = 450
     
      band_mid = Plane.new(Viewport.new(0,0,640,480))
      band_mid.bitmap = RPG::Cache.title("Opening4.png")
      band_mid.z = 5
     
      middle = Sprite.new
      middle.bitmap = RPG::Cache.title("Opening1.png")
      middle.z = 2
     
      title1 = Sprite.new
      title1.bitmap = RPG::Cache.title("Opening6.png")
      title1.z = 3
      title1.opacity = 0
      title1.color = Color.new(255,255,255,255)
     
      title2 = Sprite.new
      title2.bitmap = RPG::Cache.title("Opening7.png")
      title2.z = 4
      title2.opacity = 0
      title2.color = Color.new(255,255,255,255)
     
      flash = Sprite.new
      flash.bitmap = RPG::Cache.title("Opening8.png")
      flash.z = 10
      flash.opacity = 0
     
      mid = Sprite.new
      mid.bitmap = RPG::Cache.title("Opening5.png")
      mid.z = 5
      mid.visible = false
     
      screen = Sprite.new
      screen.bitmap = RPG::Cache.title("Opening10.png")
      screen.z = 2
      screen.visible = false
     
      start = Sprite.new
      start.bitmap = RPG::Cache.title("Opening11.png")
      start.z = 5
      start.visible = false
     
      Graphics.transition(5)
     
      $game_system.bgm_play($data_system.title_bgm)
      Audio.me_stop
      Audio.bgs_stop
     
      timer = 0
      loop do
        Graphics.update
        Input.update
       
        timer += 1
        background.ox -= 12
        #background_bis.ox += 6
       
        if timer == 210
          background.tone.gray = 0
        end
       
        if timer > 210 and background.tone.red > 0
          background.tone.red -= 25
          background.tone.green -= 25
        end
         
        if timer > 210 and timer % (150 + rand(50)) == 0
          background.tone.red = background.tone.green = 250
        end
       
        if flash.opacity > 0
          flash.opacity -= 15
        end
       
        if timer > 5 and not band_top.disposed?
          band_top.x += 13
          if band_top.x > 640
            band_top.dispose
          end
        end
       
        if timer > 73 and not band_bottom.disposed?
          band_bottom.x -= 13
          if band_bottom.x < -640
            band_bottom.dispose
          end
        end
       
        if timer > 150 and not band_mid.disposed?
          band_mid.ox -= 20
          if timer > 210
            band_mid.dispose
            mid.visible = true
          end
        end
       
        if timer > 210 and not title1.disposed? and title1.opacity < 255
          title1.opacity += 15
          title1.color.alpha -= 15
        end
       
        if timer > 240 and not title1.disposed? and title1.opacity == 255
          title1.color.alpha += 15
        end
       
        if timer == 270
          flash.opacity = 255
          title1.dispose
          mid.dispose
          middle.dispose
          screen.visible = true
        end
       
        if timer > 270 and not title2.disposed? and title2.opacity < 255
          title2.opacity += 15
          title2.color.alpha -= 15
          if title2.opacity >= 255
            title2.dispose
          end
        end
       
        if timer > 290 and timer%20 == 0
          start.visible = !start.visible
        end
       
        if Input.trigger?(Input::C)
          $game_system.se_play($data_system.decision_se)
          break
        end
       
        if timer > 3750
          Audio.bgm_fade(1000*5)
        end
       
      end
     
      Graphics.freeze
      background.dispose if not background.disposed?
      #background_bis.dispose if not background_bis.disposed?
      band_top.dispose if not band_top.disposed?
      band_bottom.dispose if not band_bottom.disposed?
      band_mid.dispose if not band_mid.disposed?
      mid.dispose if not mid.disposed?
      middle.dispose if not middle.disposed?
      title1.dispose if not title1.disposed?
      title2.dispose if not title2.disposed?
      flash.dispose if not flash.disposed?
      start.dispose if not start.disposed?
      screen.dispose if not screen.disposed?
      Graphics.transition
      Graphics.freeze
     
      Audio.bgm_stop
     
      # -----------------------------------------------------------------
      #     Fin de la scène d'intro
      # -----------------------------------------------------------------
    end

Posté par Suicune31 le 16 Sep - 13:38 (2008)
Hihi ça marche Petit saligaud mal élevé

Mais j'ai une dernière question Yeux motorisés

Si je veux avoir cet écrans titre dans le script de PSP 0.7 . comment dois-je faire ?


Spoiler
 
Code:
 #==============================================================================
# ■ Scene_Title (Version Pokémon)
# Pokemon Script Project - Krosk
# 01/08/07
#------------------------------------------------------------------------------
# Scène modifiable
#------------------------------------------------------------------------------
# Intègre le menu de chargement
#------------------------------------------------------------------------------


class Scene_Title
  def main
    # Redéfinition
   # if $BTEST
    #  battle_test
    #  return
    #end
    
    # === Splashscreen --- Ce sont mes crédits, laissez le svp ;)
   # Graphics.freeze
    @splash = Sprite.new
    @splash.bitmap = RPG::Cache.title("ecrantitre2.png")
    #Graphics.transition(10)
    Graphics.freeze
    Graphics.transition(1)
    compteur = 0
    tr = 1
    until Input.trigger?(Input::C)
      Input.update
      Graphics.update
      compteur += tr
      if compteur == 20 # valeur modifiable pour faire varier la longueur de l'alternance
        @splash.bitmap = RPG::Cache.title("ecrantitre2.png")
        tr = -1
      elsif compteur == 0
        @splash.bitmap = RPG::Cache.title("ecrantitre.png")
        tr = 1
      end
    end
    Graphics.freeze
    @splash.dispose
    Graphics.transition(10)
    Graphics.freeze
    # === Fin de Splashscreen
    
    #@splash = Sprite.new
    #@splash.bitmap = RPG::Cache.title("ecrantitre.png")
    #Graphics.transition(10)
    #Graphics.freeze
    #Graphics.transition(50)
    #Graphics.freeze
    #@splash.dispose
    #Graphics.transition(10)
    #Graphics.freeze
 
    $data_actors        = load_data("Data/Actors.rxdata")
    $data_classes       = load_data("Data/Classes.rxdata")
    $data_skills        = load_data("Data/Skills.rxdata")
    $data_items         = load_data("Data/Items.rxdata")
    $data_weapons       = load_data("Data/Weapons.rxdata")
    $data_armors        = load_data("Data/Armors.rxdata")
    $data_enemies       = load_data("Data/Enemies.rxdata")
    $data_troops        = load_data("Data/Troops.rxdata")
    $data_states        = load_data("Data/States.rxdata")
    $data_animations    = load_data("Data/Animations.rxdata")
    $data_tilesets      = load_data("Data/Tilesets.rxdata")
    $data_common_events = load_data("Data/CommonEvents.rxdata")
    $data_system        = load_data("Data/System.rxdata")
    $picture_data       = load_data("Data/Library.rxdata")
    
    $game_system = Game_System.new
    
    @sprite = Sprite.new
    @sprite.bitmap = RPG::Cache.title($data_system.title_name)
    
    number = 0 # Nombre de cadres de sauvegarde à générer
    for i in 0..2
      if FileTest.exist?("Save#{i+1}.rxdata")
        number += 1
      end
    end
    @number = number
    
    @new_game_window = Window_Base.new(30, 30 + 83*@number, 580, 80)
    @new_game_window.contents = Bitmap.new(548, 48)
    set_window(@new_game_window)
    @new_game_window.contents.draw_text(9,3,548,48,"NOUVELLE PARTIE")
    
    @save_game_window_list = []
    for i in 1..@number
      window = Window_Base.new(30, 30 + 83*(i-1), 580, 80)
      window.contents = Bitmap.new(548, 48)
      @save_game_window_list.push(window)
    end
    
    @index = 0
    
    @background = Plane.new(Viewport.new(0,0,640,480))
    @background.bitmap = RPG::Cache.picture("fondsaved.png")
    @background.z -= 10
    
    $game_system.bgm_play($data_system.title_bgm)
    
    Audio.me_stop
    Audio.bgs_stop
    
    refresh_all
    Graphics.transition
    
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    
    Graphics.freeze
    
    @new_game_window.dispose
    @background.dispose
    for window in @save_game_window_list
      window.dispose
    end
  end
 
  def update
    if Input.trigger?(Input::DOWN)
      @index += @index == @number ? 0 : 1
      refresh_all
    end
    if Input.trigger?(Input::UP)
      @index -= @index == 0 ? 0 : 1
      refresh_all
    end
    if Input.trigger?(Input::C)
      case @index
      when @number # Nouveau jeu
        command_new_game
      else # Chargement
        $game_temp = Game_Temp.new
        on_decision("Save#{@index + 1}.rxdata")
      end
    end
  end
 
  def refresh_all
    for i in 0..@number-1
      if i < @index
        @save_game_window_list[i].opacity = 128
        @save_game_window_list[i].y = 30 + 83*i
        @save_game_window_list[i].height = 80
        @save_game_window_list[i].contents = Bitmap.new(548, 48)
        set_window(@save_game_window_list[i])
        @save_game_window_list[i].contents.draw_text(9, 3, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
      elsif i == @index
        @save_game_window_list[i].opacity = 255
        @save_game_window_list[i].y = 30 + 83*i
        @save_game_window_list[i].height = 163
        @save_game_window_list[i].contents = Bitmap.new(548, 131)
        set_window(@save_game_window_list[i])
        @save_game_window_list[i].contents.draw_text(9, 3, 530, 48, "CONTINUER PARTIE "+(i+1).to_s)
        @filename = "Save#{i + 1}.rxdata"
        list = read_preview(@filename)
        data = list[0]
        time_sec = list[1]
        hour = (time_sec / 3600).to_s
        minute = "00"
        minute += ((time_sec%3600)/60).to_s
        minute = minute[minute.size-2, 2]
        time =  hour + ":" + minute
        name = data[0].to_s
        id = data[1].to_s
        captured = data[2].to_s
        @save_game_window_list[i].contents.draw_text(9, 42, 252, 48, "NOM:")
        @save_game_window_list[i].contents.draw_text(9, 42, 252, 48, name, 2)
        @save_game_window_list[i].contents.draw_text(285, 42, 252, 48, "DUREE:")
        @save_game_window_list[i].contents.draw_text(285, 42, 252, 48, time, 2)
        @save_game_window_list[i].contents.draw_text(9, 81, 252, 48, "POKéDEX:")
        @save_game_window_list[i].contents.draw_text(9, 81, 252, 48, captured, 2)
      elsif i > @index
        @save_game_window_list[i].opacity = 128
        @save_game_window_list[i].y = 30 + 83*i + 83
        @save_game_window_list[i].height = 80
        @save_game_window_list[i].contents = Bitmap.new(548, 48)
        set_window(@save_game_window_list[i])
        @save_game_window_list[i].contents.draw_text(9, 3, 548, 48, "CONTINUER PARTIE "+(i+1).to_s)
      end
    end
    if @index == @number
      @new_game_window.opacity = 255
      @new_game_window.y = 30 + 83*@number
    else
      @new_game_window.opacity = 128
      @new_game_window.y = 30 + 83*(@number+1)
    end
  end
 
  def set_window(window)
    window.contents.font.name = $fontface
    window.contents.font.size = $fontsizebig
    window.contents.font.color = window.normal_color
  end
 
  # --------------------------------------------------------
  # Chargement
  # --------------------------------------------------------
  def read_preview(filename)
    file = File.open(filename, "r")
    time_stamp      = file.mtime
    characters      = Marshal.load(file)
    frame_count     = Marshal.load(file)
    game_system     = Marshal.load(file)
    game_switches   = Marshal.load(file)
    game_variables  = Marshal.load(file)
    total_sec = frame_count / Graphics.frame_rate
    
    # Non utilisé
    game_self_switches = Marshal.load(file)
    game_screen     = Marshal.load(file)
    game_actors     = Marshal.load(file)
    game_party      = Marshal.load(file)
    game_troop      = Marshal.load(file)
    game_map        = Marshal.load(file)
    game_player     = Marshal.load(file)
    # ------------
    read_data       = Marshal.load(file)
    file.close
    return [read_data, total_sec]
  end
 
  def read_save_data(file)
    characters = Marshal.load(file)
    Graphics.frame_count = Marshal.load(file)
    $game_system        = Marshal.load(file)
    $game_switches      = Marshal.load(file)
    $game_variables     = Marshal.load(file)
    $game_self_switches = Marshal.load(file)
    $game_screen        = Marshal.load(file)
    $game_actors        = Marshal.load(file)
    $game_party         = Marshal.load(file)
    $game_troop         = Marshal.load(file)
    $game_map           = Marshal.load(file)
    $game_player        = Marshal.load(file)
    $read_data          = Marshal.load(file)
    $trainer_code       = Marshal.load(file)
    $trainer_id         = Marshal.load(file)
    $trainer_name       = Marshal.load(file)
    $trainer_battler    = Marshal.load(file)
    $pokemon_party      = Marshal.load(file)
    $random_encounter   = Marshal.load(file)
    $data_pokedex       = Marshal.load(file)
    $data_storage       = Marshal.load(file)
    $battle_var         = Marshal.load(file)
    $existing_pokemon   = Marshal.load(file)
    $string             = Marshal.load(file)
    $map_link = $read_data[3] != nil ? $read_data[3] : {}
    if $game_system.magic_number != $data_system.magic_number
      $game_map.setup($game_map.map_id)
      $game_player.center($game_player.x, $game_player.y)
    end
    $game_party.refresh
  end
 
  def on_decision(filename)
    unless FileTest.exist?(filename)
      $game_system.se_play($data_system.buzzer_se)
      return
    end
    $game_system.se_play($data_system.load_se)
    file = File.open(filename, "rb")
    read_save_data(file)
    file.close
    $game_system.bgm_play($game_system.playing_bgm)
    $game_system.bgs_play($game_system.playing_bgs)
    $game_map.update
    $scene = Scene_Map.new
  end
 
  alias alias_command_new_game command_new_game
  def command_new_game
    $map_link = {}
    alias_command_new_game
    #-----------------------------------------------------
    # Variables créées automatiquement au début du jeu
    #   Elles sont absolument nécessaires
    #-----------------------------------------------------
    $pokemon_party = POKEMON_S::Pokemon_Party.new
    $data_storage = [[0]]
    $pokemon_party.create_box
    $trainer_code = rand(2**32)
    $trainer_id = ($trainer_code % (2**16))
    $trainer_id = sprintf("%05d", $trainer_id)
    $trainer_name = $game_actors[1].name
    $trainer_battler = $game_actors[1].battler_name
    $random_encounter = Array.new(7)
    $random_encounter[0] = 0
    $battle_var = POKEMON_S::Pokemon_Battle_Variable.new
    $existing_pokemon = []
    $string = []
  end
end

Posté par Krosk le 16 Sep - 13:52 (2008)
Entre :
Code:
      # -----------------------------------------------------------------
      #     La scène d'intro commence ici (non MAPINTRO)
      # -----------------------------------------------------------------
      # Elle est bien sûr modifiable à votre goût.
      # -----------------------------------------------------------------


Et :
Code:
      # -----------------------------------------------------------------
      #     Fin de la scène d'intro
      # -----------------------------------------------------------------


Tu remplace tout par :
Code:
    @splash = Sprite.new
    @splash.bitmap = RPG::Cache.title("ecrantitre2.png")
    #Graphics.transition(10)
    Graphics.freeze
    Graphics.transition(1)
    compteur = 0
    tr = 1
    until Input.trigger?(Input::C)
      Input.update
      Graphics.update
      compteur += tr
      if compteur == 20 # valeur modifiable pour faire varier la longueur de l'alternance
        @splash.bitmap = RPG::Cache.title("ecrantitre2.png")
        tr = -1
      elsif compteur == 0
        @splash.bitmap = RPG::Cache.title("ecrantitre.png")
        tr = 1
      end
    end
    Graphics.freeze
    @splash.dispose
    Graphics.transition(10)
    Graphics.freeze



... Franchement, si c'était juste pour avoir un écran titre aussi bateau, t'aurai vraiment pu de fouler pour le faire en event hein.......

Tu sais ce qui te reste à faire si ca marche.

Posté par Suicune31 le 22 Sep - 12:33 (2008)
Je viens de m'arracher à faire un écrans titre je voulais savoir comment sa faisait  Bouche extensiblek:

Puis je pense que je vais plutôt crée un écrant titre a partir du tien ( Remplacer les couleur et GIRATINA) je doit avoué que ton INTRO  est  comment dire . . .
Magnifique  :shock:

. bon voilà Je te remercie pour tout Krosk c'est simpas Bouche extensiblek:

EDIT : quand j'appuis  Sur F12 pour relancer mon jeu . . . sa retourne a lécrans titre au lieu de recommencer l'intro .

Posté par Krosk le 22 Sep - 13:10 (2008)
Met cette ligne dansl e script Main, après le premier begin.
Code:
$_temp_map_intro = nil

Posté par Suicune31 le 22 Sep - 13:22 (2008)
Merci beaucoup Krosk  Bouche extensiblek: