Sujet n°9605
Posté par Giratinaprimal le 14 Avr - 23:18 (2011)
Titre : Faire varier le background combat en fctn du temps ?
Comme sur les versions DSbêta et 5G de PSP, je souhaite faire varier le background de combat
selon que ce soit le jour, le soir ou la nuit. J'ai mis ça au début du Script Pokemon_Battle_Core1 :


Script de chgt de background

def main
      pause
      # Pré-création des Sprites
      # Fond
      if @battleback_name != ""
        if $game_variables[4995] == "Jour" and $game_switches[4994] == true
          @battleback_name = $game_map.battleback_name + ".png"
          @ground_name = "ground" + $game_map.battleback_name + ".png"
          @ground_name_actor = "ground" + $game_map.battleback_name + "_actor.png"       
        elsif $game_variables[4995] == "Crépuscule" or $game_variables[4995] == "Matin" and $game_switches[4994] == true
          @battleback_name = $game_map.battleback_name + "_after.png"
          @ground_name = "ground" + $game_map.battleback_name + "_after.png"
          @ground_name_actor = "ground" + $game_map.battleback_name + "_actor_after.png"        
        elsif $game_variables[4995] == "Nuit" and $game_switches[4994] == true
          @battleback_name = $game_map.battleback_name + "_nuit.png"
          @ground_name = "ground" + $game_map.battleback_name + "_nuit.png"
          @ground_name_actor = "ground" + $game_map.battleback_name + "_actor_nuit.png"        
        elsif $game_switches[4994] == false
          @battleback_name = $game_map.battleback_name + ".png"
          @ground_name = "ground" + $game_map.battleback_name + ".png"
          @ground_name_actor = "ground" + $game_map.battleback_name + "_actor.png"        
        end      
      else
        print("Attention, réglez le BattleBack du Tileset.")
        @battleback_name = "000.png"
        @ground_name = "ground000.png"
      end
      @background = Sprite.new
      @background.z = @z_level



Et, même de nuit, j'ai les backgrounds de jour et pourtant, le SwitchExtérieur est activé.


Si quelqu'un peut m'aider ? Merci d'avance.

Posté par Pαlвσlѕку le 14 Avr - 23:44 (2011)
Dans PSP DS, le système Jour/Nuit est déjà intégrer avec les changements de background.

Donc normalement, tu n'as rien besoin de changer.

Posté par Giratinaprimal le 15 Avr - 09:57 (2011)
Ben, sur PSP4G+ (que j'utilise), ça marche pas. Y a un truc à ajouter dans le script TempsJourNuit ?